Triggers not working, please look

NotTheHelper

Yeah, its under your bed.
Reaction score
23
Could someone check these triggers for me...they are malfunctioning.

First the timer for the crees waves is messed up...it makes like 5 copies of timer on top of screen

Code:
Creep Spawns
    Events
        Time - Elapsed game time is 10.00 seconds
        Player - Player 11 (Dark Green)'s Food used becomes Equal to 0.00
        Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    Conditions
    Actions
        Set CreepCount = (CreepCount + 1)
        Set Gold_income = (Gold_income + 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CreepCount Equal to 51
            Then - Actions
                Wait 2.00 seconds
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Game - Victory (Picked player) (Show dialogs, Show scores)
            Else - Actions
                Countdown Timer - Create a timer window for Timer_Variable with title Next Wave...
                Countdown Timer - Start Timer_Variable as a One-shot timer that will expire in 10.00 seconds
                Set Timer_Window = (Last created timer window)
                Countdown Timer - Show Timer_Window
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Player - Add Gold_income to (Picked player) Current gold

Timer expires
    Events
        Time - Timer_Variable expires
    Conditions
    Actions
        Countdown Timer - Destroy Timer_Window
        For each (Integer A) from 1 to 40, do (Actions)
            Loop - Actions
                Wait 1.00 seconds
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Unit - Create 1 Creep_Array[CreepCount] for Player 11 (Dark Green) at (Center of Start <gen>) facing Default building facing degrees
                        Unit - Create 1 Creep_Array[CreepCount] for Player 12 (Brown) at (Center of Start <gen>) facing Default building facing degrees

Next is my lives trigger
Code:
Lives
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for PlayerInGame titled Kill Count
        Player Group - Pick every player in PlayerInGame and do (Actions)
            Loop - Actions
                Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
        Leaderboard - Add Player 12 (Brown) to (Last created leaderboard) with label Lives Left   and value Lives
        Leaderboard - Show (Last created leaderboard)

Lives Lost
    Events
        Unit - A unit enters Finish <gen>
    Conditions
        (Owner of (Entering unit)) Equal to Player 11 (Dark Green)
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
        Unit - Kill (Entering unit)
        Set Lives = (Lives - 1)
        Leaderboard - Change the value for Player 12 (Brown) in (Last created leaderboard) to Lives
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lives Equal to 0
            Then - Actions
                Wait 2.00 seconds
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Game - Defeat (Picked player) with the message: Sucks for you.
            Else - Actions


and last is my kills in leaderboard



Code:
Counting Kills
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
        (Owner of (Dying unit)) Equal to Player 12 (Brown)
    Actions
        Set Kills_Count[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills_Count[(Player number of (Owner of (Killing unit)))]

Ty :)
 

ArmedCitizen

Kisses Cats
Reaction score
198
What's wrong with each one.

The first one is that those two players must have no food being used at the start so it is creating a timer for each of them (Must be 2 for each) before they actual do get some troops.
 

NotTheHelper

Yeah, its under your bed.
Reaction score
23
The lives one, well isnt working, when the creeps enter the end area they dont get killed and my lives on leaderboard dont go down...its weird.

and for the kills, well nothing happens. Stays at 0. wont go up even if i kill 30 units.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
I see what's wrong with the kills.

This is what you have:

Code:
Set Kills_Count[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)

This is what you should have:

Code:
Set Kills_Count[(Player number of (Owner of (Killing unit)))] = (Kills_Count[(Player number of (Owner of (Killing unit)))] + 1)
 
H

Hjalle

Guest
The right code for killing is this:
Code:
Counting Kills
    Events
        Unit - A unit Dies
    Conditions
       Or 
            (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
            (Owner of (Dying unit)) Equal to Player 12 (Brown)
    Actions
        Set Kills_Count[(Player number of (Owner of (Killing unit)))] = (Kills_Count[(Player number of (Owner of (Killing unit)))]+1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills_Count[(Player number of (Owner of (Killing unit)))]
The problem is that WE checks if the dying unit was owned by both player 11 and 12. This should fix this trigger.
 
M

Mythic Fr0st

Guest
First one
In creep spawns, if Player 11 Dark Green's food and browns become 0, thats not good, it'll
Code:
Creep Spawns
    Events
        Time - Elapsed game time is 10.00 seconds
        Player - Player 11 (Dark Green)'s Food used becomes Equal to 0.00
        Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    Conditions
    Actions
        Set CreepCount = (CreepCount + 1)
        Set Gold_income = (Gold_income + 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CreepCount Equal to 51
            Then - Actions
                Wait 2.00 seconds
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Game - Victory (Picked player) (Show dialogs, Show scores)
            Else - Actions
                Countdown Timer - Start Timer_Variable as a One-shot timer that will expire in 10.00 seconds
 Countdown Timer - Create a timer window for Timer_Variable with title Next Wave...
                Set Timer_Window = (Last created timer window)
                Countdown Timer - Show Timer_Window
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Player - Add Gold_income to (Picked player) Current gold

Timer expires
    Events
        Time - Timer_Variable expires
    Conditions
    Actions
        Countdown Timer - Destroy Timer_Window
        For each (Integer A) from 1 to 40, do (Actions)
            Loop - Actions
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Unit - Create 1 Creep_Array[CreepCount] for Player 11 (Dark Green) at (Center of Start <gen>) facing Default building facing degrees
                        Unit - Create 1 Creep_Array[CreepCount] for Player 12 (Brown) at (Center of Start <gen>) facing Default building facing degrees

that code should work, for your knowledge, do Not use the function Wait (Wait 1.00 seconds etc..) in any loops (Player, Integer A, Integer B, Unit Group loops etc...)


Code:
Lives
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        //You must set PlayerInGame before this runs, here, otherwise it will be empty, so do it here... or change it to Elapsed Game Time is 0.01 or 0.10 seconds
        Leaderboard - Create a leaderboard for PlayerInGame titled Kill Count
        Player Group - Pick every player in PlayerInGame and do (Actions)
            Loop - Actions
                Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
        Leaderboard - Add Player 12 (Brown) to (Last created leaderboard) with label Lives Left   and value Lives
        Leaderboard - Show (Last created leaderboard)

Lives Lost
    Events
        Unit - A unit enters Finish <gen>
    Conditions
        (Owner of (Entering unit)) Equal to Player 11 (Dark Green)
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
        Unit - Kill (Entering unit)
        Set Lives = (Lives - 1)
        Leaderboard - Change the value for Player 12 (Brown) in (Last created leaderboard) to Lives
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lives Equal to 0
            Then - Actions
                Wait 2.00 seconds
                Player Group - Pick every player in PlayerInGame and do (Actions)
                    Loop - Actions
                        Game - Defeat (Picked player) with the message: Sucks for you.
            Else - Actions

The rest of that code is fine


Code:
Counting Kills
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Dying unit)) Equal to Player 11 (Dark Green)
        (Owner of (Dying unit)) Equal to Player 12 (Brown)
    Actions
        Set Kills_Count[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills_Count[(Player number of (Owner of (Killing unit)))]

that's also fine, just the first one, and doing what I said for the second one
 
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