• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Multiple leaderboards: Is it possible?

Status
Not open for further replies.
Level 3
Joined
Jun 6, 2008
Messages
51
Hello,

I've been working on a greatly modified melee map. So far, I've been able to solve most problems with it myself by just lurking around the forums as an unregistered user and have been able to come up with some pretty neat triggers. The map is almost done except for the terraining, a check on the tooltips and quests for any spelling and grammar errors, and some cosmetic issues here and there.

One of the main objectives of the game is to make monsters drop "keys" which are really two digit codes that can be used to activate waygates and set that waygate's destination to a specific location, usually another waygate.

Since I didn't want to leave players who didn't write their codes down at a disadvantage, I wrote triggers that would display the key codes collected by the player and their allies. The result is quite inelegant
stargatehintsamplemessage.jpg

not to mention that display text message(auto-timed) didn't want to do newlines properly.

So I thought that leaderboards might make it look better. I was trying to come up with something that would let players switch between a leaderboard displaying scores and alliances, and one that displayed keys. However it seems that although I set the leader boards I create to variables as I create them, creating a new leaderboard inadvertently destroys the previous one. Here are the triggers I am using.
  • key board
    • Events
      • Time - Elapsed game time is 4.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for TeamHuman titled Keys
      • Set keys[1] = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Home and value (Integer(portalcode[1]))
      • Leaderboard - Create a leaderboard for TeamUndead titled Keys
      • Set keys[2] = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Home and value (Integer(portalcode[2]))
  • alliance board
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Alliances
      • Set AllianceBoard = (Last created leaderboard)
      • Leaderboard - Add Neutral Victim to AllianceBoard with label Team Human units and value 0
      • Leaderboard - Change the color of the label for Neutral Victim in AllianceBoard to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Leaderboard - Change the color of the value for Neutral Victim in (Last created leaderboard) to (100.00%, 80.00%, 20.00%) with 100.00% transparency
      • Player Group - Pick every player in TeamHuman and do (Leaderboard - Add (Picked player) to AllianceBoard with label (Name of (Picked player)) and value 0)
      • Leaderboard - Add Neutral Extra to AllianceBoard with label Team Undead units and value 0
      • Leaderboard - Change the color of the label for Neutral Extra in AllianceBoard to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Leaderboard - Change the color of the value for Neutral Extra in (Last created leaderboard) to (100.00%, 80.00%, 20.00%) with 100.00% transparency
      • Player Group - Pick every player in TeamUndead and do (Leaderboard - Add (Picked player) to AllianceBoard with label (Name of (Picked player)) and value 0)
      • Leaderboard - Add Neutral Passive to AllianceBoard with label unallied units and value 0
      • Leaderboard - Change the color of the label for Neutral Passive in AllianceBoard 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%, 80.00%, 20.00%) with 100.00% transparency
      • Player Group - Pick every player in unallied and do (Leaderboard - Add (Picked player) to AllianceBoard with label (Name of (Picked player)) and value 0)
      • Trigger - Run alliance update 2 <gen> (ignoring conditions)
  • board switch
    • Events
      • Player - Player 1 (Red) types a chat message containing key board as An exact match
    • Conditions
    • Actions
      • Leaderboard - Hide AllianceBoard
      • Leaderboard - Show keys[1]
  • board switch Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing alliance board as An exact match
    • Conditions
    • Actions
      • Leaderboard - Hide keys[1]
      • Leaderboard - Show AllianceBoard
In game, I can see that keys[1] gets created successfully followed by AllianceBoard, but when I try out the board switch triggers, keys[1] does not reappear. Allianceboard does come back, though.

So, are multiple leaderboards per player possible? I know the game can only display one leaderboard at a time, hence the board switcher.
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,608
Good question. I use leaderboards in my map the same way you do but I never tried to test the rest of them yet, only red's.
I'll test it and report back.
By the way. If you don't use multiboards then I think you should rather use multiboards. They are much nicer and you can do more stuff with them. There is a very nice tutorial from Inverted in the tutorials section on leaderboards.
 
Level 3
Joined
Jun 6, 2008
Messages
51
Well, since I'm trying to keep this map ROC accessible, multiboards are out of the question.

