Help: Trigger based on leader board and more

AEK

New Member
Reaction score
0
Ok i have a leaderboard that records player kills and i want a trigger to create a wisp every 25 kills at a certain loacation, but i cannot find a event or condition that will allow me to do an action every x leaderboard score.

Does anyone know which event/condition i should be using?

Thanks in advance for help, AEK
 

turok255

New Member
Reaction score
30
Use an if then els in your leader board kills trigger then use run trigger then use if (Your Variable) equal to X then do actions. I'll make it for you in a sec. Lemme open WE

Code:
Trigger1
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Kills = (Kills + 1)
        Trigger - Run Trigger2 <gen> (checking conditions)

Code:
Trigger2
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Kills Equal to 25 <----Integer Comparison Condition
            Then - Actions
                Unit - Create 1 Wisp for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
            Else - Actions

The first trigger is just an example
 

AEK

New Member
Reaction score
0
My Version of Trigger 1:
Code:
Tally Board Score
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Killing unit)) controller) Equal to ((Random player from (All allies of Player 1 (Red))) controller)
    Actions
        Set Player_Kills[(Player number of (Owner of (Killing unit)))] = (Player_Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (Player_Kills[(Player number of (Owner of (Killing unit)))] + 0)
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        Trigger - Turn on Hero Wisp Creation <gen>

My Version of Trigger 2:
Code:
Hero Wisp Creation
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Player_Kills[0] Equal to 25
            Then - Actions
                Set Wisp_tmp_point = (Center of Hero Wisp Spawn <gen>)
                Unit - Create 1 Base Wisp for Player 1 (Red) at Burrow_tmp_point facing Default building facing degrees
                Custom script:   call RemoveLocation (udg_Wisp_tmp_point)
            Else - Actions
                Do nothing

Is that what you mean?

Edit: In trigger 2 i have to make it work for all players, not just red, so do i have to use the (Owner of (Killing Unit) since there is no actual triggering unit, rather a killing unit?
 

turok255

New Member
Reaction score
30
Yes that should work.

EDIT: Change turn on trigger to Run Trigger Checking Conditions

Also Shouldn't this be + 1?
Code:
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (Player_Kills[(Player number of (Owner of (Killing unit)))] [B][U]+ 0[/U][/B])
 

AEK

New Member
Reaction score
0
Ok, thanks for your help i will test this and if it doesnt work as intended i shall be back :p

Edit: Nope it didnt create anything.

Edit 2: I'm not sure, will that effect the second trigger? becaue my leader board works fine its just the spawning.
 

AEK

New Member
Reaction score
0
I've changed the trigger again, but before i test it i want to see what you think, i'll make the changed bits bold and say why after the code

Trigger 1:
Code:
Tally Board Score
    Events
        Unit - A unit Dies
    Conditions
       [B] ((Owner of (Killing unit)) controller) Equal to ((Random player from (All players controlled by a User player)) controller)[/B]
    Actions
        Set Player_Kills[(Player number of (Owner of (Killing unit)))] = (Player_Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (Player_Kills[(Player number of (Owner of (Killing unit)))] + 0)
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        Trigger - Run Hero Wisp Creation <gen> (checking conditions)

I changed that so it affects all players since noone was allied to red (as it was set before to affect only allies)

Trigger 2:
Code:
Hero Wisp Creation
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Player_Kills[B][1][/B] Equal to 25
            Then - Actions
                Set Wisp_tmp_point = (Center of Hero Wisp Spawn <gen>)
                Unit - Create 1 Base Wisp for [B](Owner of (Killing unit))[/B] at Burrow_tmp_point facing Default building facing degrees
                Custom script:   call RemoveLocation (udg_Wisp_tmp_point)
            Else - Actions
                Do nothing

I'm not sure what the first bolded bit does but is it player number?
And the second bolded bit i changed to (Owner of (Killing Unit) so it affects all players, not just red?
 

turok255

New Member
Reaction score
30
Trigger 2:
Code:
Hero Wisp Creation
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Player_Kills[B][1][/B] Equal to 25
            Then - Actions
                Set [B][COLOR="Red"]Wisp_tmp_point [/COLOR][/B]= (Center of Hero Wisp Spawn <gen>)
                Unit - Create 1 Base Wisp for [B](Owner of (Killing unit))[/B] at [B][COLOR="red"]Burrow_tmp_point [/COLOR][/B]facing Default building facing degrees
                Custom script:   call RemoveLocation (udg_Wisp_tmp_point)
            Else - Actions
                Do nothing

Thats why, making it at wrong spot
 

AEK

New Member
Reaction score
0
Gah, i should probbly change that, what does the number after "Player_Kills" do, the number in the [#] do?

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Player_Kills[1] Equal to 25

Is it a player number or..?

Edit: It still did not spawn a wisp.
 

turok255

New Member
Reaction score
30
Thats an array.

Like you can do,

Set Integer Kills[1] = 0
Set integer Kills[2] = 5

Its a way to reuse variables without making new ones. Theres tutorials that better explain this.
 

AEK

New Member
Reaction score
0
Ok, i still cannot get this to work, does anyone else have any ideas on why this may not be working?
 

Sil3nt

SUP?
Reaction score
134
Code:
Tally Board Score
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Killing unit)) controller) Equal to (([b]Random player[/b] from (All players controlled by a User player)) controller)
    Actions
        Set Player_Kills[(Player number of (Owner of (Killing unit)))] = (Player_Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to (Player_Kills[(Player number of (Owner of (Killing unit)))] + 0)
        Leaderboard - Sort (Last created leaderboard) by Value in Descending order
        Trigger - Run Hero Wisp Creation <gen> (checking conditions)

I think you should create a player group and add in all players that are in the game to it. Then make the condition to check if the player is in that group.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
That "[1]" should be "[Player number of (Owner of (Killing unit))]".


There's also no reason to have that in a separate trigger, just add the actions to the end of the first one.


> ((Owner of (Killing unit)) controller) Equal to ((Random player from (All players controlled by a User player)) controller)

What is that supposed to test?
 

AEK

New Member
Reaction score
0
"What is that supposed to test?"

I dont even know anymore lol to be honest. But i actually think it can be removed since it will only record the kills of user players anyway, since they are the only ones doing the killing.

Edit: Ok, its semi-working now. It works for the player kills = 25, but it wnt do it EVERy 25 kills, 25,50,75,100,125 etc.
 

AEK

New Member
Reaction score
0
> If Modulo( PlayerKills[Player number of (Owner of (Killing unit))], 25) equal to 0 then ...

I cant see how i can do that, the closest thing i can get to that is:

(Player_Kills[(Player number of (Owner of (Killing unit)))] mod 25) Equal to 0
From Math Modulo
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top