HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple Leaderboard and stats setup

01-20-2008, 07:46 AM#1
Kam
I'm having a bit of trouble setting it up. It works so far, except it counts kills by creeps as a kill for the opposite team and the revive timer doesn't work.

Leaderboard:
Trigger:
Set Up Leaderboard
Events
Conditions
Collapse Actions
For each (Integer A) from 1 to 12, do (Set Kills[(Integer A)] = 0)
Wait 1.00 seconds
Leaderboard - Create a leaderboard for (All players) titled Kills
Set TheLeaderBoard = (Last created leaderboard)
Leaderboard - Add Neutral Hostile to (Last created leaderboard) with label Team 1 Kills and value 0
Leaderboard - Change the color of the label for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Leaderboard - Change the color of the value for Neutral Hostile in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Player Group - Pick every player in Team1 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
Leaderboard - Add Neutral Passive to (Last created leaderboard) with label Team 2 Kills and value 0
Leaderboard - Change the color of the label for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Leaderboard - Change the color of the value for Neutral Passive in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Player Group - Pick every player in Team2 and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
Leaderboard - Add Neutral Victim to (Last created leaderboard) with label (Win = + ((String(MaxTeamKills)) + Team Kills)) and value 0
Leaderboard - Change the display style for Neutral Victim in (Last created leaderboard) to Show the label, Hide the value, and Hide the icon
Leaderboard - Change the color of the label for Neutral Victim in (Last created leaderboard) to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Trigger - Turn on Update Leaderboard <gen>

Update Leaderboard:
Trigger:
Update Leaderboard
Events
Conditions
Collapse 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 - Change the value for Neutral Hostile in TheLeaderBoard to Team1Kills
Leaderboard - Change the value for Neutral Passive in TheLeaderBoard to Team2Kills
Trigger - Run Team 1 Win Game <gen> (checking conditions)
Trigger - Run Team 2 Win Game <gen> (checking conditions)

Revive Hero:
Trigger:
Revive Hero
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Dying unit) is A Hero) Equal to True
Collapse Actions
Unit Group - Add (Dying unit) to RevivableHeroes
Set TempReal = (((Real((Hero level of (Dying unit)))) x Hero_Revive_Time_Factor) + 5.00)
If (UberMode_On Equal to True) then do (Set TempReal = (TempReal x 0.50)) else do (Do nothing)
Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in TempReal seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Multiboard_ShowDeaths Equal to False
Collapse Then - Actions
Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
Set RevivableTimersWindows[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
Else - Actions

Revive Hero Timer:
Trigger:
Revive Hero Timer
Collapse Events
Time - ReviveTimers[1] expires
Time - ReviveTimers[2] expires
Time - ReviveTimers[3] expires
Time - ReviveTimers[4] expires
Time - ReviveTimers[5] expires
Time - ReviveTimers[6] expires
Time - ReviveTimers[7] expires
Time - ReviveTimers[8] expires
Time - ReviveTimers[9] expires
Time - ReviveTimers[10] expires
Time - ReviveTimers[11] expires
Time - ReviveTimers[12] expires
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in RevivableHeroes and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Picked unit)) is in PlayersSentinel) Equal to True
Collapse Then - Actions
Hero - Instantly revive (Picked unit) at (Center of Team 1 Grave <gen>), Show revival graphics
Collapse Else - Actions
Hero - Instantly revive (Picked unit) at (Center of Team 2 Grave <gen>), Show revival graphics
Else - Actions
01-20-2008, 02:35 PM#2
Rechosen
Can you show us the triggers that update Team1Kills and Team2Kills? What exactly doesn't work about the Revival timers? Do the heroes revive? Does the timer window show? Is Multiboard_ShowDeaths equal to false? Why not put the fallen heroes into an array, too?
01-20-2008, 04:14 PM#3
Kam
The windows show up at the top that are supposed to have the timer in it, but they never start. Heroes never revive.

Team1 Death
Trigger:
Team1 Death
Collapse 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 (Light Blue) Dies
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Collapse Conditions
((Owner of (Triggering unit)) is in Team1) Equal to True
((Triggering unit) is A Hero) Equal to True
((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
Collapse Actions
Hero - Drop the item from slot (Random integer number between 1 and 6) of (Triggering unit)
Set Team2Kills = (Team2Kills + 1)
If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)) else do (Do nothing)
Trigger - Run Update Leaderboard <gen> (ignoring conditions)
If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Sound - Play GoodJob <gen>) else do (Sound - Play Warning <gen>)
If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( Defeats + (Name of (Owner of (Triggering unit)))))) else do (Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + Dies To Creeps))

Team2 Death

Trigger:
Team2 Death
Collapse 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 (Light Blue) Dies
Unit - A unit owned by Player 11 (Dark Green) Dies
Unit - A unit owned by Player 12 (Brown) Dies
Collapse Conditions
((Owner of (Triggering unit)) is in Team2) Equal to True
((Triggering unit) is A Hero) Equal to True
((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
Collapse Actions
Hero - Drop the item from slot (Random integer number between 1 and 6) of (Triggering unit)
Set Team1Kills = (Team1Kills + 1)
Trigger - Run Update Leaderboard <gen> (ignoring conditions)
If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Sound - Play GoodJob <gen>) else do (Sound - Play Warning <gen>)
If ((Owner of (Killing unit)) Not equal to Neutral Hostile) then do (Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)) else do (Do nothing)
01-21-2008, 06:46 AM#4
Kam
So I tried a few things but something is still throwing it off.