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

LeagueIcon Wins Losses % System on Leaderboard/Dialog

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
As far as I am aware, there is no prebuilt "multiboard" structure in SC2. Instead you need to emulate a multiboard using dialogs. Dialogs are a lot like real UI development so are more flexible and logical to use.

I currently do not have the time to make a demo, but I will tell you the basic principles needed.
1. Make a dialog, settings its position and size.
2. Add a grid of dialog items to the dialog. To do this perform a nested loop (1 loop for x, and an internal loop in that for y). It is a good idea to store them in an array.
3. Format the items appropatly. If you dumped them in an array this is easier as you can itterate through the appropiate elements.
4. Load the appropiate values for the dialog items Probably in resposne to some trigger.

Banks are prety implicit to use.
1. Load bank.
2. Load values from or save values to bank.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Ok what about the issues, any ideas or is it too much asking smth for once >_< I dont get much help on master about it as well, and this is smth that many can do..

Oh gawd.. started doing the triggers for all players and I can't save the map..

Script failed to compile: Code jump out of bounds (try reducing the size of very large functions or triggers) (See Trigger Editor for more details). I counted the whole script contains 62,000 characters, the limit is 100,000 or so, the While Loop is used instead of For Loop when applicable. (WORKING ON A WAY to shorten the lines..)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I counted the whole script contains 62,000 characters, the limit is 100,000 or so, the While Loop is used instead of For Loop when applicable. (WORKING ON A WAY to shorten the lines..)
Script size has no limit. It is the compiled bytecode heap which has a limit (I think it is 2 MB). If you have 2 MB of script as a single developer you have probably done something wrong.

Code jump out of bounds (try reducing the size of very large functions or triggers) (See Trigger Editor for more details).
My limited knowledge of assembly has taught me that to reduce instruction size they often use realitive jumping in flow control. The problem is that these relative jumps are only allocated a few bits so are for short distances only. In normal instruction sets they include a "long jump" which is a larger instruction capable of jumping great distances but the restrictive nature of Galaxy bytecode probably means they only have a short jump for flow control.

In short, you may have a conditional statement or repetitive statement that has too many instructions in it. The simple solution is to try and make cohesive functions for various procudures as function calls are long jumps and so you can reposition code away from inbetween flow control (allowing the localized jumping to be in range again). Ofcourse this comes at the performance penalty of a function call but this is negliable.

If you disable the trigger causing this and send me the map (with instructions as to what trigger is causing the problem) I will fix it. Currently I am only able to guess the cause of the error so it may or may not be the case as descried above.

We can then start finding a solution to your problems 1 at a time.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
I fixed the error which was caused by the too many actions in a trigger by: Where player wins and gets diff stats, his stats are set separately but for all players - under the same - one action. E.g player 4 wins, gets his stats, all other players are set with Pick Each Integer from 1 to 3 and another Pick Integer from 5 to 8 rather than pasting actions for every single player. I turned the Section of the Bank into Variable w Array and W/L/% change correctly for all players. Stats SOLVED for all players.

At the moment I want only for me the bank to load for Player 1, didn't make the open bank work for all players as I wont be using it atm.

What is Not solved is from the other 2 issues:
1) To show calculated the 2 digits after decimal as well (if possible)
2) why if Slots are Users in Test Map mode and not Computer, their names won't show on the leaderboard? You can see the latest update at the map uploaded up in my #1 Post.

GG chat msg activates it as there is no 'Number of units on the map; DONT get me number JUST for 1 player FFS' these count Number of Living from Unit(Picked unit) == 1 failed so hard started counting stats every time a unit died even if on the map > 1. This is a System so the event for the stats to update can be anything on a map.

I wanna see if these two above can be fixed and then I'd move to the promotion system where at certain Win count and %, some league dialogue for promotion pops up and that is where the League column will be also used - I need to make a dialogue to look like the BNET LEAGUE PROMOTION dialogue as close as it can look.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
1) To show calculated the 2 digits after decimal as well (if possible)
There are natives to convert a fixed into a formated string or text (with specified precision).
Code:
native string   FixedToString (fixed x, int precision);
native text     FixedToText (fixed x, int precision);
native text     FixedToTextAdvanced (fixed inNumber, int inStyle, bool inGroup, int inMinDigits, int inMaxDigits);

2) why if Slots are Users in Test Map mode and not Computer, their names won't show on the leaderboard? You can see the latest update at the map uploaded up in my #1 Post.
They appeared fine to me. A name displayed for every player in the test map given.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
^ No, they appear so because I set them back to Computers to test their names with stats. If you set any of them to users except Player 1, they wont show. Maybe it doesn't count the slots as being used/taken even if there are units on the map owned by the players?

And you mean my Win Loss Win% variables have to be Real instead of Integers and in the 'Any Precision' part of the trigger I have to add from these? For example if I add c_fixedPrecisionAny as a custom script instead of Any Precision, this is the same as Any Precision, what script for up to two digits after decimal?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
If you set any of them to users except Player 1, they wont show
So when people join your map and you test it their names do not show? User slots probably have no name unless there is a user in them.

And you mean my Win Loss Win% variables have to be Real instead of Integers and in the 'Any Precision' part of the trigger I have to add from these? For example if I add c_fixedPrecisionAny as a custom script instead of Any Precision, this is the same as Any Precision, what script for up to two digits after decimal?
If by "Real" you mean "fixed", then yes. You can then use any of the functions in GUI to convert it to a string/text with a finite precision or you could go the direct approach and call one of the functions I listed above with appropiate parameters.

The parameter "precision" should control to how many decimal places the string / text is generated.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
^ This map is just a system not a project/map for public and I will use this for one private map (for now) but as I said I will likely use it in the future for others that I want to be with stats and the banks is something to use like in every map. So I don't know what happens online if others enter.

By 'Real' I meant NOT INTEGER but REAL, Oh wow.. all I had to do is after changing the Variables to be Real variables not integer, instead of Any Precision choose '2' as value. Now since I combined Texts and it shows with 2 places from decimal + %, it is Warcraft III stats format. Updated the map. [SOLVED]

Will check the Player Names not showing as Users and if solve/not, will move on to the League Promotion Dialogue that can be like as if in Bnet.
 
Last edited:
Level 22
Joined
Feb 4, 2005
Messages
3,971
Yes I do all in GUI, SC2 triggers are advanced enough to not make you look bad using GUI. I hate JASS/Galaxy whatever scripts as texts. I got tired of this Player Name not appearing but when I did it with Leaderboard - Set (Last created leaderboard) item text at column 1 and row (Picked integer) to (Text(Player[(Picked integer)])) which is the String Variable I use for players as Bank Sections, it worked. Another text, not the actual Player Names but still refering to their names. [SOLVED]

Now the 2nd part of the system, what do you think will be the best way to make a pop-up window like the League Promotion message when you get promoted in ladder? I want to do the exact same thing as close as it can look, even the same bnet skin. A dialogue with bnet texture? I can then set it to appear for players and add the League Icon on the leaderboard at certain stats and % - this I can do myself. Just need the ideas for the Promotion window, how it should be set.

ss5b.jpg


- No division, instead of (1v1) (League) will be (Map Name) (League)
 
Last edited:
Status
Not open for further replies.
Top