• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

How do you remove events?

Status
Not open for further replies.
Level 12
Joined
Feb 23, 2007
Messages
1,030
I use GUI. I have a trigger where I add an event to a trigger and then I need a way to remove it or else they will stack up. Is there any way to do this? Some custom script I can add in?
Is there an alternative?

This is what im doing now.

Other trigger.
Events: *none because I add events to it*
Conditions: Picked unit has buff.
Actions:
Turn off this trigger
Deal damage taken to picked unit
>Insert remove event script<
Turn on this trigger

I use Silence to add a buff to the units. Then i select all units with that buff in casting range and add them to unit group. Then i select all units in group and add the event.
 
Level 10
Joined
Jun 26, 2007
Messages
659
"picked unit" is for "Pick every unit and do action(s)"
in a trigger, use "triggering unit"

you can't remove an event from the trigger

instead, you should replace your condition and your action by 2 functions

function your_condition takes nothing returns boolean
// return true if the GetTriggerUnit match the condition you want to
endfunction
function your_actions takes nothing returns nothing
// do what you want to the GetTriggerUnit
// turn off "this trigger"
endfunction

then, instead of adding an event in a initial trigger, do this :
declare a local trigger
add it your events
add it the two functions as condition and action
wait until it is disabled in a loop
and then, remove it
 
Status
Not open for further replies.
Top