• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Removing units in order

Status
Not open for further replies.
Level 12
Joined
May 7, 2008
Messages
346
Title may be misleading, but I'm trying to achieve the following:

The map has around 8 heroes that are already preplaced in testmap enviroment.

I also assigned each Hero its own circle (Dummy Unit with Locust) that needs to be removed once the Hero is picked.

I know of a way to remove them with bunch of if / then / else statements, but nothing else comes to my mind in how to solve it.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Target unit of ability being cast)) Equal to Hero_Type[1]
    • Then - Actions
      • Unit - Remove Hero_Circle[1] from the game
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Hero_Type[2]
        • Then - Actions
          • Unit - Remove Hero_Circle[2] from the game
        • Else - Actions
          • etc...
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
You can use a loop for that kind of stuff I think
  • Actions
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Target unit of ability being cast)) Equal to Hero_Type[Integer A]
          • Then - Actions
            • Unit - Remove Hero_Circle[[Integer A] from the game
          • Else - Actions
 
Level 12
Joined
May 7, 2008
Messages
346
You can use a loop for that kind of stuff I think
  • Actions
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Target unit of ability being cast)) Equal to Hero_Type[Integer A]
          • Then - Actions
            • Unit - Remove Hero_Circle[[Integer A] from the game
          • Else - Actions

Yep that would do the trick, simple and easy!

Thanks.
 
Status
Not open for further replies.
Top