• 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 Help: All units of Player X in region are dead then spawn X units for Player Y

Status
Not open for further replies.
Level 9
Joined
Apr 14, 2020
Messages
63
I am having a hard time with the conditions of triggers and know this will come back to me at the end of completing my map by creating leaks.

Currently, I have a conquest trigger I am trying to write, where if Player X takes over Player Y's base by killing all 6 buildings in the region, then Player X gains the base with different building models.

I am having difficulty having the trigger only if all 6 buildings are killed, not just one of the specific units, and requiring it to be killed by player X.

Can anyone point me in the right direction on this? And perhaps, if they know a great resource for utilizing variables and conditions, that would be great to clean up my map as well.

Thanks
 
Level 30
Joined
Feb 18, 2014
Messages
3,623
Store those 6 buildings inside a unit group variable then periodically check when all those buildings are dead.
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Add Buildings to Unit Group --------
      • Unit Group - Add Farm 0000 <gen> to BuildingGroup
      • Unit Group - Add Farm 0001 <gen> to BuildingGroup
      • Unit Group - Add Farm 0002 <gen> to BuildingGroup
      • Unit Group - Add Farm 0003 <gen> to BuildingGroup
      • Unit Group - Add Farm 0004 <gen> to BuildingGroup
      • Unit Group - Add Farm 0005 <gen> to BuildingGroup
      • Trigger - Turn on All Buildings Dead <gen>
  • Building Killed By Player X
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in BuildingGroup) Equal to TRUE
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • Unit Group - Remove (Triggering unit) from BuildingGroup
  • All Buildings Dead
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (BuildingGroup is empty) Equal to TRUE
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: All buildings have been destroyed
 
Level 9
Joined
Apr 14, 2020
Messages
63
Store those 6 buildings inside a unit group variable then periodically check when all those buildings are dead.
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Add Buildings to Unit Group --------
      • Unit Group - Add Farm 0000 <gen> to BuildingGroup
      • Unit Group - Add Farm 0001 <gen> to BuildingGroup
      • Unit Group - Add Farm 0002 <gen> to BuildingGroup
      • Unit Group - Add Farm 0003 <gen> to BuildingGroup
      • Unit Group - Add Farm 0004 <gen> to BuildingGroup
      • Unit Group - Add Farm 0005 <gen> to BuildingGroup
      • Trigger - Turn on All Buildings Dead <gen>
  • Building Killed By Player X
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in BuildingGroup) Equal to TRUE
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • Unit Group - Remove (Triggering unit) from BuildingGroup
  • All Buildings Dead
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (BuildingGroup is empty) Equal to TRUE
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: All buildings have been destroyed


I never thought of that, great idea. Thank you.

Will this create leaks? Or does this minimize that?
 
Status
Not open for further replies.
Top