Frictional Games Forum (read-only)

Full Version: Really need help with a monster loop.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Been trying for hours to loop a monster and I just can't do it. Tried 'for' and everything; pretty new to scripting by the way. It's killing me, I just want a monster to follow a few path nodes along a corridor; then loop around a room. Somebody please help Undecided

I can make it follow the path nodes but the loop is out of the question Angry
can you send me the script you have so far then i can see what's wrong
Monsters become disabled when either the player is out of its activation distance or when they reach the last patrol node while the player doesn't see the monster. If you edit the monster, you can increase the activation distance and you can override AutoRemoveAtPathEnd in the user defined variables of the entity so that the monster doesn't get disabled when it reaches the final patrol node.

You do not have to continually add patrol nodes to the monster. There's a reason why they're called patrol nodes: the monster will loop through them automatically.
Then just do
AddEntityCollideCallback("Grunt", "GruntLoop1", "Nodes1", false, 1);

AddEntityCollideCallback("Grunt", "GruntLoop2", "Nodes2", false, 1);

}


void Nodes1(string &in asParent, string &in asChild, int alState)
{
ClearEnemyPatrolNodes("Grunt");
AddEnemyPatrolNode("Grunt", "PathNodeArea_2", 1, "");
}


void Nodes2(string &in asParent, string &in asChild, int alState)
{
ClearEnemyPatrolNodes("Grunt");
AddEnemyPatrolNode("Grunt", "PathNodeArea_1", 1, "");
}