End this Game

bookyjoo

New Member
Reaction score
1
What I want the trigger to do is the end the game/show victory/defeat if all slayers are dead. The problem is in the second condition, but it looks like it should be correct. Help?

SlayerDeath
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Slayer
(Number of units in (Units of type Slayer)) Equal to 0
Actions
Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
Loop - Actions
Game - Victory (Picked player) (Show dialogs, Show scores)
Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
Loop - Actions
Game - Defeat (Picked player) with the message: Defeat!
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You must add a boolean condition too, since units tend to stay on the map when they're dead too. "(Number of units in (Units of type Slayer) matching (((Matching unit) is alive) equal to true) equal to 0))" ... Freehand but might work :S
 

BlackDeath09

New Member
Reaction score
9
because he said matching unit which is single which means when 1 dies the game ends, try making it plural or keep adding those conditions in separately for each possible slayer
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
use this

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Custom script:   set bj_wantDestroyGroup=true
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Slayer) and (((Matching unit) belongs to an ally of Player 12 (Brown)) Equal to True))) and do (Actions)
            Loop - Actions
                Unit Group - Add (Picked unit) to Unit_group_var

Code:
defeat victory
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Slayer
    Actions
        Unit Group - Remove (Triggering unit) from Unit_group_var
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit_group_var is empty) Equal to True
            Then - Actions
                Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Picked player) is an ally of Player 12 (Brown)) Equal to True
                            Then - Actions
                                Game - Defeat (Picked player) with the message: Defeat!
                            Else - Actions
                                Game - Victory (Picked player) (Show dialogs, Show scores)
            Else - Actions
 
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