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

Trigger Killing some special unit makes u win

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a new trigger, then add new event. Unit event -> specific unit event. Then choose the pre-placed unit. The owner of killing unit wins.

  • Untitled Trigger 007
    • Events
      • Unit - Some unit <gen> Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: The unit has died!
      • Wait 5.00 seconds
      • Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Squiggy, it is much better to keep count of how many units of a certain type are alive than do that. Groups are extreemly demanding to create all the time and are meant to be used eithor to find a group of units once (eg units in an area when a spell is used).

If you really must use a group, cache the group (keep it in a global) and run your test. That way it will still reference the same units but it will not rebuild it from scratch each time. Keeping count of unit number alive is still the more efficent way (in an integer, not using the crappy count units in group).
 
Status
Not open for further replies.
Top