Frictional Games Forum (read-only)
Infinite Patroling - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Infinite Patroling (/thread-14391.html)



Infinite Patroling - RedMser - 03-31-2012

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


RE: Infinite Patroling - Your Computer - 03-31-2012

http://www.frictionalgames.com/forum/thread-11236-post-124701.html#pid124701

Also, keep in mind that a monster will deactivate if the player is out of its activation distance.


RE: Infinite Patroling - Damascus - 03-31-2012

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.



RE: Infinite Patroling - palistov - 03-31-2012

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.


RE: Infinite Patroling - ClayPigeon - 03-31-2012

Or...

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

I think this should work...


RE: Infinite Patroling - Your Computer - 03-31-2012

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.