• 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.

[Trigger] Unit removal for 1 single player.

Status
Not open for further replies.
Level 28
Joined
Sep 26, 2009
Messages
2,520
There's a Unit Group option for picking every unit only of a specific player. Use that option and remove picked units.

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units owned by Player 12 (Brown)) and do (Actions)
      • Loop - Actions
        • Unit - Remove (Picked unit) from the game
 
Level 12
Joined
Mar 30, 2013
Messages
664
Oh damn i wrote it wrong -.-
What i actualy ment: If it works to remove a unit that has been killed after like 5 seconds.
Tho i figured it out, with some tips from you it goe's like this:
  • Unit Remove
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Wait 5.00 seconds
      • Unit - Remove (Dying unit) from the game
 
Level 13
Joined
Jul 16, 2012
Messages
679
MUI will be work :)

EDIT

Like this

Triggers
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Y Equal to 0
        • Then - Actions
          • Trigger - Turn on Untitled Trigger 002 <gen>
        • Else - Actions
      • Set Y = (Y + 1)
      • Set Unit[Y] = (Triggering unit)
      • Set Duration[Y] = 5.00
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer X) from 1 to Y, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Duration[X] Less than or equal to 0.00
            • Then - Actions
              • Unit - Remove Unit[X] from the game
              • Set X = (X - 1)
              • Set Y = (Y - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Y Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set Duration[X] = (Duration[X] - 0.03)
Just check if its work or not :)
 
Status
Not open for further replies.
Top