Why wont this work? Victory/Defeat

Knatten

New Member
Reaction score
7
Ok, so i got this trigger for initializing.

Code:
Druid Spawn
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Quest - Display to (All players) the Simple Hint message: Welcome to |cff32cd...
        Set Team1 = (All allies of Player 1 (Red))
        Set Team2 = (All allies of Player 6 (Orange))
        Player Group - Pick every player in (All players) and do (Unit - Create 1 Druid for (Picked player) at ((Picked player) start location) facing Default building facing (270.0) degrees)
        Player Group - Pick every player in Team1 and do (Actions)
            Loop - Actions
                Set team1droods = (Number of units in (Units owned by (Picked player) of type Druid))
        Player Group - Pick every player in Team2 and do (Actions)
            Loop - Actions
                Set team2droods = (Number of units in (Units owned by (Picked player) of type Druid))

and then this

Code:
Defeat team1
    Events
        Time - Every 15.00 seconds of game time
    Conditions
        team1droods Equal to 0
    Actions
        Player Group - Pick every player in Team1 and do (Actions)
            Loop - Actions
                Game - Defeat (Picked player) with the message: Defeat!
                Quest - Display to (All players) the Quest Update message: Team 2 is Victoriou...

and this for team 2

Code:
Defeat team2
    Events
        Time - Every 15.00 seconds of game time
    Conditions
        team2droods Equal to 0
    Actions
        Player Group - Pick every player in Team2 and do (Actions)
            Loop - Actions
                Game - Defeat (Picked player) with the message: Defeat!
                Quest - Display to (All players) the Quest Update message: Team 1 is Victoriou...

why wont it work =(?

oh, forgot the death detect

Code:
Reveal
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
        ((Triggering unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) is an ally of Player 1 (Red)) Equal to True
            Then - Actions
                Set team1droods = -1
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) is an ally of Player 6 (Orange)) Equal to True
            Then - Actions
                Set team2droods = -1
            Else - Actions
        Set MyLocation = (Center of (Playable map area))
        Unit - Create 1 Spirit of Vengence for (Owner of (Triggering unit)) at MyLocation facing MyLocation
        Custom script: call RemoveLocation(udg_MyLocation)
        Wait 0.60 seconds
        Set MyLocation = (Position of (Last created unit))
        Camera - Pan camera for (Owner of (Triggering unit)) to MyLocation over 3.00 seconds
        Custom script: call RemoveLocation(udg_MyLocation)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Neutral Hostile
            Then - Actions
                Quest - Display to (All players) the Quest Update message: ((Name of (Triggering player)) + ((  + (Name of (Triggering unit))) + ( has been killed by  +  Forest Creatures.)))
            Else - Actions
                Quest - Display to (All players) the Quest Update message: ((Name of (Triggering player)) + ((  + (Name of (Triggering unit))) + ( Has been killed by  + (Name of (Owner of (Killing unit))))))
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well are you removing the dying druids from their respective groups? Else, the groups will never be empty.
 

Knatten

New Member
Reaction score
7
Y

You mean like this ?

Code:
Reveal
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
        ((Triggering unit) is A Hero) Equal to True
    Actions
        [B][U]Unit - Remove (Triggering unit) from the game[/U][/B]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) is an ally of Player 1 (Red)) Equal to True
            Then - Actions
                Set team1droods = -1
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering player) is an ally of Player 6 (Orange)) Equal to True
            Then - Actions
                Set team2droods = -1
            Else - Actions
        Set MyLocation = (Center of (Playable map area))
        Unit - Create 1 Spirit of Vengence for (Owner of (Triggering unit)) at MyLocation facing MyLocation
        Custom script: call RemoveLocation(udg_MyLocation)
        Wait 0.60 seconds
        Set MyLocation = (Position of (Last created unit))
        Camera - Pan camera for (Owner of (Triggering unit)) to MyLocation over 3.00 seconds
        Custom script: call RemoveLocation(udg_MyLocation)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Killing unit)) Equal to Neutral Hostile
            Then - Actions
                Quest - Display to (All players) the Quest Update message: ((Name of (Triggering player)) + ((  + (Name of (Triggering unit))) + ( has been killed by  +  Forest Creatures.)))
            Else - Actions
                Quest - Display to (All players) the Quest Update message: ((Name of (Triggering player)) + ((  + (Name of (Triggering unit))) + ( Has been killed by  + (Name of (Owner of (Killing unit))))))
 

Sim

Forum Administrator
Staff member
Reaction score
534
> ((Triggering player) is an ally of Player 1 (Red)) Equal to True

Which triggering player?

> Set team1droods = -1

I guess you mean (team1droods - 1)
 

Knatten

New Member
Reaction score
7
Hmm, that's weird. Theoreticly it should be 0. Any idea how to work around it then ?

Ooh yeah, im gonna try that, that should fix it =). Thanks for quick reply guys.

Uhm, how can i set team1droods - 1, cant find it =/.
 

Knatten

New Member
Reaction score
7
1 more thing. Will the Kill trigger remove 1 point from the team1droods?

Code:
Leaver
    Events
        Player - Player 1 (Red) leaves the game
        Player - Player 2 (Blue) leaves the game
        Player - Player 3 (Teal) leaves the game
        Player - Player 4 (Purple) leaves the game
        Player - Player 5 (Yellow) leaves the game
        Player - Player 6 (Orange) leaves the game
        Player - Player 7 (Green) leaves the game
        Player - Player 8 (Pink) leaves the game
        Player - Player 9 (Gray) leaves the game
        Player - Player 10 (Light Blue) leaves the game
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        Game - Display to (All players) the text: ((Name of (Triggering player)) +  Has left the game.)
 
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