Disabling a trigger

Baltazhar

Active Member
Reaction score
55
Hey guys...

Been a long time since I mapped, but I have an ongoing project with a map.
To sum the problem up:

Unit A uses ulti, and turns into Unit B.
Turn off the trigger (to prevent further executions for now)
Wait 20 seconds
Unit B turns back into Unit A
Unit A is ordered to use it's Ulti (to get the cooldown showing).
Wait 30 seconds
Turn on trigger

What I don't get, is that apparently the trigger is turned off (checked with other triggers), but still after the 20 seconds, when Unit A uses his ulti, he turns back into Unit B... And keeps repeating ofc. This is my problem.

For all of you fellow nerds, here's the full trigger code:
Code:
Pandaren Fury Player 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pandaren Fury 
        (Owner of (Triggering unit)) Equal to Player 1 (Red)
    Actions
        Countdown Timer - Start PandarenFuryTimer[(Player number of (Triggering player))] as a One-shot timer that will expire in 20.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Pandaren Fury:
        Set PandarenFuryTimerWindow[(Player number of (Triggering player))] = (Last created timer window)
        Countdown Timer - Show PandarenFuryTimerWindow[(Player number of (Triggering player))] for (Triggering player)
        Set Temp_Point = (Position of (Triggering unit))
        Unit - Create 1 Pandaren Fury (Dummy) for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
        Unit - Add a 22.00 second Generic expiration timer to (Last created unit)
        Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Storm, Earth, And Fire
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 125.00)
        Set Temp_Point = (Position of (Triggering unit))
        Unit - Create 1 Pandaren Fury for (Owner of (Triggering unit)) at Temp_Point facing (Facing of (Triggering unit)) degrees
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Hero - Set (Last created unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
        Hero - Modify unspent skill points of (Last created unit): Subtract 1 points
        Selection - Select (Last created unit) for (Owner of (Triggering unit))
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Item carried by (Triggering unit) in slot (Integer A)) is owned) Equal to True
                    Then - Actions
                        Hero - Drop the item from slot (Integer A) of (Triggering unit)
                        Hero - Give (Last dropped item) to (Last created unit)
                        Unit - Order (Last created unit) to move (Last dropped item) to inventory slot (Integer A)
                    Else - Actions
        For each (Integer A) from 1 to (Level of Attribute Bonus (Custom) for (Triggering unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Attribute Bonus (Custom)
        For each (Integer A) from 1 to (Level of Breath of Fire for (Triggering unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Tempest (Pandaren Brewmaster)
        For each (Integer A) from 1 to (Level of Drunken Haze for (Triggering unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Cyclone (Pandaren Brewmaster)
        For each (Integer A) from 1 to (Level of Drunken Brawler for (Triggering unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Gone with the Wind (Pandaren Brewmaster)
        Unit - Set life of (Last created unit) to (Life of (Triggering unit))
        Unit - Set mana of (Last created unit) to (Mana of (Triggering unit))
        Set Temp_Point = (Position of (Triggering unit))
        Unit - Remove (Triggering unit) from the game
        Unit - Move (Last created unit) instantly to Temp_Point
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Trigger - Turn off (This trigger)
        Wait 20.00 seconds
        Countdown Timer - Pause PandarenFuryTimer[(Player number of (Triggering player))]
        Countdown Timer - Hide PandarenFuryTimerWindow[(Player number of (Triggering player))]
        Countdown Timer - Destroy PandarenFuryTimerWindow[(Player number of (Triggering player))]
        Set Temp_Point = (Position of (Picked unit))
        Unit - Create 1 Pandaren Brewmaster for (Owner of (Picked unit)) at Temp_Point facing (Facing of (Picked unit)) degrees
        Set PandarenFuryUnit[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Hero - Set (Last created unit) experience to (Hero experience of (Picked unit)), Hide level-up graphics
        Selection - Select (Last created unit) for (Owner of (Picked unit))
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Item carried by (Picked unit) in slot (Integer A)) is owned) Equal to True
                    Then - Actions
                        Hero - Drop the item from slot (Integer A) of (Picked unit)
                        Hero - Give (Last dropped item) to (Last created unit)
                        Unit - Order (Last created unit) to move (Last dropped item) to inventory slot (Integer A)
                    Else - Actions
        For each (Integer A) from 1 to (Level of Attribute Bonus (Custom) for (Picked unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Attribute Bonus (Custom)
        For each (Integer A) from 1 to (Level of Tempest (Pandaren Brewmaster) for (Picked unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Breath of Fire
        For each (Integer A) from 1 to (Level of Cyclone (Pandaren Brewmaster) for (Picked unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Drunken Haze
        For each (Integer A) from 1 to (Level of Gone with the Wind (Pandaren Brewmaster) for (Picked unit)), do (Actions)
            Loop - Actions
                Hero - Learn skill for (Last created unit): Drunken Brawler
        Hero - Learn skill for (Last created unit): Pandaren Fury 
        Unit - Set life of (Last created unit) to (Life of (Picked unit))
        Unit - Set mana of (Last created unit) to (Mana of (Picked unit))
        Set Temp_Point = (Position of (Picked unit))
        Unit - Remove (Picked unit) from the game
        Unit - Move (Last created unit) instantly to Temp_Point
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Set Temp_Real = (Mana of (Last created unit))
        Unit - Set mana of (Last created unit) to 100.00%
        Trigger - Turn off (This trigger)
        Unit - Order (Last created unit) to Human Archmage - Summon Water Elemental
        Wait 1.00 seconds
        Unit - Set mana of PandarenFuryUnit[(Player number of (Triggering player))] to Temp_Real
        Wait 30.00 seconds
        Trigger - Turn on (This trigger)

The dummy-ability is based off Water Elemental, so that's why he's ordered to use that ability.
I know there is a minor MUI problem with the Temp_Real variable, I've noted that down alrdy.

Hope someone can help me out, or explain how "Trigger - Turn off/on" works.
Thanks in advance.

- Baltazhar
 

minikrampan

Ultra Cool Member
Reaction score
28
>Unit A uses ulti, and turns into Unit B.
>Turn off the trigger (to prevent further executions for now)
>Wait 20 seconds
>Unit B turns back into Unit A
>Unit A is ordered to use it's Ulti (to get the cooldown showing

this is a loop right here. Its starts with unit a uses ulti then after 20s this comes >Unit A is ordered to use it's Ulti (to get the cooldown showing
and when he use ulti this will come again >Unit A is ordered to use it's Ulti

Edit: hmm maybe i misunderstod, anyway when you turn of your trigger it will still do the remaining actions i believe put the action - skip remaining actions there.
 

Cokemonkey11

New Member
Reaction score
18
I believe when you turn off (this trigger), the remaining actions are skipped.

Your better off turning off the trigger emediatly after running a different trigger checking conditions. At the end of the other trigger's wait you can turn back on the trigger that ran it.

Hope that makes sense.
 

afisakov

You can change this now in User CP.
Reaction score
37
While I can't say for certain, I believe u would be better off if u cut the trigger in half at
Code:
Unit - Move (Last created unit) instantly to Temp_Point
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Trigger - Turn off (This trigger)

cut here!!!
        Wait 20.00 seconds
        Countdown Timer - Pause PandarenFuryTimer[(Player number of (Triggering player))]
        Countdown Timer - Hide PandarenFuryTimerWindow[(Player number of (Triggering player))]

delete the wait 20 second command and have the rest in a second trigger with
Code:
countdown timer expires- timer equal to PandarenFuryTimer[(Player number of (Triggering player))]
as its event
that way u don't have to worry about reactivating the ability doing anything to the first part since it is soundly turned off, then of course once the second one has run its course it can finish with the command
turn on (name of first trigger here)
While I cannot guarantee this will fix the problem it should not take that long to implement and it sure can't hurt.
 

Baltazhar

Active Member
Reaction score
55
Thanks for you answers.

I''ve have been testing a bit back and forth of how to stop the trigger from running the second time, but I'll try to divide it into two seperate triggers.
Unfortunately this has to wait till I'm coming home from work later tonight.

Rep for all of you for the help so far <3

- Baltazhar
 

cleeezzz

The Undead Ranger.
Reaction score
268
>>I believe when you turn off (this trigger), the remaining actions are skipped.

nope. you could add a "Skip remaining Actions"
 

Baltazhar

Active Member
Reaction score
55
Something good worth saying once, is worthy of a second mention :p

I didn't even consider the Skip Remaining Actions part. I was focused on that little comment there is on Trigger - Turn Off, something like "This will not stop the current execution of the trigger, but will prevent future ones."...
Which apparently doesn't work all that great.

Still at work btw, will give feedback once I have tested it at home :)
 

Baltazhar

Active Member
Reaction score
55
I tried a bunch of different things on how to disable the trigger so that it wouldn't get run unless I wanted it to. No matter what I tried, the damn trigger kept running, disabled or not.
Eventually it struck me, to make a Boolean, and put it in the Conditions. Can it run, True or False? - This way the trigger runs when it is meant to.

Thanks for replying on this topic, helped a lot.
Everyone have been awarded Reputation.

CASE IS SOLVED!
- Baltazhar
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top