• 🏆 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!

Why is this trigger not working right?

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2009
Messages
54
So for a Boss unit in my map, spells are triggered based on when he attacks. When his HP falls below 35%, he attempts to use his Ultimate, a Starfall-type spell (the trick being that said spell has a requirement that the Sentry Ward be out first - because he's blind and has no line of sight otherwise).

However, for some reason, whenever his life falls below 35%, he instead "freezes" and becomes totally unresponsive and immobile, unless struck with a disabling effect like Cyclone - in which case he resumes like normal.

  • Althrics Spells
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Althric the Blind
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Run Turn on Althric Spells <gen> (ignoring conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AlthricCanCastMeteor Equal to True
        • Then - Actions
          • Unit - Order (Attacking unit) to Night Elf Priestess Of The Moon - Starfall
          • Unit - Add Spell Immunity (Neutral Hostile) to (Attacking unit)
          • Set AlthricCanCastMeteor = False
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of (Attacking unit)) Less than or equal to ((Max life of (Attacking unit)) x 0.35)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AlthricCanCastWave Equal to True
                • Then - Actions
                  • Set BossTempPoint = (Position of (Attacked unit))
                  • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm BossTempPoint
                  • Custom script: call RemoveLocation(udg_BossTempPoint)
                  • Set AlthricCanCastWave = False
                  • Wait 11.00 game-time seconds
                  • Set AlthricCanCastWave = True
                • Else - Actions
                  • Set BossTempPoint = (Position of (Attacking unit))
                  • Set BossTempPoint2 = (Random point in (Region centered at BossTempPoint with size (300.00, 300.00)))
                  • Unit - Order (Attacking unit) to Orc Witch Doctor - Sentry Ward BossTempPoint2
                  • Custom script: call RemoveLocation(udg_BossTempPoint)
                  • Custom script: call RemoveLocation(udg_BossTempPoint2)
                  • Set AlthricCanCastMeteorWard = False
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AlthricCanCastWave Equal to True
                • Then - Actions
                  • Set BossTempPoint = (Position of (Attacked unit))
                  • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm BossTempPoint
                  • Unit - Order (Attacking unit) to Attack-Move To BossTempPoint
                  • Custom script: call RemoveLocation(udg_BossTempPoint)
                  • Set AlthricCanCastWave = False
                  • Wait 11.00 game-time seconds
                  • Set AlthricCanCastWave = True
                • Else - Actions
And here's the trigger that it calls, just in case.
  • Turn on Althric Spells
    • Events
    • Conditions
    • Actions
      • Wait 0.50 game-time seconds
      • Trigger - Turn on Althrics Spells <gen>
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could try to debug it with something like this:

  • ISSUE ORDER
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Issued order))) above (Triggering unit) with Z offset 64.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.70 seconds
I think your trigger might go to a loop where the unit tries to cast the ward over and over again.

Are you actually using AlthricCanCastMeteorWard anywhere? Have you tried setting the wait in the other trigger from 0.5 to something like 5 seconds?
 
Level 3
Joined
Aug 4, 2009
Messages
54
Well, this is very strange. He attempts to cast Meteor Ward when below 35%, but the ward simply doesn't appear, despite setting his Cast Point to 0.00 to ensure no interruption.

After tinkering with the trigger and associated spells in more ways than I could care to count, I decided to scrap the whole thing in favor of a less conditionally-dependent one:

  • Althrics Spells
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Althric the Blind
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Run Turn on Althric Spells <gen> (ignoring conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AlthricCanCastMeteor Equal to True
        • Then - Actions
          • Set BossTempPoint = (Position of (Attacking unit))
          • Set BossTempPoint2 = (Random point in (Region centered at BossTempPoint with size (300.00, 300.00)))
          • Unit - Create 1 Meteor Ward for Player 12 (Brown) at BossTempPoint2 facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_BossTempPoint)
          • Custom script: call RemoveLocation(udg_BossTempPoint2)
          • Unit - Make (Attacking unit) Invulnerable
          • Unit - Order (Attacking unit) to Night Elf Priestess Of The Moon - Starfall
          • Set AlthricCanCastMeteor = False
          • Set AlthricHasCastMeteor = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • If (AlthricHasCastMeteor Equal to False) then do (Set AlthricCanCastMeteor = True) else do (Do nothing)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AlthricCanCastWave Equal to True
            • Then - Actions
              • Set AlthricCanCastWave = False
              • Set BossTempPoint = (Position of (Attacked unit))
              • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm BossTempPoint
              • Custom script: call RemoveLocation(udg_BossTempPoint)
              • Wait 11.00 game-time seconds
              • Set AlthricCanCastWave = True
            • Else - Actions
So, problem solved. But I owe you +Rep anyway for the debug trigger (once I 'spread it around' some). Very useful.
 
Level 4
Joined
Sep 27, 2009
Messages
119
If anything, I'd say your problem might be

  • Hai:
    • Events:
      • Unit - A unit is attacked
    • Conditions:
      • (Unit-tpye of (Attacking Unit)) Equal this hero guy
    • Actions:
      • Trigger - Turn off this trigger
First action appears to be to turn off then turn it back on, looping the turn off and on again. That is my guess from first glance.

Edit: Just saw Spo post the same exact thing before me, lol!
 
Last edited:
Level 11
Joined
Feb 14, 2009
Messages
884
Turn off runs after the trigger has finished running, so that's not the problem. But, after it's turned off, are you sure there's a way to turn it on again?
 
yes thats what i said the turn off trigger is the problem

looks like you hadn't used turn off trigger even once. its written there that it prevents future execution of the trigger but does not stop the current execution...... can't see a problem... though I cannot understand why you turn it off then turn it on again after .5 seconds.........
 
Level 3
Joined
Aug 4, 2009
Messages
54
though I cannot understand why you turn it off then turn it on again after .5 seconds.........
There's another trigger that randomly causes him to attack a random enemy in range whenever he attacks.. ("Where did you go? Over here...?"). Potential problems (Though there shouldn't be any here, there's always the possibility of something coming up in future updates) from that are pretty much the only reason it needed to be turned off at all.

Either way, the problem has been solved already.
 
Status
Not open for further replies.
Top