Darth Kaan Posted February 10, 2003 Share Posted February 10, 2003 ..say you have an enclosed area with four enemy NPC's and the only way out of that area, is to turn off a forcefield via a switch which will then allow access to the exit. I know how to link the switch and forcefield to turn it off, but... how can you make the switch where it will only work after all four of the enemies have been dispatched? Any insight would be appreciated. Link to comment Share on other sites More sharing options...
Suicide20 Posted February 10, 2003 Share Posted February 10, 2003 First create a simple script with one command. Use "act_force" Second link a target_activate to your forcefield trigger. Third create a target_counter and name it "act_force". The count will be the number of NPC's that need to die. The target will be the target_activate. Fourth for each NPC add the following DeathScript "Scriptname" There you have it... Each time your NPC dies, he will fire the counter, when the counter reaches his mark he will fire the activator allowing you to lower the force fields. PS. don't forget to change your forcefield trigger to activator. PSS, You could do this all with scriptting but I find it easier to do it this way. Since you wouldn't have to declare any variables at the level start... Link to comment Share on other sites More sharing options...
Darth Kaan Posted February 10, 2003 Author Share Posted February 10, 2003 Thanks S20, Well the button to turn the forcefield off is now unusable, but the trigger_activate is not working because even when the enemy npc's are all dead the switch still won't work. Please check your pm's. Link to comment Share on other sites More sharing options...
lassev Posted February 10, 2003 Share Posted February 10, 2003 Hmm, in my experience you can just connect (target) the NPCs to the target_counter. Then go forward as previously with the target_activate and a trigger deactivated in Radiant. You don't need any scripts for this job. An NPC will launch it's target at the sober moment of dying. Link to comment Share on other sites More sharing options...
Leslie Judge Posted February 10, 2003 Share Posted February 10, 2003 Yes, and if I remember the simple targeting doesn't work, but if you give the NPCs a key 'NPC_target' and the value which is the targetname of the target_counter it should work. Without scripting. Link to comment Share on other sites More sharing options...
Darth Kaan Posted February 10, 2003 Author Share Posted February 10, 2003 Hmmm, that sounds logical. I will give that a try. Link to comment Share on other sites More sharing options...
Dea Posted February 10, 2003 Share Posted February 10, 2003 small hint, for key's of all npc's look at the npc_*** entity in your editor, This is NOT an actual entity in the game, but the descrition shows all key's and possible values that go for all other npc's Link to comment Share on other sites More sharing options...
Darth Kaan Posted February 10, 2003 Author Share Posted February 10, 2003 Thanks Gents, I got it working thanks to your help. Much appreciated! =) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.