Frictional Games Forum (read-only)
Despawns after following path - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Despawns after following path (/thread-8274.html)



Despawns after following path - Karai16 - 05-27-2011

Hey guys, I'm testing my new map right now (it's a test map so don't worry about me publishing it) the thing is. I make a suitor follow a path. I never made a script area to dispawn it, so it should follow its path back and forth for all eternity. The thing is, it doesn't. after following its path, it despawns... what am I doing wrong? O.o


RE: Despawns after following path - Mooserider - 05-27-2011

I had the same problem, I think all enemies despawn after reaching their last node. I made an area around my last node that led him back to his first node and it works pretty well but I had to have every single pathnode in his first patrol in the new function. Hope this helps


RE: Despawns after following path - Greven - 05-27-2011

Say you have like 3 path nodes. Pathnode1 2 and 3 the only thing you gotta do is add the pathnodes.
Code:
void Function()
{
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode2", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode3", float afWaitTime, string& asAnimation);
}
And then you just add the pathnode1 again.
void AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);

So it will look like this:
Code:
void Function()
{
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode2", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode3", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
}
Then when it reaches the pathnode1 it will repeat the action by going to number 2 then 3 and then continue patrolling