Besides, I am trying to keep the two player teams from discovering eachother's keys. A multiboard would display the keys for everyone to see

Hmmm... that gives me an idea...
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
I'm on it.
Actually no. You can make multiplayers be shown only for specific players with the GetLocalPlayer() function. The tutorial tells you about that too, if you are interested.
May I ask why do you want to stick to RoC? I don't mind, just asking, mainly since its editor is a real wimp.
 
Level 3
Joined
Jun 6, 2008
Messages
51
Darn, didn't work. Oh well, if multiple leaderboards per player isn't possible I can just leave out the Alliance board and just do the key boards. It would leave a nice spy vs. spy element in the game :thumbs_up:

still don't want to give up on it though *sits and waits*

I am making it ROC because (on the US West server at least) TFT users tend to play nothing but DOTA. The ROCers are more willing to take a chance on a new map and aren't quite so effected by DOTA madness :p
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
All tft triggers are accessable and works properly in roc.

You just need to know how to save it to w3m afterwards =)

Edit: One thing you could do, is to locate the script file. Its named war3map.j
Then remove all your triggers and all your variables, everything regarding the triggers, and import the war3map.j file into its path again, but via import manager.

But I suggest you backup the map before you do it, since, its easiest that way, saving it for roc-testing, but not for scripting further.

Edit2: Im not sure, but I think multiboards should be able to have multiply ones of. You see an extra multiboard if a player shares full unit control with you. So I suppose somehow it is possible.
 
Level 3
Joined
Jun 6, 2008
Messages
51
Aha... Ive seen some pretty neat ROC maps that possibly have TFT triggers in them, but they have all turned out to be protected. I haven't seen a ROC map with a multiboard yet.

I've also encountered some w3m's that I couldn't play with in ROC. Could have been newb maps, but they were protected as well so I couldn't tell if the triggers or the way the map was saved that was causing the problem.

Ack, besides, sticking to ROC triggers is good mental exercise :con::con:
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Hm... Hero Line Wars RoC is a map with multiboards. They have, as well lots of tft features.

Some roc maps that fails, are most likely a deletion of all files, and then imported manually.
Most likely the user who did it doesnt know that tft units, doodads, items, abilities etc, will not work unless you change, and import the .slk files which can be found if you look at the war3patch.mpq

