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

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,240
  • 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