• 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.

I have no choice but to ask..

Status
Not open for further replies.
Level 22
Joined
Feb 4, 2005
Messages
3,971
[SOLVED] Bank Loading Stats Properly

Again related to my WLR Ladder system which soon I will re-upload as entirely new system, close to the real Bnet Ladder system and Win points. Besides remaking the system I realized a major prob in that system I did last time.

The data from the Banks won't load properly if a player uses another slot next time. Because I made it silly to make 1 section for player 1, 2 for player 2.,. Which means if you got your stats in Section 1 and now you're Player 2 and it tells you to load Section 1 when I made Section 2 to load for Player 2, naturally it will load nothing (because your bank has section 1 not 2)..

So I decided to make a Section be 'Handle of Player' to be unique cause if the same section repeats for 2 casual players online, the stats on the Leaderboard will be a mixture of the two players having the same section...
 
Last edited:
Level 22
Joined
Feb 4, 2005
Messages
3,971
Yeah I didn't know what I wanted either. Because I can't test Handle of Player used as a Bank's Section name as it is bnet only I was looking for a way to test 'handle of player' value offline. Guest Account has an identifier and guess what - hitting Test Map in the editor when in Guest lobby is the way to 'browse' your map in Guest account, since you generally see only the downloaded maps in Guest Account when choosing what to play.

But the triggers didn't identify the 'handle of player 1', ..\Documents\StarCraft II\ has shortcuts to all your bnet accounts like Name.(identifier)@2 For Guest 3 it is: Guest 3.3@2 so 3 is the identifier as it is (dot three) but the trigger doesn't detect it.

So im trying to fix it so that when Player 1 saves his stats in a Section (his handle or since i cant use offline, I create a new bank e.g 123 and use 'Name of Bank' instead of 'Handle of player'), so when player 1 has his stats in section 123, next time - his stats to carry over even if he's player 6 or player 2 next time.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It returns a unique account identifier string for every BattleNet 2.0 account.

Here is an extract of mine X-S2-X-3XX21X
Where X are numbers removed to prevent people abusing my account in maps due to personality clahses.

Coincidently, when you save a bank it places it in a folder with the map publisher's account handle.

Example being NotD where the publisher is account 2-S2-1-1535419.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Yeah they told me at mapster too well the trigger explanation misled me and I thought Handle = bnet identifier, now I see it is this folder name with dashes. - Well when I ran test map while in Guest 3 with folder 2-S2-0-3 it didn't want toget the Handle although it recognized me as Guest by using that name for Player 1, so I couldnt test the Handle offline.

Ok im wondering in that case since I use a string variable for each of the players, should it be

  • Variable - Set Player[1] = (Handle of player 1)
  • Variable - Set Player[2] = (Handle of player 2)
  • Variable - Set Player[3] = (Handle of player 3)
Or should it be handle of player(triggering player) or even some other integer? I realized that the reason why the stats mess up on Local is the bank loads for all Computers since they use my bank and in bnet it would load properly other players' banks and that shit wouldn't happen in bnet.

So is this the integer I gotta use for Handle Of Player (handle of player 1 of player 2 for each variable)? To make sure no matter what slot, it will always load the correct stats of the player not someone else's and not save another section but always on the same handle section?
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
It's good.. only the data of you as a player is saved, I wanted to make sure it doesnt add extra section to your bank if it fails to save in the same section but Handle should do it since it remains no matter which player slot you are. Im testing it...
 
Last edited:
Level 22
Joined
Feb 4, 2005
Messages
3,971
How do I sort all players by if with Status: Playing, cause atm I get blank spaces for players not ingame/ Sort by column does nothing


I know, usually players occupy slots one after another but in cased they don't, it looks ugly. I use Player(Picked Integer) in row(Picked Integer) so whatever is the player, that row I set.. but it makes most sense to do it that way, idk way to order them.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You abstrac the rows from the player numbers using a mapping array. The mapping array maps a continious integer series (the rows) to a discontinious series (the players).

An example array for a full house with 4 players.
{1, 2, 3, 4}

An example array for the same settings but with player 3 missing.
{1, 2, 4}

In the first example index 2 had the value 3. In the second example index 2 has the value 4. These values refer to players while the incidies refer to rows.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You create an array so that it maps the row number (int) to a player slot (int). No rows must be mapped to players which are not active to achieve what you want.

A simple way would be to generate a player group for all players you want, then iterate through allocating it a mapping in the array. You then store the number of mappings made in the array so you can itterate through all mappings when updating the board.

