HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Removing events from triggers

08-08-2006, 04:16 AM#1
Insidious
is there a way to remove an event from a trigger say for example i just did:

Trigger - Add to Trigger multishot <gen> the event (Unit - (Attacked unit) Takes damage)


and now i want to remove it after the trigger runs, to remove stacking events, and ones i dont want.
08-08-2006, 04:19 AM#2
Naakaloh
No, the best solution is probably to create a new trigger and dispose of the old one.
08-08-2006, 04:26 AM#3
Insidious
ughhh.... would you mind giving me a quick example of how to do that?
08-08-2006, 05:42 AM#4
Rising_Dusk
Collapse JASS:
call DestroyTrigger(YourTrig)
set YourTrig = CreateTrigger()
call TriggerRegisterUnitEvent(YourTrig, YourUnit, SomeEvent)
call TriggerAddAction(YourTrig, function YourActions)

Something along those lines.
Either that or if you use GUI, use specific unit events to prevent confusion or stacking events as you call them.
08-08-2006, 06:38 AM#5
Wyvernoid
Hello ^_^
Here's what I think would be convenient in GUI:
Trigger1:
Events - None (for later adding)
Conditions - As you like
Collapse Actions
Trigger - Turn off (This Trigger)
Trigger - Run RealTrigger <gen>(Ignoring Conditions)
Trigger2:
Events - None (for later adding)
Conditions - As you like
Collapse Actions
Trigger - Turn off (This Trigger)
Trigger - Run RealTrigger <gen>(Ignoring Conditions)
RealTrigger:
Events - None (This trigger is called from Trigger1 and Trigger2)
Conditions - None(Suggest you put nothing here)
Actions - Anything you would like to run
And when you want the trigger to be executed just add events to trigger1 and trigger2 and triggerx(if you made them)... and for every event it will be executed once.
-----------------In fact: it's not so convenient ^_^
08-08-2006, 11:59 PM#6
Insidious
Quote:
Originally Posted by Rising_Dusk
Collapse JASS:
call DestroyTrigger(YourTrig)
set YourTrig = CreateTrigger()
call TriggerRegisterUnitEvent(YourTrig, YourUnit, SomeEvent)
call TriggerAddAction(YourTrig, function YourActions)

Something along those lines.
Either that or if you use GUI, use specific unit events to prevent confusion or stacking events as you call them.

i avoid using jass but am always willing to learn but i am confused by this part:

set YourTrig = CreateTrigger()

is this the part that actually creates the new trigger? it seems just like your setting the trigger you just destroyed as a new tirgger variable. which has me lost...