Trigger help!!!

Axtyler#1

New Member
Reaction score
1
ok so i want to make a trigger where if all units of player group 1 are dead then player group two gets the victory. Im pretty advanced with triggers but for some reason i cant figure it out and i feel the answer is simple. Any help and suggestions greatly welcomed:thup:
 

Goliath520

New Member
Reaction score
0
not entirely sure myself, that is one that has been bugging me. I think the condition you are looking for is under boolean, under unit group "unit group - units of unit group are dead"
 

jig7c

Stop reading me...-statement
Reaction score
123
Trigger:
  • trigger
    • events
      • every 1 second of game
    • conditions
    • actions
      • set group = units owned by player 1 matching...
      • set integer = number of units in group
        • if/then/else
          • if
            • integer is equal to 0
          • then
            • show defeat conditions for player 1
            • show victory conditions for player 2
        • else
      • custom script: call DestroyGroup (udg_group)
 

Axtyler#1

New Member
Reaction score
1
=)

Thank you :) but, what are the variables? is the group an array? and whats the matching condition? annnddd what if its a 5v5 scenario? would that trigger make it so that if all 5 players have no units left then it does the victory/defeat scenario
 

Carnerox

The one and only.
Reaction score
84
Ill make a better 1

Trigger:
  • Here
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set UnitGroupArray[1] = (Units owned by (Player((Integer A))))
          • Set UnitGroupArray[2] = (Units owned by (Player((Integer A))))
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in UnitGroupArray[1]) Less than or equal to (<=) 0
        • Then - Actions
          • Player Group - Pick every player in PlayerGroup[2] and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Player Group - Pick every player in PlayerGroup[1] and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in UnitGroupArray[2]) Less than or equal to (<=) 0
        • Then - Actions
          • Player Group - Pick every player in PlayerGroup[1] and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Player Group - Pick every player in PlayerGroup[2] and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions



Assuming you have already added players to Player groups.

If not add a trigger like.


Trigger:
  • Startup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerGroup[1] = (All allies of Player 1 (Red))
      • Set PlayerGroup[2] = (All allies of Player 6 (Orange))
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top