Triggered Cold Attack sometimes bugs

Level 16
Joined
Jul 19, 2007
Messages
942
I have a triggered "Cold Attack" in my map because I want the cold attack to stack with other orb-effects. However, the slow-effect is sometimes not removed from enemies but it doesn't happening often but it is still annoying because they are getting perma-slowed. Is these triggers not good enough?
  • Frost Attack Mithril Axe
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageAttack Equal to True
      • (Level of Frost Attack (Mithril Axe) for DamageEventSource) Equal to 1
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is Mechanical) Equal to False
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
      • (DamageEventSource is A melee attacker) Equal to True
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • Set VariableSet CV = (Custom value of DamageEventTarget)
      • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AR_Counter[CV] Equal to 1
        • Then - Actions
          • Unit - Add Attack Speed Reduction (Mithril Axe Slow) to DamageEventTarget
          • -------- Here you will set speed reduction: --------
          • Unit - Set DamageEventTarget movement speed to ((Default movement speed of DamageEventTarget) x 0.50)
          • Animation - Change DamageEventTarget's vertex coloring to (50.00%, 75.00%, 75.00%) with 0.00% transparency
        • Else - Actions
      • -------- Here you will set duration of effect: --------
      • Wait 1.50 seconds
      • Custom script: set udg_AR_Unit = u
      • Set VariableSet CV = (Custom value of AR_Unit)
      • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AR_Counter[CV] Equal to 0
        • Then - Actions
          • Animation - Change AR_Unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Unit - Set AR_Unit movement speed to (Default movement speed of AR_Unit)
          • Unit - Remove Attack Speed Reduction (Mithril Axe Slow) from AR_Unit
          • Unit - Remove Slowed buff from AR_Unit
          • Set VariableSet AR_Counter[CV] = 0
        • Else - Actions
      • Custom script: set u = null
 
Using Waits when working with effects that can affect multiple units simultaneously during its duration is simply impossible. You need to split this effect into at least 2 triggers:
1. Trigger which applies the effect and sets up relevant info
2. Trigger with periodic event that processes each frost arrow's duration and removes it when it runs out

For more info refer to https://www.hiveworkshop.com/threads/visualize-dynamic-indexing.241896/

Edit: just now I saw you're using a local variable, gimme a moment

The only way I see this failing is if the unit indexer is doing something odd, like reassigning unit custom value, or assigning the same custom value to multiple units?
 
the waits is not good to use so insted make a dummy
you can do something like this
  • Frost Attack Mithril Axe
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageAttack Equal to True
      • (Level of Frost Attack (Mithril Axe) for DamageEventSource) Equal to 1
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is Mechanical) Equal to False
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource)) Equal to True
      • (DamageEventSource is A melee attacker) Equal to True
    • Actions
      • Unit - Create 1 DummyCaster for (Owner of DamageEventSource) at (Position of DamageEventTarget)
      • Unit - Add Slow (Dummy) to (Last created unit)
      • Unit - Set level of Slow (Dummy) for (Last created unit) to 1
      • Unit - Order (Last created unit) to Human Sorceress - Slow DamageEventTarget
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 
Back
Top