Frictional Games Forum (read-only)

Full Version: Yet another script question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
(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 ?
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.
(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