• 🏆 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] Trigger leaks, need help

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
  • Crusaders Will Atk Event
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Crusaders Will (Critical Strike) for (Triggering unit)) Greater than or equal to 1
      • (Unit-type of (Triggering unit)) Equal to Crusader
    • Actions
      • Set CrusadersWill_Target = (Triggering unit)
      • Set CrusadersWill_MaxHP = ((Max life of CrusadersWill_Target) x 0.30)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Crusaders Will (Critical Strike) for CrusadersWill_Target) Equal to 1
          • (Percentage life of CrusadersWill_Target) Less than 30.00
        • Then - Actions
          • Set CrusadersWill_HP = (300.00 + CrusadersWill_MaxHP)
          • Unit - Set life of CrusadersWill_Target to ((Life of CrusadersWill_Target) + CrusadersWill_HP)
          • Floating Text - Create floating text that reads (String(CrusadersWill_HP)) above CrusadersWill_Target with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • 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 - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Wait 0.25 seconds
          • Set CrusadersWill_Target = No unit
          • Set CrusadersWill_HP = 0.00
          • Set CrusadersWill_MaxHP = 0.00
        • Else - Actions
After exactly 4 times this trigger procs the (triggering unit) dies. I assume its hp gets set 0.00 and cant figure out why. This trigger had the same issue without the 0.25 sec wait and variable preset 0.00 values.

EDIT: I have another attack event trigger with global variable overlapping, can I bypass this by adding local unit custom script? It doesnt seem to work.
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
Yes a single unit the idea is to heal unit when its health becomes less than 30% of its max hp.

The wait was added just to check whats wrong with it. If it for some reason would set the unit to: no unit preset value before getting the hp check.

Well anyways, it seems to run correctly now. If you have any ideas why it would leak please tell me :)
 
Status
Not open for further replies.
Top