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

Defeat condition -- if unit (created inside the map) dies...

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
Ofcourse, I'm going to bother people again with my silly questions :gg:

This time I managed to get myself into trouble with the Defeat conditions. I want the Defeat condition to be when a specific unit dies. Why is that a problem? Because the unit that may not die is a created unit (created by trigger). I've added it to a Unit Group, but I can't select that in the Event of the Defeat trigger.

I don't know if it matters, but the unit will be replaced during a cinematic and the new unit will be removed with a 'Unit - Remove' Action. This cinematic is the last thing in the map, so after that, you are victorious. I hope replacing the unit or removing the unit it is replaced with till not activate the Defeat trigger.

So can anyone help me with the Defeat condition?
 

x3m

x3m

Level 3
Joined
Apr 11, 2008
Messages
51
Just give unit a custom value. A unit dies. Unit has custom value x. Defeat.
 
Level 5
Joined
Aug 24, 2008
Messages
199
When you create a the unit or replace it you could set it to variable. You can use this variable Deafeat Conditions.

Just make a Variable set the type to unit and add this action directly below the part you created that unit.

  • Set variable (unitnameorwhatever) to (Last created unit)
Your defeat trigger should look like

  • Event
    • Unit - A unit dies
  • Condition
    • (Triggering unit) equal *unitnameorwhatever*
  • Action
    • Game - Deafeat
Dont forget to the set the variable new when you replace the unit.
 
Status
Not open for further replies.
Top