Frictional Games Forum (read-only)

Full Version: Infinite Patroling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, as the title says, how to make any enemy patrol forever, like basile in Justine? Normally, when making serval patrol nodes, the enemy goes away after doing those, but how did they do that with basile so he just patrols forever and never goes away? The script didn't help and I am sorry if I am just stupid, but I need a quick answer. Thanks! Cool
http://www.frictionalgames.com/forum/thr...#pid124701

Also, keep in mind that a monster will deactivate if the player is out of its activation distance.
Is there a way to change that? I don't think basille deactivated like that, and maybe it's just something you have to change in the entity file.
If you want to make a monster patrol infinitely, pick two of path nodes which the monster will move along. If it's a linear path, choose the two end points, if it's a circular or other irregular path, just choose any two that are decently far apart.


Around each path node, create a script area. Add an entity collide callback between the monster and each script area. When the monster collides with one area, run a function which adds patrol nodes leading to the OTHER area, and vice versa. This way, the monster will always be moving because it always has somewhere to go. Shouldn't be any issue if the player is seen by the monster, since it will return to its last path node and continue its scripted path when it stops hunting/searching for the player.
Or...

Code:
for(;;)
{    
    for(int i = 1; i < howmuchpatrolnodesyouhave+1; i++)
    {
       AddEnemyPatrolNode("enemy", "patrol_node_names_"+i, 0);    
    }
}

I think this should work...
You can edit the monster to increase the activation distance. Likewise, you can set AutoRemoveAtPathEnd to false in the .ent file. This is all that is required. Using script areas with "collision patrolling" (if you will) does not do away with the activation distance issue. Constantly adding the patrol nodes to the monster doesn't get rid of the activation distance issue either, plus the patrol nodes remain in the monster's "memory" until cleared anyway. Also, having an infinite loop can prevent the game from working.