• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Victory Condition Help

Status
Not open for further replies.
Level 2
Joined
Feb 24, 2012
Messages
8
How do I create a trigger that checks every 1 second how many Heroes are in the Region, and if the number of heroes drops to 1, then gives the Victory.

Can someone please help me?
 
Level 40
Joined
Feb 27, 2007
Messages
5,097
In general the trigger editor does exactly what you want it to do with the words you used. Literally try doing the steps you just wrote in the above post.

  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Set TempGroup = (Units in YOUR REGION <gen> matching (((Matching unit) is a hero) equal to true))
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • (Number of units in TempGroup) less than or equal to 1
      • Then - Actions
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
            • Game - Victory (Owner of (Picked Unit))
      • Else - Actions
    • Custom script: call DestroyGroup(udg_TempGroup) //Change the name to match your group variable but keep the udg_ prefix. This line cleans a leak; see the thread I linked below for an explanation
Memory Leaks
Things That Leak
 
Level 8
Joined
May 21, 2019
Messages
435
How do I create a trigger that checks every 1 second how many Heroes are in the Region, and if the number of heroes drops to 1, then gives the Victory.

Can someone please help me?
What Pyrogasm wrote, but also, you may wanna give the players who die a defeat as well.
 
Status
Not open for further replies.
Top