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

Status
Not open for further replies.
Level 3
Joined
Oct 9, 2016
Messages
42
Hey guys,i have made a map that players fight zombies,the problem is when the players dies the zombies will keep spawning and lags the whole so i decide to make a trigger that remove the player's enemy after he is defeated,but it aint working,can someone show me how to make correct triggers?
 

Attachments

  • 无标题.png
    无标题.png
    20.5 KB · Views: 18
Level 39
Joined
Feb 27, 2007
Messages
5,019
There are probably some player-owned invisible dummy units somewhere on the map that's causing it to fail the "units owned by player X == 0" check. Does each player have a base/townhall/some main hero unit? If so, you could try checking if those specific units are all dead for each player instead of checking if all of his units are.

Generally speaking "it isn't working" is not helpful enough to diagnose a problem. Also you can copy triggers by right-click >> copy as text, then past here between [trigger][/trigger] tags.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You should remove the condition and make it an if statement in the actions.
Pick all units owned by player red, teal and green and print their names.
(Do not only print their names, but something like: Unit: "" in that case, you will also be able to spot units without a name.)

Also remember that dead units are also in these groups, so it also counts the dead units.
And as a unit owned by those players has just died, I assume he is still in those groups.
 
Level 3
Joined
Oct 9, 2016
Messages
42
Thank you guy i manage to get work,here is the trigger i used,altho i really i can hope lost all units as their lost conditions but this will work just fine

  • Events
    • Unit - A unit owned by Player 4 (Purple) Dies
    • Unit - A unit owned by Player 2 (Blue) Dies
    • Unit - A unit owned by Player 8 (Pink) Dies
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Main Hall Level 1 0015 <gen> is dead) Equal to True) and (((Main Hall Level 1 0022 <gen> is dead) Equal to True) and ((Main Hall Level 1 0028 <gen> is dead) Equal to True))
      • Then - Actions
        • Game - Display to (All players) the text: Team Blue has Fallen
        • Wait 10.00 seconds
        • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Actions)
          • Loop - Actions
            • Unit - Remove (Picked unit) from the game
      • Else - Actions
 
Status
Not open for further replies.
Top