PDA

View Full Version : [Trigger] Multiple leaderboards: Is it possible?


nesatauri
06-06-2008, 11:06 PM
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
http://i216.photobucket.com/albums/cc49/nesatauri/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.

emperor_d3st
06-06-2008, 11:18 PM
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.

nesatauri
06-06-2008, 11:32 PM
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...

emperor_d3st
06-06-2008, 11:41 PM
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.

nesatauri
06-06-2008, 11:45 PM
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

Eccho
06-06-2008, 11:52 PM
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.

nesatauri
06-07-2008, 12:04 AM
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:

Eccho
06-07-2008, 12:16 AM
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.

http://img502.imageshack.us/img502/4993/slknp4.jpg

mental exercise? I would say that if you use tft thingies, it will attract more people:P

emperor_d3st
06-07-2008, 12:28 AM
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

Eccho
06-07-2008, 12:33 AM
Hm... It could be that the leaderboard interface is overwritten somehow if you dont "hide" both leaderboards upon the creation of them. Not sure at all though, but its possible

nesatauri
06-07-2008, 12:54 AM
I forgot about Hero Line Wars, thanks for the reminder. haha

nesatauri
06-07-2008, 01:03 AM
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*

nesatauri
06-07-2008, 01:15 AM
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

nesatauri
06-07-2008, 01:20 AM
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

Eccho
06-07-2008, 01:26 AM
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)

nesatauri
06-07-2008, 03:03 AM
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.

Eccho
06-07-2008, 11:42 AM
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

cHeRoL
06-07-2008, 12:06 PM
No,it's not possible to have more multiboards in 1 game.

Eccho
06-07-2008, 12:14 PM
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?

cHeRoL
06-07-2008, 01:15 PM
I don't think so...

PurplePoot
06-07-2008, 09:04 PM
No, the Allied Resources multiboard hides all other ones.

You are most likely confusing Leaderboards and Multiboards.

And yes, you can have an indefinite amount of multiboards (to my knowledge, there is no limit other than the handle count), but only one may be visible at once.

nesatauri
06-07-2008, 09:36 PM
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?

Eccho
06-07-2008, 10:04 PM
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:/

PurplePoot
06-07-2008, 11:50 PM
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.