Demeggy Posted March 22, 2011 Share Posted March 22, 2011 Hi all, I'm trying to achieve what feels like the impossible at the moment. Basically; I've got a script which will randomly enable an NPC thus 'spawning' them.The npc has an AI package which forces them to 'charge' towards an xmarker.What I want is for the npc to hit a trigger, check if a variable from another script is true and disable (i.e. 'magic away') the NPC. Given example; Bob's our NPC; he spawns 7 seconds in, and charges the xmarker. He hits the trigger box, but the 'kill' variable is still 0. The player activates a key which sets the 'kill' variable to 1. Bob then magically disappears (whilst he's still inside the trigger). I've poured my brain into GECK for hours trying to work out how to do this without much luck. Any theories greatly appreciated. Kris Link to comment Share on other sites More sharing options...
PaladinRider Posted March 22, 2011 Share Posted March 22, 2011 I'll offer a few tips:You'll need a few scripts. One to enable the NPC. Immediately after enable, call EvaluatePackage on that NPC. He should charge now. On trigger, Begin OnTriggerEnter bobref is what you want. Insdie that block do If key == 1Bobref.disable Link to comment Share on other sites More sharing options...
PaladinRider Posted March 22, 2011 Share Posted March 22, 2011 sorry for grammar as I am on my phone. If you tell me what the specific issue is, I can help further. (Ie is bob even enableing after 7 seconds?) Link to comment Share on other sites More sharing options...
Demeggy Posted March 23, 2011 Author Share Posted March 23, 2011 Wonderful :) Thanks! Now, what if Bobref and his entire family turned up? So we're talking multiple NPC's now. Link to comment Share on other sites More sharing options...
PaladinRider Posted March 23, 2011 Share Posted March 23, 2011 Well, if Bobref's family is only enabled when bob himself is enabled, then you can simply just make each family member have Bobref as their enable parent. If bobref is disabled, every family member will be disabled as well. When you enable bobref, his entire family enables at the same time. This is also helpful to keep the number of references down. Link to comment Share on other sites More sharing options...
Recommended Posts