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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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