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

Remove everything of a color?

Status
Not open for further replies.
Level 5
Joined
Oct 11, 2009
Messages
125
I finished making this trigger and it removes all the units of the player if no one is in that slot. But there is a barracks of the players color controlled by Red that also has to be removed. (To avoid abuse of the game) Is there an easy way I can do this without making 50,000,000 triggers?

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set PlayersPlaying[1] = Player 3 (Teal)
      • Set PlayersPlaying[2] = Player 4 (Purple)
      • Set PlayersPlaying[3] = Player 5 (Yellow)
      • Set PlayersPlaying[4] = Player 6 (Orange)
      • Set PlayersPlaying[5] = Player 7 (Green)
      • Set PlayersPlaying[6] = Player 8 (Pink)
      • Set PlayersPlaying[7] = Player 9 (Gray)
      • Set PlayersPlaying[8] = Player 10 (Light Blue)
      • Set PlayersPlaying[9] = Player 11 (Dark Green)
      • Set PlayersPlaying[10] = Player 12 (Brown)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PlayersPlaying[(Integer A)] slot status) Equal to Is playing
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Game - Defeat PlayersPlaying[(Integer A)] with the message: Defeat!
 
Level 5
Joined
Oct 11, 2009
Messages
125
That wouldn't work because...lets say teal...is playing but purple is not. it would remove the barracks for teal and not purple!
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

I got something for you:


  • TestTrigger1241
    • Events
      • Time - Elapsed game time is 0.20 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching player) slot status) Equal to (==) Is unused)) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
      • Wait 0.20 seconds
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Barracks) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Player 1 (Red) and Change color
I understand that these barracks at already on the map. So just change the color of each barrack to a different player. Now if the player slot is empty the barrack of the player will be destroyed and after, all existing barracks change the owner to player 1 (red)

Edit: Problem would be if Player 1 slot is empty ...

Greetings
~The Bomb King > Dr. Boom
 
Level 11
Joined
Jan 25, 2009
Messages
572
As what i can see you have 2 computers or stand-off players that is like an bot. (red and blue). I suggest that you change the loop to "for each integer A from 3 to 10". That will jump over player 1 (red) and player 2 (blue). Try it.

I also suggest that you use the Player 11 and Player 12 as bots, changing every of their building colors to Red and Blue because then you will have the DotA effects as i see you want.
 
Or you can add two more conditions in the conditions you already have created:
  • (Player(IntegerA)) Not Equal to Player 1 (Red)
  • (Player(IntegerA)) Not Equal to Player 2 (Blue)
and you're done.

There is also the Player Color comparison, so you can make a simple color comparison:
  • (Color of (Player(IntegerA))) Equal to Red
I am not sure I understood what exactly you want them used for, so, pick your options.

Previous posts already gave you alternative solutions.
 
Status
Not open for further replies.
Top