Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Issues Help Monster Path
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#1
Monster Path

I have been trying to set a monster and its path nodes. When I open the map, it just stands there. Another problem that I am having is that when ever I put a monster in, it always looks along the x-axis, even though it has been rotated in the editor.
Any ways here is my script. I have already checked the names of everything.
////////////////////////////
// Run when starting map
void OnStart()
{
SetEntityCallbackFunc("tinder", "OnPickup");    
SetEntityCallbackFunc("scroll", "OnPickup2");
AddEntityCollideCallback("Player", "trigger", "monster", true, 1);
AddEntityCollideCallback("servant_grunt_1", "disable", "disable", true, 1);
}
void OnPickup(string &in asEntity, string &in type)
{
  SetEntityActive("body", true);
  PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
    AddTimer("", 0.7, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("body", false);
}
void OnPickup2(string &in asEntity, string &in type)
{
SetEntityActive("fish", true);
PlaySoundAtEntity("", "impact_water_high.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(15, true);
AddTimer("", 0.4, "look");
}
void look(string &in asTimer)
{
StartPlayerLookAt("fish", 3, 5, "");
}
void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_10", 1, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_19", 0, "");
}
void disable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
AutoSave();
}[/code]
If you can spot what I did wrong, I'd appreciate it.

The Necromancer's Touch: WIP Coming March 2013
(This post was last modified: 02-08-2013, 03:09 AM by assassinhawk45.)
02-08-2013, 03:08 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Monster Path

Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.

02-08-2013, 06:41 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#3
RE: Monster Path

Try to put path node into the map.
And then the script it with the "AddEnemyPatrolNode" if I'm correct.

[Image: the-cabin-in-the-woods-masked-people.jpg]
02-08-2013, 06:52 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Monster Path

(02-08-2013, 06:41 AM)palistov Wrote: Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.
Hi. I also have this problem too. But there is no .nodes file in my maps/ folder. How do i add them?

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-08-2013, 07:17 AM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#5
RE: Monster Path

Looks like you're using PosNodes instead of PathNodes. PosNodes are for ropes. PathNodes are for the AI.

[Image: 16455.png]
(This post was last modified: 02-08-2013, 07:38 AM by MulleDK19.)
02-08-2013, 07:22 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#6
RE: Monster Path

(02-08-2013, 07:17 AM)JustAnotherPlayer Wrote:
(02-08-2013, 06:41 AM)palistov Wrote: Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.
Hi. I also have this problem too. But there is no .nodes file in my maps/ folder. How do i add them?

The file should be created when the map is run.

In Ruins [WIP]
02-08-2013, 07:31 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#7
RE: Monster Path

(02-08-2013, 07:22 AM)MulleDK19 Wrote: Looks like you're using PosNodes instead of PathNodes. PosNodes are for ropes. PathNodes are for the AI.

There's my answer. Use that and use the script.

[Image: the-cabin-in-the-woods-masked-people.jpg]
02-08-2013, 08:21 AM
Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#8
RE: Monster Path

Wow. I really need to pay more attention to the level editor. Thanks!

The Necromancer's Touch: WIP Coming March 2013
02-08-2013, 09:32 PM
Find




Users browsing this thread: 2 Guest(s)