• 🏆 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] Another "Why isn't this working?" Thread

Status
Not open for further replies.
Level 8
Joined
Oct 25, 2018
Messages
68
Exactly what it is. Another one of those "Why is this not working?" moments which I can't figure out.

Effect is supposed to power up with every cast, and the buff power up works super fine, it even ends at 3 stacks which I've planned, but the dummies that are supposed to cast the mini storm bolts don't seem to want to cast it, and I can't figure out where I've fucked up. I'm not too worried about using this spell as fast as once per 12s, hence the Waits.

Also, one curious thing which happens, is that on the last charge, one dummy actually manages to cast a storm bolt. Only on that one charge, one activates out of three.

I've stared at my triggers with a frown for over a hot minute now, and I'm frustrated. Help.

  • Mega Shot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to GoND : Mega Shot
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Mega Shot 1) Equal to False
          • ((Triggering unit) has buff Mega Shot 2) Equal to False
          • ((Triggering unit) has buff Mega Shot 3) Equal to False
          • ((Triggering unit) has buff Mega Shot 4) Equal to False
          • ((Triggering unit) has buff Mega Shot 5) Equal to False
        • Then - Actions
          • Set tempPoint = (Position of (Triggering unit))
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
          • Unit - Add Mega Shot Buff to (Last created unit)
          • Unit - Set level of Mega Shot Buff for (Last created unit) to 1
          • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Mega Shot 1) Equal to True
            • Then - Actions
              • Unit - Remove Mega Shot 1 buff from (Triggering unit)
              • Set tempPoint = (Position of (Triggering unit))
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
              • Unit - Add Mega Shot Buff to (Last created unit)
              • Unit - Set level of Mega Shot Buff for (Last created unit) to 2
              • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Wait 0.30 seconds
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
              • Unit - Add Mega Shot Dummy to (Last created unit)
              • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
              • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation( udg_tempPoint )
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering unit) has buff Mega Shot 2) Equal to True
                • Then - Actions
                  • Unit - Remove Mega Shot 2 buff from (Triggering unit)
                  • Set tempPoint = (Position of (Triggering unit))
                  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                  • Unit - Add Mega Shot Buff to (Last created unit)
                  • Unit - Set level of Mega Shot Buff for (Last created unit) to 3
                  • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
                  • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                  • Wait 0.30 seconds
                  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                  • Unit - Add Mega Shot Dummy to (Last created unit)
                  • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Wait 0.30 seconds
                  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                  • Unit - Add Mega Shot Dummy to (Last created unit)
                  • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation( udg_tempPoint )
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Triggering unit) has buff Mega Shot 3) Equal to True
                    • Then - Actions
                      • Unit - Remove Mega Shot 3 buff from (Triggering unit)
                      • Set tempPoint = (Position of (Triggering unit))
                      • Wait 0.30 seconds
                      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                      • Unit - Add Mega Shot Dummy to (Last created unit)
                      • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                      • Wait 0.30 seconds
                      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                      • Unit - Add Mega Shot Dummy to (Last created unit)
                      • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                      • Wait 0.30 seconds
                      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                      • Unit - Add Mega Shot Dummy to (Last created unit)
                      • Unit - Set level of Mega Shot Dummy for (Last created unit) to (Level of GoND : Mega Shot for (Casting unit))
                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
                      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation( udg_tempPoint )
                    • Else - Actions
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
Event Response Myths - You need to change Casting to Triggering unit.
Declare Custom script: local location udg_tempPoint as the first line of the trigger and Custom script: set udg_tempPoint = null as the last line of the trigger, as per this tutorial: local udg_. That gets you a local location variable that won't be overridden during the waits (if you're using tempPoint in other triggers).
 
Status
Not open for further replies.
Top