Every time a player drops you can repeat this process to rebuild the mappings.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
And how exactly, I guess I should show my triggers for the leaderboard

  • Leaderboard - Create a leaderboard with 5 columns and 8 rows, with the name "Career Stats", and using (100%, 100%, 100%) color.
  • Leaderboard - Set (Last created leaderboard) item text at column 1 and row Header to "Player"
  • Leaderboard - Set (Last created leaderboard) item text at column 2 and row Header to "League"
  • Leaderboard - Set (Last created leaderboard) item text at column 3 and row Header to "Wins"
  • Leaderboard - Set (Last created leaderboard) item text at column 4 and row Header to "Losses"
  • Leaderboard - Set (Last created leaderboard) item text at column 5 and row Header to "Win %"
  • General - Pick each integer from 1 to 8, and do (Actions)
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Status of player (Picked integer)) == Playing
        • Then
          • Variable - Modify RowInt: + 1
          • Leaderboard - Set (Last created leaderboard) item text at column 1 and row RowInt to (Name of player (Picked integer))
          • Leaderboard - Set (Last created leaderboard) item text color at column 1 and row RowInt to (Color((Current player (Picked integer) color)))
          • Leaderboard - Set (Last created leaderboard) item text at column 3 and row RowInt to "0"
          • Leaderboard - Set (Last created leaderboard) item text at column 4 and row RowInt to "0"
          • Leaderboard - Set (Last created leaderboard) item text at column 5 and row RowInt to "0.00 %"
        • Else
 
Last edited:
Level 22
Joined
Feb 4, 2005
Messages
3,971
Like so? I added a Variable that becomes +1 for each integer, doing so for all. Thanks but seeing how in later stage when the Leaderboard updates with Wins and Losses, if a player leaves I reorder them wrong, the Leaderboard may update the Wins and Losses at the wrong Row, so this will become a mess. You helped but now I see how it makes a mess... too much to follow which row it goes, especially if someone leaves. Possibility of mistakes: big

It looks like I will leave it like that.. if someone wants to order for their maps, do it, I only dont get what the hell, this Leaderboard Sort by column is USELESS and does nothing.

Better be the case 'If someone leaves the game, his stats still displayed.. big deal... will just grey his color on the LBoard' And the case where you may be in different slot missing some slots to leave it like that can happen well.. like only in Single Player. The Game Lobby always makes you occupy the next available slot, so it shouldn't be happening to have empty slots in the middle.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Like so? I added a Variable that becomes +1 for each integer, doing so for all. Thanks but seeing how in later stage when the Leaderboard updates with Wins and Losses, if a player leaves I reorder them wrong, the Leaderboard may update the Wins and Losses at the wrong Row, so this will become a mess. You helped but now I see how it makes a mess... too much to follow which row it goes, especially if someone leaves. Possibility of mistakes: big
No... I said you use an array to map the iterated integer corosponding to a row to the player number. That way you can change what player each row corosponds to by changing the mappings in the array. The iterator obviously only itterates through the number of mappings that exist.

When a player leaves, you destroy the bottom row and then remove them from the mapping array. This is usually done by remaping the row the dropper was represented by with the mapping for the row which is getting removed (end row).

The idea is to decouple the relationship the player numbers have from the actual row numbers. Although you are generally after a 0..1:1 relationship of rows to players (with not all players having a row) the mapping mechanic I descriped is actually 0..*:1 meaning that each row must have mapto a player but each player can have 0 to any number of rows mapping to it.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
^ I see you mean this trigger: AI Advanced - Sets the state at index Index for player 0 to state State.

I can try that but right now I have this other and rather important problem to fix - would be nice if you can help with it - if you have tried my system, you know that when a player marine kills the others, he gets a win, all others get a loss.

Using the same triggers, I want to a apply for melee - a player wins, he gets a win in Lboard, others get defeated - they get a loss. For some strange reason whenever e.g I defeat other computers, I get a win, it is saved in my bank. All other computers (with my new triggers only the active players show) DO NOT get a loss in LBoard, in fact even I do not get a loss at all (neither in LB nor in bank) if I get defeated and other player wins - tested again with marines and unit killing - it all works - standard melee - no work -

is it because it has no time when displaying the Victory to give them a victory? And because when Victory you can press Continue and if you get Defeat - you quit the game, there is no time to set the loss?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
^ I see you mean this trigger: AI Advanced - Sets the state at index Index for player 0 to state State.
Sorry I have no idea what you are talking about here...

is it because it has no time when displaying the Victory to give them a victory? And because when Victory you can press Continue and if you get Defeat - you quit the game, there is no time to set the loss?
Quite probably this. Banks are not updated instantly.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
^ This has turned into the main issue that keeps me from already passing the quite updated and fixed with huge difference from the previous upload map. So do you have any insights on it?

Broken shitty events: I decided to start testing in bnet entirely. So Player Leaves with Victory is what I use to set Variable = Triggering Player, run my win/losses if Integer = Variable, win, else loss for all other players.

This works for Victory: Unlike Offline where the only way to get your win is to Resume Playing after Victory dialog, here in BNet you can quit immediately and you get your win in the Bank,. For Loss: Which only checks if the intger != Variable, then get loss +1 for picked integer.. no nothing.

So I tried using the Player Leaves with Defeat - it doesnt run the trigger, even: E: Any player selects Quit Button From Game Menu - won't work? o_O

