I've made this here trigger, which should sync, load and then set apropriate variables.
There's a problem with the condition:
(Section "Player" exists in bank Banks[i]) == False
It always returns false, so it resets every key inside the bank. As an example, I've manually changed the bank file to load value "X", but it still sets it to "Local Player". How can I fix that? Or is there any error that I've missed?
This might be a wild shot but I had similar problems with banks and it seemed that you can't Preload and Synchronize a player variable, it needs to be a constant.
So you need to have a separate action for each bank synchronization.
Bank - Preload and synchronize bank "Stats" for player 1
Bank - Preload and synchronize bank "Stats" for player 2
Bank - Preload and synchronize bank "Stats" for player 3
...
As a side note, you might want to pick each player in the player group Active Players in case that for example Player 1 slot is not used (for example due to disconnect on map load) and will cause the last player to not get his bank loaded.
This is my guess:
It says "preload" which would means that the banks are send before the map actually start (as a lot of data is send around which can take time) and thus not on the moment you would expect. This means that Starcraft 2 needs to know which banks it needs to preload for who even before the triggers are run and this means that it won't bother to see which values the variables have and thus cause variables to fail.
It's looks logical when you say it so. But since some kind of script can run while sc2 finishes loading, they could implement such action, which alowed to Preload bank for players from x to y.
I'm glad that now I know about that minor thing which disturbed me for an hour :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've made this here trigger, which should sync, load and then set apropriate variables.
There's a problem with the condition:
(Section "Player" exists in bank Banks[i]) == False
It always returns false, so it resets every key inside the bank. As an example, I've manually changed the bank file to load value "X", but it still sets it to "Local Player". How can I fix that? Or is there any error that I've missed?
This might be a wild shot but I had similar problems with banks and it seemed that you can't Preload and Synchronize a player variable, it needs to be a constant.
So you need to have a separate action for each bank synchronization.
Bank - Preload and synchronize bank "Stats" for player 1
Bank - Preload and synchronize bank "Stats" for player 2
Bank - Preload and synchronize bank "Stats" for player 3
...
As a side note, you might want to pick each player in the player group Active Players in case that for example Player 1 slot is not used (for example due to disconnect on map load) and will cause the last player to not get his bank loaded.
I'll try your suggestion. As for the note, thanks, I forgot that that loop exists. Remaking it now :)
Edit: God damn it! You were right, it really does accept only constants, but why? :D oh well, thank you for the help!
This is my guess:
It says "preload" which would means that the banks are send before the map actually start (as a lot of data is send around which can take time) and thus not on the moment you would expect. This means that Starcraft 2 needs to know which banks it needs to preload for who even before the triggers are run and this means that it won't bother to see which values the variables have and thus cause variables to fail.
It's looks logical when you say it so. But since some kind of script can run while sc2 finishes loading, they could implement such action, which alowed to Preload bank for players from x to y. I'm glad that now I know about that minor thing which disturbed me for an hour :D