Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yet another script question
Author Message
ammislol Offline
Junior Member

Posts: 24
Joined: Feb 2012
Reputation: 0
Post: #1
Yet another script question

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.
02-18-2012 10:29 PM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 803
Joined: Jul 2011
Reputation: 66
Post: #2
RE: Yet another script question

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
Find all posts by this user Quote this message in a reply
ammislol Offline
Junior Member

Posts: 24
Joined: Feb 2012
Reputation: 0
Post: #3
RE: Yet another script question

(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 ?
02-18-2012 10:44 PM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 803
Joined: Jul 2011
Reputation: 66
Post: #4
RE: Yet another script question

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
Find all posts by this user Quote this message in a reply
ammislol Offline
Junior Member

Posts: 24
Joined: Feb 2012
Reputation: 0
Post: #5
RE: Yet another script question

(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
02-18-2012 11:12 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)