Changing the Victory-Trigger

Vertify

New Member
Reaction score
0
Made a map with no buildings. So when i start the game, it ends immediately ends as the Melee trigger is so. How do i go around changing the Victory to:
- No Buildings
- No Units left
Instead of just - No buildings (which is the normal victory)
 

Wratox1

Member
Reaction score
22
delete this from your melee trigger:
Trigger:
  • Melee Game - Enforce victory/defeat conditions (for all players)

then make a periodic trigger that looks something like this:
Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units owned by (Owner of (Picked unit)))) Equal to 0
                • Then - Actions
                  • Game - Defeat (Player((Integer A))) with the message: Defeat!
                • Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
No, as that leaks and is very inefficient, you should just use the event "A unit Dies", and check if Number of unit in (Units owned by (Owner of (Triggering unit))) Equal to 0, like this:
Trigger:
  • Win when No Units
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempGroup = (Units owned by (Owner of (Triggering unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
          • Set TempPGroup = (All enemies of (Owner of (Triggering unit)))
          • Player Group - Pick every player in TempPGroup and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Custom script: call DestroyForce(udg_TempPGroup)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
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