Leaderboard

Classe

New Member
Reaction score
1
Classe, new thehelper / Leaderboard question


Hellu everyone!

This is Classe for the first time on thehelper.net........
I'm looking for help about Warcraft III World Editor and i think this is a great place to ask.

I hope to be coming with countless questions regarding triggers, variables, and other programming in general.

So c ya around.! :)




Question!:D

I also would like to ask a question about a leaderboard i'm trying to establish right now... it doesn't work at all :p
It's supposed to count kills. (i'm starting out easy)
But it doesn't count at all but i can see the leaderboard with my namn and a 0 value.

Trigger for setting up leaderboard

Leaderboard
Events
Time - Elapsed game time is 3.00 seconds
Conditions
Actions
Leaderboard - Create a leaderboard for (All players) titled Killzzz
Player Group - Pick every player in (All players) and do (If (((Picked player) controller) Equal to User) then do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0) else do (Do nothing))
Leaderboard - Show (Last created leaderboard)


Trigger for tallying

Kilzzz
Events
Unit - A unit Dies
Conditions
((Dying unit) belongs to an enemy of Player 1 (Red)) Equal to True
Actions
Set Killzzz[(Player number of (Owner of (Killing unit)))] = Killzzz[(Killzzz[(Player number of (Owner of (Killing unit)))] + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Killzzz[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order
 

Emu.Man00

New Member
Reaction score
41
In the second trigger, replace (last created leaderboard) with a variable.
The type is obviously leaderboard :p

In first trigger:
Code:
 Leaderboard- Create a leaderboard for (All players) titled Killz
[B]set yourLeaderboard = last created leaderboard[/B]
Player Group - Pick every player in (All players) and do (If (((Picked player) controller) Equal to User) then do (Leaderboard - Add (Picked player) to [B]yourLeaderboard[/B] with label (Name of (Picked player)) and value [U]Killz[(player number of (owner of (killing unit))][/U] else do (Do nothing))
Leaderboard - Show [B]yourLeaderboard[/B]

Bold is changed things.
Underlined is really really important. If it's value is 0 it will be 0 until you manually change it.
 

Classe

New Member
Reaction score
1
Wow....

I haven't tried yet but i fully trust your advice and i'm launching WE right now...

I just want to say omg that's a really creeping fast reply. Love the forum already. :thup:

Thanks! and hope to see you again:D
 

Classe

New Member
Reaction score
1
hM hM...

Nevermind my replys...

I solved the problem by analysing the triggers by eye.
The solutions that Emu.man00 suggested helped my leaderboard come out of the hangar and by solving a incorrect trigger i got it flying. Works great now.

I decided to put the complete triggers here on the forum so people can use it to make tons of more completly awesome maps that count the casualties of warcraft players inhuman onslaughts.

Trigger for making the leaderboard:

Leaderboard

Events

Time - Elapsed game time is 1.00 seconds

Conditions

Actions
Leaderboard - Create a leaderboard for (All players) titled Killzzz

Set killzleaderboard = (Last created leaderboard)

Player Group - Pick every player in (All players) and do (If (((Picked player) controller) Equal to User) then do (Leaderboard - Add (Picked player) to killzleaderboard with label (Name of (Picked player)) and value Killzzz[(Player number of (Owner of (Killing unit)))]) else do (Do nothing))

Leaderboard - Show (Last created leaderboard)

Trigger for tallying:

Kilzzz

Events

Unit - A unit Dies

Conditions

((Killing unit) belongs to an ally of Player 1 (Red)) Equal to True

Actions

Set Killzzz[(Player number of (Owner of (Killing unit)))] = (Killzzz[(Player number of (Owner of (Killing unit)))] + 1)

Leaderboard - Change the value for (Owner of (Killing unit)) in killzleaderboard to Killzzz[(Player number of (Owner of (Killing unit)))]

Leaderboard - Sort killzleaderboard by Value in Descending order



*Note, count kills from both enemy and friendlys
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Set Killzzz[(Player number of (Owner of (Killing unit)))] = Killzzz[(Killzzz[(Player number of (Owner of (Killing unit)))] + 1)]

Set Killzzz[(Player number of (Owner of (Killing unit)))] = (Killzzz[(Player number of (Owner of (Killing unit)))] + 1)
 

velnias

New Member
Reaction score
13
maybe change condition if ur enemy is player brown set

Code:
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
 

Classe

New Member
Reaction score
1
thank you

Thansk for all help guys. I got it working before i saw the last 2 post but i appreciate everything.
acehart posted what i had done wrong you can see i had made a double arithmetic....
and about the condition... it can be very much... the best should problably be something like:

Code:
((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
 
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