• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger which ends a Trigger

Status
Not open for further replies.
Level 4
Joined
Jan 24, 2012
Messages
55
Hi Guys,

I search a solution for the following problem:

Trigger A triggers every X seconds; all actions together have an duration of circa 120 seconds (lot of wait-actions).

Trigger B will be executed if a specific unit enters Area XY; this trigger should deactivate Trigger A (turn off trigger; easy) and cancel all pending actions of Trigger A/stop the execution of Trigger A immediately.

I didn't found any action for this...

Someone can help me how to get such a "'stop-another-trigger'-trigger"? Thanks :)
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
I've got a feeling that first trigger has a lot of bugs since you are using a lot of waits. I doubt there's a simple way to do that, because there is really no action for that. You have to find a workaround somehow and I don't think skip remaining actions would work for this case. Also, posting the triggers would be great.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can do a check if trigger A is disabled.
If so, you do "Skip Remaining Actions".
You should do this after every single wait.

But I have to agree with Rheiko that I do not like wait actions...
They are generally bad when you want to have proper accuracy in their duration.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
  • Trigger A
    • Events
    • Conditions
    • Actions
      • -------- Do Something --------
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((This trigger) is on) Equal to False
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • -------- Do Something --------
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((This trigger) is on) Equal to False
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • -------- Do Something --------
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((This trigger) is on) Equal to False
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • -------- Do Something --------
 
Level 4
Joined
Jan 24, 2012
Messages
55
Thanks for your help!

