HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leaderboard kills not updating...

10-29-2003, 04:05 AM#1
widdles
Trying to do a standard leaderboard that lists the players names, and has an updated kill count to the right of that. These are the triggers I'm using:

Create Board
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Leaderboard - Create a leaderboard for (All players) titled Hero Survival
For each (Integer A) from 1 to 8, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Leaderboard - Add (Player((Integer A))) to (Last created leaderboard) with label (Name of (Player((Integer A)))) and value 0) else do (Do nothing))


Set Kills
Events
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Conditions
Actions
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
Trigger - Run Update Kills <gen> (ignoring conditions)


Update Kills
Events
Conditions
Actions
For each (Integer A) from 1 to 8, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to kills[(Integer A)]) else do (Do nothing))


The "kills" is an integer variable with 8 slot array, starts at 0. "Player" is an integer variable with 8 slot array. Board stays at 0 for the entire game. Any ideas?
10-29-2003, 04:22 AM#2
dataangel
Don't use last created leaderboard. Create the leaderboard, set a leaderboard variable to last created leaderboard, then use the variable from then on instead.
10-29-2003, 04:36 AM#3
widdles
Ok made a variable named leaderbrd, set as a Leaderboard type variable, no array, none for initial value. Put a "Set leaderbrd = (Last created leaderboard)" right under the create leaderboard action. Then I replaced all of the "(Last created leaderboard)" to the leaderbrd variable.

Still doesnt work :( As in update the kills, everything still shows up (name of player and the initial 0 value of the kills variable) so using the variable for the board works, just not updating kills.
10-29-2003, 04:47 AM#4
AllPainful
Instead of:
Set Kills
Events
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Conditions
Actions
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
Trigger - Run Update Kills <gen> (ignoring conditions)


Update Kills
Events
Conditions
Actions
For each (Integer A) from 1 to 8, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to kills[(Integer A)]) else do (Do nothing))


Try:
Set Kills
Events
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Conditions
Actions
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
Leaderboard - Change the value for (Player((owner of (killing unit)))) in (Last created leaderboard) to kills[player (owner of (killing unit)])

It works great that way, its condensed into 1 trigger, that isn't trying to update 8 values because its only updating the 1, and you don't have to worry about the player your trying to update not being in the game, because if the player wasn't in the game, how could he kill something?
10-29-2003, 05:05 AM#5
Tiki
Here you go

http://www.wc3campaigns.com/sections...rticle&artid=5
10-29-2003, 05:40 AM#6
AllPainful
Tiki... You know whats funny about you pointing them to that tutorial?

Alot of people who follow that tutorial end up posting "I followed the tutorial! Why won't it update?" in the forums....
10-29-2003, 02:22 PM#7
widdles
Set Kills
Events
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Conditions
Actions
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in leaderbrd to kills[(Player number of (Owner of (Killing unit)))]


Does not work either...
10-29-2003, 02:27 PM#8
Vexorian
Use the event Generic Unit event, instead of player owned unit event
10-29-2003, 02:30 PM#9
widdles
Changing Events to...

Events
Unit - A unit Dies

And everything else same still doesn't update.
10-29-2003, 02:35 PM#10
Vexorian
Just a question:

Are you using some kind of Trigger enhanced spell to kill the units?
10-29-2003, 02:35 PM#11
widdles
Attatched the map here, might be easier for some people to figure it out if they have something they can try the changes out on. Triggers for the leaderboard are under the "Leaderboard" category.
10-29-2003, 02:36 PM#12
widdles
Havnt worked on spells yet this is just the hero using their normal attack to kill some dummy creeps I setup.
10-29-2003, 02:42 PM#13
Vexorian
This is really weird, your triggers seem good (just the ones you posted, didn't see the map), try adding:

Game - Text message for (all player) Unit - name of (triggering unit)
Game - Text message for (all player) Unit - name of (killing unit)

in before the other actions in the set kills trigger (Just to see if it is running)
10-29-2003, 02:49 PM#14
widdles
Set Kills
Events
Unit - A unit Dies
Conditions
Actions
Game - Display to (All players) for 5.00 seconds the text: (Name of (Triggering unit))
Game - Display to (All players) for 5.00 seconds the text: (Name of (Killing unit))
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in leaderbrd to kills[(Player number of (Owner of (Killing unit)))]


Shows the killer and the killed unit, still not updating kills though.
10-29-2003, 03:30 PM#15
IDISacredIDI
Well my idea would be to open up a Wintermaul map, it has a leader board that works, look at the triggers used their and im sure youll see where you might have gone wrong (i know this usually helps me if im stuck). If that doesnt help i cant do anything because i suck at using the WE.

IDISacredIDI:ggani: