victory trigger for last unit alive

Cdo

New Member
Reaction score
5
Hi, i tried to make what should be a simple trigger but i can't get it working and i don't know why.
Basically every player has a unit (it's called tribute) and they all fight to death in a small areana, when there's only one left i want the owner of that unit to win, so this is what i came up with....
Trigger:
  • Victory
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in (Units in AREANA 1 <gen> matching ((Unit-type of (Matching unit)) Equal to Tribute))) Less than or equal to 1
    • Actions
      • Quest - Display to (All players) the Quest Update message: yay
      • Unit Group - Pick every unit in (Units in AREANA 1 <gen>) and do (Actions)
        • Loop - Actions
          • Quest - Display to (All players) the Quest Update message: yay
          • Game - Victory (Owner of (Picked unit)) (Show dialogs, Show scores)

i put the yay part in as a test when the trigger didn't work, at no point did it display the message so i'd assume there was a problem with the condition.
any help would be much appreciated :)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Better to use the event "A unit Dies", so it'll only fire when a unit dies, and then check if there is only 1 unit left in the region :D

Trigger:
  • Area Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set TempGroup = (Units in Region 1 <gen> matching ((Unit-type of (Matching unit)) Equal to Footman))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Less than or equal to 1
        • Then - Actions
          • -------- Do stuff here ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /> --------
        • 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