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

Victory message

Status
Not open for further replies.
Level 4
Joined
Apr 9, 2010
Messages
60
Well, I've got a map where you've got spawners (not of same type) which spawn monsters and such.
I wanted to make a trigger which will send a message about player's victory when only one (his) spawner is left, but now matter how hard I tried, I could not figure out how.

Is there any kind soul to help me?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 004
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set i1 = 0
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is alive) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Footman
                  • (Unit-type of (Picked unit)) Equal to Knight
                  • (Unit-type of (Picked unit)) Equal to Rifleman
            • Then - Actions
              • Set i1 = (i1 + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i1 Equal to 1
        • Then - Actions
          • PlayerGroup = Player group(Owner of (Triggering unit))
          • Game - Display to PlayerGroup the text: Only one unit left!
          • Custom script: call DestroyForce(udg_PlayerGroup)
        • Else - Actions
 
This is simpler;
  • Spawn
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- set a unit group variable, picking all those units matching your conditions --------
      • Set temp_group = (Units in (Playable map area) matching (((Triggering unit) is A structure) Equal to True))
      • -------- checks if that unit group only contains 1 unit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in temp_group) Equal to 1
        • Then - Actions
          • -------- Apply your actions here --------
        • Else - Actions
      • Custom script: call DestroyGroup(udg_temp_group)
 
Status
Not open for further replies.
Top