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

Require Help Creating a Certain Trigger

Status
Not open for further replies.
Level 8
Joined
May 31, 2009
Messages
101
Hi everyone, I'm looking to improve my exsisting map: "Village of the Dead", which can be found on the map section.

I've already made some dramatic changes, however I am having trouble with a certain trigger. Basically my map involves 8 villagers trying to escape from a load of zombies, and I am at a loss on how to create a trigger which defeats all of the players.

The defeat will occur when all of the villagers have died, I have been searching for a way to do this but I can't find it. It sounds relatively simple too, but I can't seem to get any of my ideas to work.

Can anybody suggest how to do this?
 
Level 8
Joined
May 31, 2009
Messages
101
Thanks, although could you refer me to a tutorial on creating a Unit Group? I've never used them before.

*Edit* I've managed to create the group and have got the unit to be removed from it when they die. However, I'm not sure on how to check if the group is empty or not.

Thanks again.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Here's the trigger:

  • Untitled Trigger 022
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Villager
    • Actions
      • Unit Group - Remove (Triggering unit) from group1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (group1 is empty) Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • Game - Defeat (Player((Integer A))) with the message: Defeat!
        • Else - Actions
The <unit group is empty> can be found under Boolean category.
 
Status
Not open for further replies.
Top