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

Set Wave HP with Trigger

Level 4
Joined
Dec 23, 2023
Messages
47
Hello I am currently at reworking my entire TD Map.
Currently, I am at setting the HP of each wave per trigger, so I can edit it later, without much work.

This is what I have:
Here I will manage the spawning of the waves, and setting the Variable I use for the HP of the Wave Units. (CurrentWaveHP)
  • WaveManager
    • Events
      • Player - Player 1 (Red) types a chat message containing Start as An exact match
    • Conditions
    • Actions
      • Set VariableSet CurrentWave = (CurrentWave + 1)
      • Trigger - Run Spawning <gen> (checking conditions)
      • Wait 2.00 seconds
      • Wait until ((All units of (Units owned by Player 12 (Brown).) are dead) Equal to Wahr), checking every 1.00 seconds
      • Set VariableSet CurrentWaveHP = (CurrentWaveHP x (11 / 10))
      • Wait 2.00 seconds
      • Trigger - Run (This trigger) (checking conditions)
I tried to get the math to increase the MaxHP by 10% ceach wave.

And there it changes the Spawned Units HP to the value of the Variable:
  • SetUnitHP
    • Events
      • Unit - A unit enters Spawn UL <gen>
      • Unit - A unit enters Spawn OL <gen>
      • Unit - A unit enters Spawn OR <gen>
      • Unit - A unit enters Spawn UR <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Unit - Set Max HP of (Triggering unit) to CurrentWaveHP
      • Unit - Set life of (Triggering unit) to 100.00%
I tried it now and while it sets the max HP to 200 like the original Value of the Variable, but the math seems not to work, and I don't get why. It always stays at 200.

EDIT: It seems like the SetUnitHP was the problem. After setting Triggering Unit to Entering Unit it worked.
 
Last edited:
Top