• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Leaderboard progress bar

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I've been trying for a while to get a working leaderboard progress bar, but for some reason nothing of that ever shows up. Here's what I got:

  • Melee Initialization
    • Events
      • Game - Map initialization
    • Local Variables
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard with 3 columns and 1 rows, with the name "Progress", and using (73%, 19%, 91%) color.
      • Variable - Set Leaderboard test = (Last created leaderboard)
      • Leaderboard - Add player 1 to Leaderboard test
      • Leaderboard - Enable Showing state for Leaderboard test for (All players)
      • Leaderboard - Set Leaderboard test item text at column 1 and row 1 to (Name of player 1)
      • Leaderboard - Set Leaderboard test item progress bar at column 2 and row 1 to range from 0.0 to 100.0
      • Leaderboard - Set Leaderboard test item progress bar color at column 2 and row 1 to (93%, 24%, 24%) for step 1
      • Leaderboard - Set Leaderboard test item progress bar color at column 2 and row 1 to (9%, 9%, 90%) for step 2
      • Leaderboard - Set width of 1 column in Leaderboard test to Automatic (% of the screen)
      • Leaderboard - Set width of 2 column in Leaderboard test to Automatic (% of the screen)
  • In-game
    • Events
      • Timer - Every 1.0 seconds of Real Time
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set Leadership progress bar[1] = (Leadership progress bar[1] + 1.0)
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Leadership progress bar[1] > 100.0
        • Then
          • Variable - Set Leadership progress bar[1] = 0.0
        • Else
      • Leaderboard - Set Leaderboard test item progress value at column 2 and row 1 to Leadership progress bar[1]
      • Leaderboard - Show progress bar for Leaderboard test item at column 2 and row 1
The leaderboard and player show (as Local Player), but the progress bar doesn't appear wherever I place the Show Progress Bar command.
 
Level 9
Joined
Sep 28, 2004
Messages
365
I think that is because you show the state of the leaderboard. Header takes off the 1st row of the leaderboard for any column. Try changing yours to row 2 it should work.

I am not sure which shows the header by default. I think it is Add Players that triggers the header or showing state. Can't confirm though. If you don't want the header try removing one of these and try.
 
Status
Not open for further replies.
Top