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

[Solved] Picking units within picked units causing function issues

Status
Not open for further replies.
Level 4
Joined
Aug 17, 2008
Messages
81
Hey guys. Been a while, I'm a bit rusty and I'm trying to figure out how to make this work correctly.

This is a trigger that will spread the fire debuff to nearby units.
It then creates a dummy unit that I use as a tech tree requirement to use a skill as long as they are on fire.

The problem is that the dummy unit does not correctly get killed later, causing the tech tree to be permanently unlocked.

Asides from the obvious solution of just killing all the dummy units that the player in question controls instead of a singular unit, is there any way around this issue? I would like to avoid having these extra dummy units exist at all.

  • Fire Spread
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in On_Fire and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in (Units within 150.00 of (Position of (Picked unit))) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                      • ((Picked unit) is in On_Fire) Equal to False
                    • Then - Actions
                      • Unit - Create 1 Dummy Unit for Neutral Hostile at (Position of (Picked unit)) facing (Position of (Picked unit))
                      • Unit - Add Fire! 2 to (Last created unit)
                      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                      • Unit Group - Add (Picked unit) to On_Fire
                      • Unit - Create 1 to be on fire for (Owner of (Picked unit)) at (Center of to be on fire <gen>) facing Default building facing degrees
                      • Set Put_Out_Fire[(Player number of (Owner of (Last created unit)))] = (Last created unit)
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Unit Group - Remove (Picked unit) from On_Fire
 
Level 4
Joined
Aug 17, 2008
Messages
81
Use variable to store unit for all loops.

I'm not sure what you mean by that. Could you give me an example?

Oh, I'm an idiot.

I realized that the way I was testing it was the cause of the problem.
My map is based around having only 1 hero per player, but I was testing it with two heroes controlled by the same player for spreading the fire.

I tried the trigger now with two separate players and it actually works as intended.

Derp. Thanks for the help anyway!
 
Last edited by a moderator:
Status
Not open for further replies.
Top