I can give you an example if you want to use tft abilities, for instance. If you look at the piece of "AbilityData.slk" below you see that everything in the version column has been changed to the value 0. Normally all tft features has the value 1, but by changing these files, and import them to the same "path" in import manager, they all will work properly (except that icons (and some tooltips) will not be displayed properly since they dont exist in roc.

slknp4.jpg


mental exercise? I would say that if you use tft thingies, it will attract more people:p
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
I say TFT Jassing is an even better mental exercise.
But on the leaderboards.. No idea.. I only have the first created leaderboard stored in the leaderboard array. Odd, really odd. I see no reason for that in my code and I triple-checked everything.
My multiboard array works in a similiar way too. Damn these boards of doom :S
I'll let you guys figure this out since I won't be online for at least a day. Have fun with it :p
 
Level 3
Joined
Jun 6, 2008
Messages
51
But on the leaderboards.. No idea.. I only have the first created leaderboard stored in the leaderboard array. Odd, really odd. I see no reason for that in my code and I triple-checked everything.
My multiboard array works in a similiar way too. Damn these boards of doom :S

The first one you create? Hmmm... That gives me at least a little hope that this isn't impossible, since you got different results.

I'm going to try eccho's suggestion about hiding the board before creating a new one *crosses fingers*
 
Level 3
Joined
Jun 6, 2008
Messages
51
Nope, nothing.

Hmmm.. I wonder if those leader boards that go missing still exist. I suppose I could test it out...
  • board existance test
    • Events
      • Player - Player 1 (Red) types a chat message containing test key board as An exact match
    • Conditions
    • Actions
      • If ((keys[1] contains Player 1 (Red)) Equal to True) then do (Game - Display to (All players) the text: keys[1] exists appe...) else do (Game - Display to (All players) the text: keys[1] has been de...)
lol
 
Level 3
Joined
Jun 6, 2008
Messages
51
Okay, keys[1] exists somewhere, the game just refuses to show again it after showing the alliance board. Odd.

  • board existance test Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing test2 key board as An exact match
    • Conditions
    • Actions
      • Leaderboard - Add Neutral Victim to keys[1] with label new mummy and value 0
      • If ((keys[1] contains Neutral Victim) Equal to True) then do (Game - Display to (All players) the text: keys[1] exists appe...) else do (Game - Display to (All players) the text: keys[1] has been de...)
I can even add players to keys[1] apparently but it still won't show up.... hmmmmm
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Hm, at the moment I have no solution for your problem... I can look later though.

Please, do not Quadruple post. There is an Edit button in the right botton of your post for a reason.

Edit: What does this trigger do?
  • Trigger - Run alliance update 2 <gen> (ignoring conditions)
 
Level 3
Joined
Jun 6, 2008
Messages
51
it just updates the alliance board
  • alliance update 2
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in TeamHuman and do (Leaderboard - Change the value for (Picked player) in AllianceBoard to unitcounts[(Player number of (Picked player))])
      • Player Group - Pick every player in TeamUndead and do (Leaderboard - Change the value for (Picked player) in AllianceBoard to unitcounts[(Player number of (Picked player))])
sorry about the posting, didn't know yet what this forums stance on tl,dr: was so I used different posts instead of editing.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
But if its aready updating every 2 seconds of game... Why execute it manually?
(This is alittle offtopic but)

As for your problem... I still dont know why it doesnt work >.<
In your triggers, sometimes you write "Allianceboard", sometimes "last created leaderboad".
Why not stick to one of them? It could lead to confusion.

I dont think thats the reason though :s
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Are you sure..?

The "full shared unit control shows you a multiboard", and you can have that one in the same time that you have a custom multiboard

Though, 2 custom multiboards would work if you hide/show them periodically?
 
Level 3
Joined
Jun 6, 2008
Messages
51
Ah, thanks for spotting that Eccho

My current theory on this is that for any player, multiple leaderboards can be created for that player but only the most recently created leaderboard will ever be shown

Keys[1] was created for all players in TeamHuman. Afterwards, AllianceBoard was created for All Players. Since the the players in TeamHuman all are also in All Players, none of the players in TeamHuman will ever be able to see Keys[1] again because of the creation of AllianceBoard for All Players.

The explanation for what Eccho has seen with the multiple leader/multiboards on screen at the same time after full unit control is given to him is because since that other multiboard was created for the other player and not Eccho, the multiboards don't conflict. That they are both on screen at the same time sounds like a useful bug/feature I can exploit in a future map hopefully. :grin:

I've decided that the alliance board isn't as important as having the keycodes displayed on a leaderboard. I wish what I was trying to do wasn't impossible, but oh well. I have already used up all the player slots trying to get this to look nice, so I can't use Eccho's bug :cry: Still, this was an extremely interesting set of facts about leaderboards to find out. If these things can be confirmed by other people, could the leaderboard and multiboard tutorials be altered to mention this weird stuff?
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Hm... :_:

Beg my pardon, but I might be wrong about multiboard displaying at the same time. Actually it was a long time ago I saw it, if I saw it...

oh wait, I saw it in my map which Im working on. But though, it is a Multiboard + a leaderboard. So maybe that was just the thing:/
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
My current theory on this is that for any player, multiple leaderboards can be created for that player but only the most recently created leaderboard will ever be shown.
It's actually multiboards, and it has nothing to do with the most recently created one. It has to do with the last one you told to display.

I've decided that the alliance board isn't as important as having the keycodes displayed on a leaderboard. I wish what I was trying to do wasn't impossible, but oh well. I have already used up all the player slots trying to get this to look nice, so I can't use Eccho's bug Still, this was an extremely interesting set of facts about leaderboards to find out. If these things can be confirmed by other people, could the leaderboard and multiboard tutorials be altered to mention this weird stuff?
You could always just display all the info on one multiboard...

oh wait, I saw it in my map which Im working on. But though, it is a Multiboard + a leaderboard. So maybe that was just the thing:/
Aye, leaderboards are a completely different story.
 
Status
Not open for further replies.
Top