Leaderboard: Wont Add to Score

  • Thread starter Thread starter Arigatou
  • Start date Start date
A

Arigatou

Guest
Ok, I followed the leaderboard tutorial. (Just changed event from "allied unit of player 1" dying to "unit controlled by player 1, 2, 3, etc dying").

Now then, the leaderboard is created fine. However, the scores never increase.
I opened other maps like mine, and my score adding triggers appear the same.

How my map works is that you should gain 1 point by killing a unit controlled by another player. All players are allied, so that you must click to attack, like in snipers and paintball maps.

My Leaderboard Trigger:

Events: Game time = 5secs

Actions
Leaderboard - Create a leaderboard for (All players) titled PWNAGE
Custom script: set bj_wantDestroyGroup=true
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) controller) Equal to User
((Picked player) slot status) Equal to Is playing
Then - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
Else - Actions
Do nothing
Leaderboard - Show (Last created leaderboard)


And here is the trigger for adding score:

Events
Unit - A unit owned by Player 1 (Red) Dies
Unit - A unit owned by Player 2 (Blue) Dies
Unit - A unit owned by Player 3 (Teal) Dies
Unit - A unit owned by Player 4 (Purple) Dies
Unit - A unit owned by Player 5 (Yellow) Dies
Unit - A unit owned by Player 6 (Orange) Dies
Unit - A unit owned by Player 7 (Green) Dies
Unit - A unit owned by Player 8 (Pink) Dies
Actions
Set Pwnage[(Player number of (Owner of (Killing unit)))] = Pwnage[((Player number of (Owner of (Killing unit))) + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Pwnage[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order


ANY HELP APPRECIATED! My map is done once this damn thing works! Thanks SO MUCH!
 
here is mine compare tehm cause i had problems also but mine works now

Update Leaderboard
Events
Unit - A unit owned by Player 1 (Red) Dies
Unit - A unit owned by Player 2 (Blue) Dies
Unit - A unit owned by Player 3 (Teal) Dies
Unit - A unit owned by Player 4 (Purple) Dies
Unit - A unit owned by Player 5 (Yellow) Dies
Unit - A unit owned by Player 6 (Orange) Dies
Conditions
(Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
Actions
If ((Owner of (Killing unit)) Equal to Player 1 (Red)) then do (Set playerkills[(Player number of Player 1 (Red))] = (playerkills[(Player number of Player 1 (Red))] + 1)) else do (Do nothing)
If ((Owner of (Killing unit)) Equal to Player 2 (Blue)) then do (Set playerkills[(Player number of Player 2 (Blue))] = (playerkills[(Player number of Player 2 (Blue))] + 1)) else do (Do nothing)
If ((Owner of (Killing unit)) Equal to Player 3 (Teal)) then do (Set playerkills[(Player number of Player 3 (Teal))] = (playerkills[(Player number of Player 3 (Teal))] + 1)) else do (Do nothing)
If ((Owner of (Killing unit)) Equal to Player 4 (Purple)) then do (Set playerkills[(Player number of Player 4 (Purple))] = (playerkills[(Player number of Player 4 (Purple))] + 1)) else do (Do nothing)
If ((Owner of (Killing unit)) Equal to Player 5 (Yellow)) then do (Set playerkills[(Player number of Player 5 (Yellow))] = (playerkills[(Player number of Player 5 (Yellow))] + 1)) else do (Do nothing)
If ((Owner of (Killing unit)) Equal to Player 6 (Orange)) then do (Set playerkills[(Player number of Player 6 (Orange))] = (playerkills[(Player number of Player 6 (Orange))] + 1)) else do (Do nothing)
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to playerkills[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order

that should work for u and there is a preety obvius difference
 
Your problem is that you have:
Code:
 Set Pwnage[(Player number of (Owner of (Killing unit)))] = Pwnage[((Player number of (Owner of (Killing unit))) + 1)]
and not:
Code:
 Set Pwnage[(Player number of (Owner of (Killing unit)))] = Pwnage[((Player number of (Owner of (Killing unit))))] + 1

That should help, athough I canot help but commment that it would be alot more efficiant in JASS, as you could store "((Player number of (Owner of (Killing unit))))" into a local variable, and do a few other things to tidy things up.

PS: Put your code in [ CODE][/CODE ] tags.
 
guitarplay said:
here is mine compare tehm cause i had problems also but mine works now



that should work for u and there is a preety obvius difference


I put that in, and STILL the leaderboard will not update!
 
scratch what i said i duno
 
Arigatou said:
I put that in, and STILL the leaderboard will not update!
Listen to Korolen. Look at this:
Pwnage[((Player number of (Owner of (Killing unit))) + 1)]​
Let's say Player 3 killed a unit. Owner of Killing unit is Player 3. Player number of Player 3 is three. 3 + 1 is 4. So that comes out to:
Pwnage[4]​
Which is player four's kills. So it ends up:
Pwnage[3] = Pwnage[4]​
Instead of what you want:
Pwnage[3] = (Pwnage[3] + 1)​
See the difference?
 
i see what u mean but my leaderboard works perfectly fine and all??
mine should work for him, but for some reasons the ones is used before taht one had trouble even though they worked in the other maps
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Also, in the last template there was a seperation between sticky threads and regular threads in the forum
  • Ghan Ghan:
    Not sure. It's probably part of a cron job.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top