Frictional Games Forum (read-only)
Yet another script question - 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: Yet another script question (/thread-13413.html)



Yet another script question - ammislol - 02-18-2012

Hey again! I've got one more question..
I have a monster that will activate when the player picks up a key - I want the monster to follow the pathnodeareas I've put out. And then disappear when he can't see/hear the player anymore. Cause now the monster just stays and hug the door where the player went out. Is that possible?


Thanks in advance.


RE: Yet another script question - Obliviator27 - 02-18-2012

In your EntityInteractCallback, have SetEntityActive, then AddEnemyPatrolNode to the pathnode at the end of the path. He'll automatically follow pathnodes to get there. The monster will auto-disable when it gets a certain distance from the player. Worst case scenario, force a deactivate with a AddEntityCollideCallback and SetEntityActive.



RE: Yet another script question - ammislol - 02-18-2012

(02-18-2012, 10:39 PM)Obliviator27 Wrote: In your EntityInteractCallback, have SetEntityActive, then AddEnemyPatrolNode to the pathnode at the end of the path. He'll automatically follow pathnodes to get there. The monster will auto-disable when it gets a certain distance from the player. Worst case scenario, force a deactivate with a AddEntityCollideCallback and SetEntityActive.
So I dont have to do anything with the deactivate? It will auto-disable if the player runs away ?


RE: Yet another script question - Obliviator27 - 02-18-2012

He should automatically deactivate if he is at the end of his path, and is nowhere near or detecting the player. As I said, worst case scenario is you force him to deactivate.



RE: Yet another script question - ammislol - 02-18-2012

(02-18-2012, 10:46 PM)Obliviator27 Wrote: He should automatically deactivate if he is at the end of his path, and is nowhere near or detecting the player. As I said, worst case scenario is you force him to deactivate.
Okay, thank you. Smile