HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with leaderboard

07-21-2002, 11:03 PM#1
Guest
Ok, I am trying to make a custom experience system using a leaderboard.

Here is what I did:

First Trigger:
Events-
Time- Elapsed game time is 2.00 game seconds

Actions-
Leaderboard - Create a leaderboard for (All players) titled <empty String> (Blank)
Leaderboard - Add player 1 to (Last Created Leaderboard) with label Experience: and value 0

Second Trigger:
Events-
Unit- A unit owned by player 3 Dies
Conditions-
(Unit Type of (Triggering Unit)) equal to Footman
(Owner of(Killing unit)) Equal to player 1
Actions-
Set VAriable-Set EXPFootman[(Player number of player 1)] = EXPFootman[(Player number of player 1)] +100

Leaderboard- Change the value for player 1 in (Last created leaderboard) to EXPFootman[(Player number of player 1)]

Third Trigger:
Events-
Unit- A unit owned by Neutral Hostile Dies
Conditions-
(Unit Type of (Triggering Unit)) equal to Bandit
(Owner of(Killing unit)) Equal to player 1
Actions-
Set VAriable-Set EXPBandit[(Player number of player 1)] = EXPBandit[(Player number of player 1)] +50

Leaderboard- Change the value for player 1 in (Last created leaderboard) to EXPBandit[(Player number of player 1)]

EXPFootman and EXPBandit are interger array variables, just in case you need to know.

Ok, using this system, it works perfectly fine if you kill only footmen, or only bandits. But say, when you kill 3 footman and have 300 Experience, then you kill a bandit, it sets it back to 0 then adds 50.

Any ideas?
07-22-2002, 12:20 PM#2
Khaoz
Instead of making a variable for each type of unit, do this:

A Unit owned by (player 3 (teal)) dies

Set playerexp[player number of owner of (killing unit)] to (playerexp[player number of owner of (killing unit)] + (point value of (triggering unit))

Set leaderboard value of (owner of killing unit) to (playerexp[player number of owner of (killing unit)])


basically something like that, where playerexp is an integer array and 1-12 will refer to any of the 12 players. Use this condition as well:

Player Comparision - (owner of (triggering unit)) NOT EQUAL to (player 3 (teal))

Duplicate the above condition for each player that you do NOT want to earn experience off of killing teal units.



Now that that is done, using the unit editor, scroll down and look for the "Point Value" box or something to do with "Points" (sorry im too lazy to turn on WE and check right now). Then set that to whatever you want the current unit to give for exp.