here my trigger:

  • NEAttack
    • Ereignisse
      • Zeit - Every 1.00 seconds of game time
    • Bedingungen
      • ((AngreifferNE is empty) Gleich True) or ((All units of AngreifferNE are dead) Gleich True)
    • Aktionen
      • Auslöser - Turn off (This trigger)
      • Einheit - Create 1 Bogenschützin for Spieler 11 (Dunkelgrün) at (Center of Elfen Spawn <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set AngriffNE[1] = (Last created unit)
      • KI - Ignore AngriffNE[1]'s guard position
      • Einheit - Order AngriffNE[1] to Bewegen nach (Center of NEWait1 <gen>)
      • Einheit - Create 1 Bogenschützin for Spieler 11 (Dunkelgrün) at (Center of Elfen Spawn <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set AngriffNE[2] = (Last created unit)
      • KI - Ignore AngriffNE[2]'s guard position
      • Einheit - Order AngriffNE[2] to Bewegen nach (Center of NEWait1 <gen>)
      • Einheit - Create 1 Bogenschützin for Spieler 11 (Dunkelgrün) at (Center of Elfen Spawn <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set AngriffNE[3] = (Last created unit)
      • KI - Ignore AngriffNE[3]'s guard position
      • Einheit - Order AngriffNE[3] to Bewegen nach (Center of NEWait1 <gen>)
      • Einheit - Create 1 Jägerin for Spieler 11 (Dunkelgrün) at (Center of Elfen Spawn <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set AngriffNE[4] = (Last created unit)
      • KI - Ignore AngriffNE[4]'s guard position
      • Einheit - Order AngriffNE[4] to Bewegen nach (Center of NEWait1 <gen>)
      • Einheit - Create 1 Jägerin for Spieler 11 (Dunkelgrün) at (Center of Elfen Spawn <gen>) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set AngriffNE[5] = (Last created unit)
      • KI - Ignore AngriffNE[5]'s guard position
      • Einheit - Order AngriffNE[5] to Bewegen nach (Center of NEWait1 <gen>)
      • Wait 32.00 seconds
      • KI - Ignore AngriffNE[1]'s guard position
      • Einheit - Order AngriffNE[1] to Bewegen nach (Center of NEWait2 <gen>)
      • KI - Ignore AngriffNE[2]'s guard position
      • Einheit - Order AngriffNE[2] to Bewegen nach (Center of NEWait2 <gen>)
      • KI - Ignore AngriffNE[3]'s guard position
      • Einheit - Order AngriffNE[3] to Bewegen nach (Center of NEWait2 <gen>)
      • KI - Ignore AngriffNE[4]'s guard position
      • Einheit - Order AngriffNE[4] to Bewegen nach (Center of NEWait2 <gen>)
      • KI - Ignore AngriffNE[5]'s guard position
      • Einheit - Order AngriffNE[5] to Bewegen nach (Center of NEWait2 <gen>)
      • Wait 18.00 seconds
      • KI - Ignore AngriffNE[1]'s guard position
      • Einheit - Order AngriffNE[1] to Bewegen nach (Center of WaitbeforeBase <gen>)
      • KI - Ignore AngriffNE[2]'s guard position
      • Einheit - Order AngriffNE[2] to Bewegen nach (Center of WaitbeforeBase <gen>)
      • KI - Ignore AngriffNE[3]'s guard position
      • Einheit - Order AngriffNE[3] to Bewegen nach (Center of WaitbeforeBase <gen>)
      • KI - Ignore AngriffNE[4]'s guard position
      • Einheit - Order AngriffNE[4] to Bewegen nach (Center of WaitbeforeBase <gen>)
      • KI - Ignore AngriffNE[5]'s guard position
      • Einheit - Order AngriffNE[5] to Bewegen nach (Center of WaitbeforeBase <gen>)
      • Wait 18.00 seconds
      • KI - Ignore AngriffNE[1]'s guard position
      • Einheit - Order AngriffNE[1] to Angreifen/Bewegen nach (Center of Basis Orcs <gen>)
      • KI - Ignore AngriffNE[2]'s guard position
      • Einheit - Order AngriffNE[2] to Angreifen/Bewegen nach (Center of Basis Orcs <gen>)
      • KI - Ignore AngriffNE[3]'s guard position
      • Einheit - Order AngriffNE[3] to Angreifen/Bewegen nach (Center of Basis Orcs <gen>)
      • KI - Ignore AngriffNE[4]'s guard position
      • Einheit - Order AngriffNE[4] to Angreifen/Bewegen nach (Center of Basis Orcs <gen>)
      • KI - Ignore AngriffNE[5]'s guard position
      • Einheit - Order AngriffNE[5] to Angreifen/Bewegen nach (Center of Basis Orcs <gen>)
      • Wait 60.00 seconds
      • Auslöser - Turn on (This trigger)
this one sends 5 NE units at equal intervals to several positions, on every positon the 5 units wait the defined time (wait XX.XX seconds)

at the time the units should arrive succesfully on the last positon the trigger turns ON again - if the units died on the way to the target a 2nd group will spawn etc. untill the units arrive at the target.

the trigger which should stop the trigger above is this one:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • ((AngreifferNE is empty) Gleich True) or ((All units of AngreifferNE are dead) Gleich True)
    • 'THEN'-Aktionen
      • Do nothing
    • 'ELSE'-Aktionen
      • KI - Recycle AngriffNE[1]'s guard position
      • KI - Recycle AngriffNE[2]'s guard position
      • KI - Recycle AngriffNE[3]'s guard position
      • KI - Recycle AngriffNE[4]'s guard position
      • KI - Recycle AngriffNE[5]'s guard position
      • Einheit - Order AngriffNE[1] to Angreifen/Bewegen nach (Center of Elfen Basis <gen>)
      • Einheit - Order AngriffNE[2] to Angreifen/Bewegen nach (Center of Elfen Basis <gen>)
      • Einheit - Order AngriffNE[3] to Angreifen/Bewegen nach (Center of Elfen Basis <gen>)
      • Einheit - Order AngriffNE[4] to Angreifen/Bewegen nach (Center of Elfen Basis <gen>)
      • Einheit - Order AngriffNE[5] to Angreifen/Bewegen nach (Center of Elfen Basis <gen>)
    • Auslöser - Turn off NEAttack <gen>
    • Einheitengruppe - Add Koreth Skullseeker 0221 <gen> to AngreifferNE
If the Trigger above turns OFF all units get the command to move at area XY; there the AI get free command over hem.
Koreth Skullseeker is a char that can't die, so I add him to the unitgroup to prevent the spawning of the units in later game.

I think your suggested solution won't work because my trigger "always" is OFF, the 'If'-condition will always be true
 
Level 4
Joined
Jan 24, 2012
Messages
55
hmmm, sounds nice.

I dont' remember that I ever used the 'elapsed gametime'-trigger...

It is right that with this one the action will allways repeat untill I turn Off the Trigger?
(because elapsed gametime is always equal to 1 second? but have to be equal to at least 1 second)

-elapsed gamtime at least 1 second
-create units
-units move to pint A
-wait
-units move to point B
-wait
-end of trigger
-start over if not turned OFF

-> should work like this, right?
 
Level 4
Joined
Jan 24, 2012
Messages
55
hm, okay, but I need an trigger which allows a never-ending loop (-> trigger always start over untill I stop him)

If I'm right would a trigger with elapsed game time just fire once on second 1 and don't trigger again (->no loop)
 
Level 4
Joined
Jan 24, 2012
Messages
55
I turn the Trigger back On after the last action (wait 60.00 seconds).

After all actions the trigger goes ON, then it checks the event -> every seconds, and restart the whole thing. -> loop
 
Status
Not open for further replies.
Top