I tried a simple test: Open Bank Save last cr8ed Bank. It doesnt want to even create a bank with a player uses Quit button for player (triggering player) - definitely not my loss conditions - as this issue is only for the End Game events, if it was with marine killing other marines, my wins and lsoses work just fine

Another proof of my Wins/Losses working and the problem not being in them:
Event: Action: Run Wins/Losses - if I use ANY DIALOG ITEM Of Game Menu - it will spam you with losses and it is saved in bank all works, but heheh naturally for QUIT Button it doesnt wanna work.....

Im ready to use Custom Script if it will give something to make it work but I've no idea of Galaxy so if you have a working code for it, im fine.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
If a player exits a game in progress it is natural that it will not save as the exit could have been caused by anything from returning to battlenet from the main menu to his PC losing power or BSoDing.

The best you can do is update the bank when you defeat a player or give victory to a player.

You must also remember that the player can roll back banks if he lost too much by restoring the bank file to a previous copy.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
I do use Player leaves with Victory - it gives the +1 win to the winning player but for some reason, the loss doesn't work for the rest. As I said it is not in my losses, it is the same reason why even a simple Open Bank Save Last Cr8ed bank actions wont work with Defeat event.. so Idk why it wont work.

I thought it is because the bank doesnt have time to save to players that leave with defeat but if that's the case, why Player selects Quit Item in Game Menu doesnt work? I mean even open bank save last cr8ed bank doesnt want to work, so for players that leave nothing works.

And basically Leave the game = defeat yet nothing saves for them, I specially made a Player Leaves with Defeat or Any event and it still doesnt save or create anything, only for Victory it works.. You can try and if you find a way that it works for losers. Then I can proceed

Simple test:
A player leaves with Victory
Action:
If Triggering Player != 2
Then
Open fdgkfg Bank
Save Last Cr8ed Bank.
Else:

Meaning if im player 1, im not the victor, it should create the Bank for me as not being player 2, it doesnt create anything.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
There is no way to bypass losses from quitting next to registering it as a loss when the game begins and remove the loss if a win occurs.

Ultimatly, losses will be ignored because the player can just back up banks after every session and then restore the bank if a session does not go as he pleased.

The problem with leaving the game is that the game has no opotunity to run any script. A player could leave the game via ALT+F4 and ending the process tree. A player could also leave the game due to an electrical failure (thus the computer shut down due to indufficient power and so terminated the session). A player may even leave due to a game or system crash.

In a team game, once a player leaves, you cannot retrospecivly award all team members a win even if the team they were on did end up winning.

Thus the best you can do is default every session as a loss for everyone and then only the people who remain to "win" will have that loss removed and a win awarded.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Ofc there is no way to detect every single type of loss but the normal Quit and ALt+F4 are enough for me as most players would do that. For cheating there are gazillion ways, that's what Bank protection is for. It is up to anyone to protect their maps and banks, my task is to simply offer a working system.

So far it works but I want to apply it to normal melee win. When you press Alt+F4 it asks if you want to quit: Yes and No, there is still this button. When you use the Quit button it is again an event. If it cant detect the loss when Defeated how come the Quit event doesn't work? Other items like Return To Game trigger it and it works like a charm but Quit never works..

The option you offer isn't the most adequate, even though you offer an alternative but the problem is: Even if you added a loss, removing it would meet the same problem with the event not working, so it doesnt matter what your actions are when the event doesnt make it.

So what are the Generic Button 1 2 9 etc that appear as Preset for this event with Game Menu? I could try some 'almost quit' to trigger it before he leaves but the most common done by players is regular quit and I dont get it how this doesnt want to work.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
The win works with Victory event, the loss doesn't work with Victory event. When I tried vs AI, I won for my Victory dialog event, I got my win in the Bank, somehow the PC got a loss in the leaderboard but ofc there is no bank for Computer player. When I lost from AI, I didnt get a loss - neither on leaderboard nor in the Bank, so the Victory event only works for the win, I have to make my own Defeat/Player Selects Menu Item Event to run the loss.

Heck, better even to set the integer in the Victory event and the whole run Wins/Losses to be done where the player loses. So any Dialog Items of Menu that can replace Player 'chooses quit button' - Ive no idea why this doesnt work it is supposedly before he quits, triggers should've run..
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Why not just default to a loss and only remove the loss and add a win if the player wins? Since the win event works you can remove the loss when the player wins and add a win. All other events become meaningless since the player already has been registered as a loss (which is what you are after).
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Blizzard really need to fix their darn triggers.. OK I realized I'm wasting my time with map specific triggers which do not change my system in any way, so I only add the map-specific separate triggers to the map.. Since my system works perfectly with wins and losses during the game, I do not need to spend so much time on fixing these specific map triggers.

So I did it like you said, and by releasing the system in a melee map, I give readily how to make it work with melee win/loss conditions, since it required these specific triggers - that without changing my system which was the very main idea of using that system as a ready one with only few things to need for integration to any map. And so until Blizzard patch their leaves with Defeat/selected Quit Menu events. Thanks for the assistance, I guess:

SOLVED
 
Status
Not open for further replies.
Top