HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

leaderboard and timer help

07-22-2004, 02:30 PM#1
astronaut890
I need help making leaderboards and timers. I can't figure out how to make the leaderboards show player names and how to actually add to the player's score. I have a timer problem too. I have a revive timer that goes for 30 sec, but I cant make the window go away. If I say destroy "last created timer window" I'm afraid it will destroy someone elses revive window. And in the "create timer window" action it will not let me specify a timer window variable. HELP!
07-23-2004, 10:19 AM#2
Azhag
When you place a timer, it usually belongs with a variable as well, timer variable. So when you create the timer, add it to the variable that was made for that timer. Next do the trigger, "timer runs out" do destroy timer, and then specify the timer with the variable. Do one variable for each player and you have timers that won't destroy other timers. ^_^
07-23-2004, 02:40 PM#3
Rafael Br
For the leaderboard, make a variable representating the score of each Player(Make it an array),then do this trigger to set the leaderboard:
Events-Time elapsed in the game is 0.50 seconds
Actions-Leaderboard-create a leaderboard titled "Scoreboard"(or anithing you want)
Set ScoreBoard=Last Created Leaderboard
For each Integer A do 1 to (maximiun number of players) actions
Loop-Actions-If\Then\Else- If Player(Integer A) slot status equal to is playing,Then-add Player(Integer A) to ScoreBoard, with value ScoreVariable[Integer A]
Leaderboard-Show ScoreBoard.
To update the Leaderboard, make this trigger:
Event- a unit dies
Condition-Player- controller of owner of killing unit equal to user
Action-Set Variable ScoreVariable[Player Index of owner of killing unit] to ScoreVariable[Player Index of owner of killing unit] + 1
Leaderboard-Set value of owner of Killing unit on ScoreBoard to ScoreVariable[Player Index of owner of killing unit].
07-23-2004, 06:28 PM#4
Azhag
Thank you my thoughts exactly.
07-26-2004, 12:36 AM#5
astronaut890
thank you very much i know this will be helpful
A problem with the timer though:
When I create a timer window, there is no way to assign a variable to that window, it only lets me assign a timer.
07-26-2004, 02:15 AM#6
herpelocust
Quote:
Originally Posted by astronaut890
thank you very much i know this will be helpful
A problem with the timer though:
When I create a timer window, there is no way to assign a variable to that window, it only lets me assign a timer.


Start out by creating 2 variables:
a "timer" varaible called: time
a "timer window" called: wristwatch

Then build your trigger like so:
-------------------------------------------------------------------------------
Event: (If any)
Conditions: (If any)
Actions:
-Countdown Timer - Start "timer" as a One-shot timer that will expire in XX seconds
-Countdown Timer - Create timer window for "timer" with title (What you want to show on the game interface, i.e. "Next Round In:")
- Set variable "wristwatch" = last created timer window
- Countdown Timer - Show "wristwatch"
-------------------------------------------------------------------------------

You can then set up other triggers to run when the timer expires. (You don't actually have to have the timer show to make it work but it looks cool) ^_^
07-26-2004, 01:44 PM#7
astronaut890
Thanks alot, for some reason it never occured to me to set the variable with an action.... DUH! thank you
07-26-2004, 02:20 PM#8
astronaut890
Ok, another problem. The timer is for a reviving hero, and I am trying to make the timer get longer for each hero level. I tried setting a variable (blueherolevel) to the heros level when he died. But then when I was setting the time, i used arithmatic and it wouldnt let me select my variable, it said "no variables of this type defined" What type of variable do I need then? I thought a standard integer would have worked.
07-26-2004, 02:27 PM#9
Rafael Br
This happends because the time is a real variable, use conversion-convert integer to real, there your variable will show up.(the main difference betwen reals and integers is that reals can hold decimal values)
07-26-2004, 03:23 PM#10
astronaut890
Quote:
Originally Posted by Rafael Br
This happends because the time is a real variable, use conversion-convert integer to real, there your variable will show up.(the main difference betwen reals and integers is that reals can hold decimal values)

Thanks alot, but I can't find the conversion, where is it?
I know I have alot of questions im kind of new at mapmaking thanks for helping me out

EDIT: Nevermind, i found it