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

Victory by destroying all buildings

Status
Not open for further replies.
Level 3
Joined
Oct 9, 2010
Messages
37
How can I do it so that I win when I destroy all of the enemy player's buildings without using the melee trigger? I checked the second WoL mission, because I know that's such a mission, but I drowned in my own confusion of the triggers.

There is a "check if a player's buildings are destroyed" trigger, where there's a condition that says:

(Number of Living units in (Any units in Anywhere owned by player PLAYER_01_USER matching Required: Prevent Defeat, with at most Any Amount)) == 0

I understand that trigger... almost. How does the editor know "Prevent Defeat" is buildings? Or to ask differently, can someone explain all this to me? I'm sure it's very simple, but I'm getting confused.
 
Level 11
Joined
Aug 1, 2009
Messages
963
There's actually a flag in the data editor for units that is called "Prevent Defeat".

Blizzard generally uses this so that buildings will prevent you from losing as long as you have them.

However, the reason for using this and not a simple "is building" check is because some things that are technically buildings, such as creep tumors, do not prevent you from losing (ie, if you have 1 creep tumor you lose, but 1 pylon you don't.)
 
Level 3
Joined
Oct 9, 2010
Messages
37
So if I copy that trigger and apply it to the enemy, I will win when I destroy all his buildings?

Alternatively, if I wanted a unit or a creep tumor to be destroyed in order to win, I simply flag them as "prevent defeat"?
 
Status
Not open for further replies.
Top