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

World Editor Triggering

Status
Not open for further replies.
Level 4
Joined
Mar 20, 2010
Messages
107
Hey, making my own map that I've been working for some weeks now, but ran into a problem.
What I need help with is a trigger for horde to win when all (13) Alliance buildings are destroyed. (Same for Alliance to win, with 5 horde buildings).

This is the trigger I've made so far when horde wins. I know what's the problem, just not how to fix it. The trigger is triggered when 1 of those 13 buildings get destroyed, not all of them.. Anyway, that's what i need help with :smile: How to fix it so it triggers when all buildings are destroyed?

  • Horde Wins
  • Events
  • Unit - Westbrook 0001 <gen> Dies
  • Unit - Dwarven Mine 0759 <gen> Dies
  • Unit - Mage Tower 0758 <gen> Dies
  • Unit - Human Barrack 0757 <gen> Dies
  • Unit - Elven Garden 0756 <gen> Dies
  • Unit - Human Barrack 0765 <gen> Dies
  • Unit - Dwarven Mine 0764 <gen> Dies
  • Unit - Mage Tower 0763 <gen> Dies
  • Unit - Elven Garden 0754 <gen> Dies
  • Unit - Elven Garden 0755 <gen> Dies
  • Unit - Human Barrack 0762 <gen> Dies
  • Unit - Dwarven Mine 0761 <gen> Dies
  • Unit - Mage Tower 0760 <gen> dies
  • Conditions
  • Actions
  • Game - Display to (All players for 5.00 seconds the text: The Horde has won.
  • Game - Display to (All players for 5.00 seconds the text: Thanks for playing.
  • Wait 7.00 game-time seconds
  • Game - Victory Player 1 (Red) (Show dialogs. Show scores)
  • Game - Victory Player 6 (Orange) (Show dialogs. Show scores)
  • Game - Victory Player 7 (Green) (Show dialogs. Show scores)
  • Game - Victory Player 8 (Pink) (Show dialogs. Show scores)
  • Game - Victory Player 9 (Gray) (Show dialogs. Show scores)
  • Game - Defeat Player 2 (Blue) with the message: The city is burning, etc. You've lost.
  • Game - Defeat Player 3 (Teal) with the message: The city is burning, etc. You've lost.
  • Game - Defeat Player 4 (Purple) with the message: The city is burning, etc. You've lost.
  • Game - Defeat Player 5 (Yellow) with the message: The city is burning, etc. You've lost.
Thanks for your time and help,
Goblin[ShoD], Chieftain of Clan ShoD
 
Last edited:
Level 12
Joined
Apr 15, 2008
Messages
1,063
Well in general triggers are triggered when any of the events appear. So what you need to do is add some counter, start with 13 and decrease whenever any of those buildings die. When it reaches 0, do the victory stuff
  • Horde Wins
    • Events
      • Unit - Westbrook 0001 <gen> Dies
      • Unit - Dwarven Mine 0759 <gen> Dies
      • Unit - Mage Tower 0758 <gen> Dies
      • Unit - Human Barrack 0757 <gen> Dies
      • Unit - Elven Garden 0756 <gen> Dies
      • Unit - Human Barrack 0765 <gen> Dies
      • Unit - Dwarven Mine 0764 <gen> Dies
      • Unit - Mage Tower 0763 <gen> Dies
      • Unit - Elven Garden 0754 <gen> Dies
      • Unit - Elven Garden 0755 <gen> Dies
      • Unit - Human Barrack 0762 <gen> Dies
      • Unit - Dwarven Mine 0761 <gen> Dies
      • Unit - Mage Tower 0760 <gen> dies
    • Conditions
    • Actions
      • Set Counter = ( Counter - 1 )
      • If - then - else (multiple)
        • If - Conditions
          • Counter equals to 0
        • Then
          • Game - Display to (All players for 5.00 seconds the text: The Horde has won.
          • Game - Display to (All players for 5.00 seconds the text: Thanks for playing.
          • Wait 7.00 game-time seconds
          • Game - Victory Player 1 (Red) (Show dialogs. Show scores)
          • ------ and so on....... ---------
(Set counter to 13 on map init)

Also, if these 13 buildings are the only buildings alliance has, you could replace the 13 events with smthing like "Player owned by (Player 4) dies" and test whether it is a structure. I am however not sure which of these solutions is faster.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Add the buildings to a group on initialization, then make an trigger that registers when a buildings dies, check if the building is in that group, if it is, remove it from the group. Then make an ITE (if/then/else) call and check if the group is empty, if its empty, then all buildings are destroyed, thus you can call the victory/defeat trigger(s).
 
Level 4
Joined
Mar 20, 2010
Messages
107
Yeah, all suggestions look good. I tried this trigger myself tho, and it seems to work perfectly. No idea if it might cause some problems in the future, but in that case I will have your suggestions to back it up! :D If you see something right away, feel free to point it out XD

  • Conditions
  • (Number of living Westbrook units owned by Player 2 (Blue)) Equal to 0
etc. Simple and so far working :gg:
 
Status
Not open for further replies.
Top