HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leader Board Problem

12-22-2002, 09:05 PM#1
Guest
I am trying to create a leader board that counts up to 200 kills so that at 200 kills a plyer has access to a super weapon. I can create the leaderboard itself the problm is that it doesnot count the kills.

Setup Leaderboard:

Events:
Map Initialization

Conditions:
None

Actions:
For each (Integer A) from 1 to 200, do (Set Kills[(Integer A)]=(Intege A)

Wait 1.00 Seconds

LeaderBoard - Create a leaderboard for (All Players) titled Kills.

Set the Leaderboard=(Last created leaderboard)

LeaderBoard-Add Player 1 (Red) to (Last created leaderboard with label Player 1: and value Kills[1]

LeaderBoard-Add Player 2 (Blue) to (Last created leaderboard with label Player 2: and value Kills[1]

LeaderBoard-Add Player 3 (Teal) to (Last created leaderboard with label Player 3: and value Kills[1]

LeaderBoard-Add Player 4 (Puple) to (Last created leaderboard with label Player 4: and value Kills[1]

LeaderBoard-Add Player 5 (Yellow) to (Last created leaderboard with label Player 5: and value Kills[1]

LeaderBoard-Add Player 6 (Orange) to (Last created leaderboard with label Player 6: and value Kills[1]

LeaderBoard-Add Player 7 (Green) to (Last created leaderboard with label Player 7: and value Kills[1]

LeaderBoard-Add Player 8 (Pink) to (Last created leaderboard with label Player 8: and value Kills[1]

LeaderBoard-Add Player 9 (Gray) to (Last created leaderboard with label Player 9: and value Kills[1]

LeaderBoard-Add Player 10 (Light Blue) to (Last created leaderboard with label Player 10: and value Kills[1]

LeaderBoard-Add Player 11 (Dark Green) to (Last created leaderboard with label Player 11: and value Kills[1]

LeaderBoard-Add Player 12 (Brown) to (Last created leaderboard with label Player 12: and value Kills[1]

Trigger - Turn on Update Leaderboard <gen>

Update LeaderBoard:

Events:
Time-Every 20.00 seconds of game time

Conditions:
None

Actions:

Player Group - Pick every player in (All Players) and do (Leaderboard - Change the value for (picked Player) in TheLeaderBoard to kills [(Player number of (picked player))])

Leaderboard - Sort(Last created leaderboard) by Value in Descendng order

I have searched these orums already ad was able to make some fixesbut it still does not work, if ayone can help me it would b greatly appreciated.
12-22-2002, 09:34 PM#2
dataangel
Quote:
For each (Integer A) from 1 to 200, do (Set Kills[(Integer A)]=(Integer A)

There's your first problem. Look at what you're doing:

Set Kills[1] = 1
Set Kills[2] = 2
Set Kills[3] = 3
....
Set Kills[200] = 200

What exactly does that accomplish? Just delete that action.

Quote:
Player Group - Pick every player in (All Players) and do (Leaderboard - Change the value for (picked Player) in TheLeaderBoard to kills [(Player number of (picked player))])

That's all well and good, but you need to change the kills variable to actually be however many kills the player has somewhere. All you've done with this is tell it to display whatever number was put into it with that first for loop. WarCraft3 isn't psychic -- it can't tell the variable is meant to record kills just because that's its name. You need to setup a separate trigger in order to change the value of the kills variable:

Event
A unit owned by Player 1 dies (Make 1 event for each player)

Condition
Player comparison: Owner of (Dying unit) does not equal Owner of (Killing Unit)
(This is just to make it so killing your own guys doesn't count, don't put this condition in if you do want it to count)

Action
Set Kills[Player number of Owner of Killing Unit] = Kills[Player number of Owner of Killing Unit] + 1

That should work :D
12-23-2002, 10:00 AM#3
Guest
Thanks for your help but I still do have a problem, I can duplicate most of the tirgger you listed except for the +1 at the end of it, how can I get the +1?
12-23-2002, 10:22 AM#4
wei
Quote:
Originally posted by Ordin
Thanks for your help but I still do have a problem, I can duplicate most of the tirgger you listed except for the +1 at the end of it, how can I get the +1?

it's in the arithmetic function
12-23-2002, 10:27 AM#5
Guest
Thanks a lot now all I have to do is test it.:D
12-23-2002, 11:24 AM#6
Guest
The trigger stil does not workemote_confused
This is what I have right now:

Setup Leaderboard:

Events:
Map Initialization

Conditions:
None


Wait 1.00 Seconds

LeaderBoard - Create a leaderboard for (All Players) titled Kills.

Set the Leaderboard=(Last created leaderboard)

LeaderBoard-Add Player 1 (Red) to (Last created leaderboard with label Player 1: and value Kills[1]

LeaderBoard-Add Player 2 (Blue) to (Last created leaderboard with label Player 2: and value Kills[1]

LeaderBoard-Add Player 3 (Teal) to (Last created leaderboard with label Player 3: and value Kills[1]

LeaderBoard-Add Player 4 (Puple) to (Last created leaderboard with label Player 4: and value Kills[1]

LeaderBoard-Add Player 5 (Yellow) to (Last created leaderboard with label Player 5: and value Kills[1]

LeaderBoard-Add Player 6 (Orange) to (Last created leaderboard with label Player 6: and value Kills[1]

LeaderBoard-Add Player 7 (Green) to (Last created leaderboard with label Player 7: and value Kills[1]

LeaderBoard-Add Player 8 (Pink) to (Last created leaderboard with label Player 8: and value Kills[1]

LeaderBoard-Add Player 9 (Gray) to (Last created leaderboard with label Player 9: and value Kills[1]

LeaderBoard-Add Player 10 (Light Blue) to (Last created leaderboard with label Player 10: and value Kills[1]

LeaderBoard-Add Player 11 (Dark Green) to (Last created leaderboard with label Player 11: and value Kills[1]

LeaderBoard-Add Player 12 (Brown) to (Last created leaderboard with label Player 12: and value Kills[1]

Trigger - Turn on Update Leaderboard <gen>

Update LeaderBoard:

Events:
Time-Every 20.00 seconds of game time

Conditions:
None

Actions:

Leaderboard - Sort(Last created leaderboard) by Value in Descendng order

Trigger - Turn on Kills pdate <gen>

Kills Update:

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
Unit - A unit owned by Player 9 (Gray) Dies
Unit - A unit owned by Player 10 (Ligh Blue) Dies
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies

Conitions:

(Owner of (Trigering Unit)) Not equa to instegator

Action:

Wait 1.00 seconds

Set Kills [(Player Number of Instagator)] = Kills [(( Player Number of Instagator) + 1)]

Its probably a stupid mistake on my part but what is wrong?
12-23-2002, 07:47 PM#7
Guest
I changed the trigger to this:

Events:
Map Initialization

Conditions:
None

Actions:

Wait 1.00 seconds

LeaderBoard - Create a leaderboard for (All Players) titled Kills.

Wait 1.00 seconds

LeaderBoard-Add Player 1 (Red) to (Last created leaderboard with label Player 1: and value Kills[1]
LeaderBoard-Add Player 2 (Blue) to (Last created leaderboard with label Player 2: and value Kills[1]
LeaderBoard-Add Player 3 (Teal) to (Last created leaderboard with label Player 3: and value Kills[1]
LeaderBoard-Add Player 4 (Puple) to (Last created leaderboard with label Player 4: and value Kills[1]
LeaderBoard-Add Player 5 (Yellow) to (Last created leaderboard with label Player 5: and value Kills[1]
LeaderBoard-Add Player 6 (Orange) to (Last created leaderboard with label Player 6: and value Kills[1]
LeaderBoard-Add Player 7 (Green) to (Last created leaderboard with label Player 7: and value Kills[1]
LeaderBoard-Add Player 8 (Pink) to (Last created leaderboard with label Player 8: and value Kills[1]
LeaderBoard-Add Player 9 (Gray) to (Last created leaderboard with label Player 9: and value Kills[1]
LeaderBoard-Add Player 10 (Light Blue) to (Last created leaderboard with label Player 10: and value Kills[1]
LeaderBoard-Add Player 11 (Dark Green) to (Last created leaderboard with label Player 11: and value Kills[1]
LeaderBoard-Add Player 12 (Brown) to (Last created leaderboard with label Player 12: and value Kills[1]

Trigger - Run Kills Update<gen> (ignoring conditions)

Kills Update

Events:

Time - Elapsed game time is 5.00 seconds
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
Unit - A unit owned by Player 9 (Gray) Dies
Unit - A unit owned by Player 10 (Ligh Blue) Dies
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies

Conitions:

None

Action:

Wait 1.00 seconds

Set Kills [(Player Number of (Owner of (killing unit)))] = Kills [(( Player Number of (Owner of (killing unit)))] + 1)]

Wait 1.00 seconds

Leaderboard - Change the value for(Owner of (Killing Unit)) in (Last created Leaderboard) to Kills[(Player number of(Killing unit)))]

Wait 1.00 seconds

Leaderboard - Sort (Last created Leaderboard) by Player in Descending order

I combined the update with the trigger suggested by dataangel but the trigger still does not count kills for some reason emote_confused I changed the instagatar language as I thought that was the problem but it still does not work. Any help is greatly appreciated.
12-24-2002, 12:01 AM#8
wei
LeaderBoard-Add Player 12 (Brown) to (Last created leaderboard with label Player 12: and value Kills[1]

ok first of all you got it all wrong in the value
it should be for example
with label Player 12: and value Kills[12]
Player 11: and value Kills[11]
and so on and so on
12-24-2002, 09:48 AM#9
Guest
I changed it but the trigger still does not work, I cannot understand why it is not working as the trigger seems to be fine.
12-24-2002, 02:26 PM#10
wei
try removing the
Time - Elapsed game time is 5.00 seconds
from the event...

and perhaps you should add
unit owned by neutral hostile dies
to the event too
12-24-2002, 07:42 PM#11
Guest
I removed the 5 second timer awhile ago as I to felt it might be interfering but it had no effect. I will try add the neutral hostile trigger and see if that works.

Edit: It still does not work. Btw my kills variable is set as an Integer Array, it is meant to be that right? Just double checking 8)
12-25-2002, 01:02 AM#12
wei
Quote:
Originally posted by Ordin
Edit: It still does not work. Btw my kills variable is set as an Integer Array, it is meant to be that right? Just double checking 8)

it should be an integer array as you've created... so it is correct :)

mmmm so in which part is the trigger not working ?
does it show up correctly ?
or perhaps you mean that it doesn't count for the 200 kills ?

oh yah, as dataangel have suggested, please add
Condition
* Player comparison: Owner of (Dying unit) does not equal Owner of (Killing Unit)
* Player comparison: Owner of (Dying unit) is not an ally of Owner of (Killing Unit)

to the leaderboard update, otherwise some "nasty" players just keep killing neutral passive or allied units
12-25-2002, 07:43 AM#13
Guest
The leaderboard does show up when the game starts, the problem is that the Kills Update trigger does not work, I used to have that condition but I removed it awhile ago to see if that was affecting anything, I will of add it back if I can get this trigger to work.
12-26-2002, 03:30 AM#14
Phil_123
what you need is an example map..
12-26-2002, 10:59 AM#15
Guest
Thank you DigimonKiller I really appreciate it, I will redo the trigger and hopefully it will work:D