scribe308 0 Posted February 28, 2006 Hi all, I'm new to this and apologize for my lack of knowledge, but I'm trying to make a trigger that plays a sound (did it) and becomes inactive when a local enemy is killed (named "ins_1") Can I put a quick line of code into the condition line in the trigger that accomplishes the following:? when enemy (ins_1) is not alive, setactivation to false Thanks for any help. I think it's the details of the scripting language that have me stumped... Scribe308 Share this post Link to post Share on other sites
steve1982 0 Posted February 28, 2006 in the condition space for the trigger that plays the sound: ! alive ins_1 Share this post Link to post Share on other sites
Garcia 0 Posted February 28, 2006 in the condition space for the trigger that plays the sound:! alive ins_1 that would trigger the trigger when the unit dies, making the sound start first when ins_1 is dead. Only way to stop the sound is by deleteing the trigger, I think. So if  you put "this && (alive ins_1)" in the condition field, and give the trigger a name, then in the on deactivation field you put "deletevehicle triggername", where triggername is the name of the trigger. Hmm, that didn't work. You'll just have to name the trigger something, then add another trigger, put "! alive ins_1" in the condition field, then in the on activation field you'll have to put "deletevehicle triggername". Share this post Link to post Share on other sites
scribe308 0 Posted February 28, 2006 Thanks guys, I'll try your ideas. BTW, do you think it's easier to have this in a script that constantly runs? a continual loop that checks for enemy dead and delets triggers when that condition is met? Scribe308 Share this post Link to post Share on other sites
Garcia 0 Posted February 28, 2006 I would have used a script, not because it's easier, but because it would look better in the editor Share this post Link to post Share on other sites
karantan 0 Posted February 28, 2006 I would have used a script, not because it's easier, but because it would look better in the editor ? ? ? Â Â ? ? ? Share this post Link to post Share on other sites
UNN 0 Posted February 28, 2006 What about, something like, this? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This AddEventHandler ["killed",{PlaySound "YourSound"}] Put it in your guys Init field and it will play when he is killed. Might get a bit more complicated than that in Multi Player though. Share this post Link to post Share on other sites
Garcia 0 Posted March 1, 2006 I would have used a script, not because it's easier, but because it would look better in the editor ? ? ? Â Â ? ? ? If you got a lot of easy stuff to do, you might want to do it in a trigger, but I prefer doing it in a script, because if I have 300 small things like that in triggers, that would be a lot of triggers, and therefor the editor would look like a mess (when I say editor I mean the mission would look like a mess when editing ingame). UNN, he wants to stop a sound, that is started by a trigger, when the unit dies (I think he's using one of those sounds in the effect thingy in the trigger). Share this post Link to post Share on other sites
UNN 0 Posted March 1, 2006 Quote[/b] ]UNN, he wants to stop a sound, that is started by a trigger, when the unit dies  (I think he's using one of those sounds in the effect thingy in the trigger). I see then just use this instead <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This AddEventHandler ["killed",{DeleteVehicle YourTrigger}] Share this post Link to post Share on other sites
Garcia 0 Posted March 1, 2006 Yesh, that would actually be the best way TBH (Why didn't I think about using a EH? ) Share this post Link to post Share on other sites