• 🏆 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!

[Trigger] Switching between two leaderboards

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I am trying to switch between leaderboards in a map I'm working on. One leaderboard won't show up, so I made a test map and replicated the problem. It is here:

http://www.hiveworkshop.com/forums/pastebin_data/xudx82/_files/two leaderboards.w3x

It has only three triggers recreated here:

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.07 seconds
    • Conditions
    • Actions
      • Camera - Pan camera for Player 1 (Red) to (Position of Paladin 0000 <gen>) over 0.00 seconds
      • Leaderboard - Create a leaderboard for (All players) titled test1
      • Set l1 = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label p and value 1
      • Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label p and value 2
      • Leaderboard - Hide (Last created leaderboard)
      • Wait 0.10 game-time seconds
      • Leaderboard - Create a leaderboard for (All players) titled test2
      • Set l2 = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label p and value 1
      • Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label p and value 2
      • Leaderboard - Hide (Last created leaderboard)
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Leaderboard - Hide l1
      • Leaderboard - Show l2
  • Untitled Trigger 002 Copy
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
    • Actions
      • Leaderboard - Hide l2
      • Leaderboard - Show l1
The map creates two leaderboards (l1 and l2). When you press <-- it should hide l1 and show l2, and when you press --> it should hide l2 and show l1.

What actually happens is <-- works as intended, but --> never shows l1. It seems like l1 is overwritten or something.

Can anyone help me so that I can switch between two leaderboards?

The problem seems to be that l1 is destroyed at the creation of l2. For example, if I show l1 and then make l2 (and hide it), l1 disappears and cannot be shown.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
The problem is : You CANNOT show or CREATE two leaderboards at the same time. Instead, use Multi-boards, you can even control them better. Only One leaderboard can be shown at once, and also one leaderboard can be created at a time.

The fact is, when you create a second leaderboard, the first leaderboard will be overwritten as you said.

FACTS :

- You can display one leaderboard and X multiboards at the same time.
- You can display and control multiboards better than Multiboards.

Gud luck.
 
Status
Not open for further replies.
Top