• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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...
 
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
 
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.
Back
Top