I want the game to see if a bank exists and if it does retrieve stats from it and if it doesn't store some starter stats. There seems to be a problem though because even if it does exist it doesn't run the proper actions. I can tell because i have text messages displayed if the trigger goes into the "then" actions or into the "else" actions
@first loop
You need to write out every preload because preload is no real action. Basically it's a fake thing to make an xml entry with the bank name and the player number.
Your code will load the bank for player 0 I think. To fix it, you need to copy the action for every player, remove the loop and write the player number as a value into the action.
@second loop
- remove preload
To be honest, I don't really know what "bank exists" does or under which circumstances it could be used because opening banks will create an empty bank file. :S
Maybe you can filter out new players with that. I'm doing that with saving at least 1 entry into a bank.
Ahli's Guide to excellent bank handling:
- You should enable the signature of the banks and check it:
- - Unsigned and empty banks belong to new players playing the first time.
- - Unsigned banks with at least 1 section entry are corrupted banks. Corruption is created by edited bank files (cheating attempt), corrupted bank files (saving during a crash, etc) and the multiplayer bank limitations/bugs (to big bank file size). Without the signature enabled, even the average battle.net user can cheat.
- Also, please be kind to your players and do not force a bank reset. Add a window in singleplayer that allows you to reset the bank, if it is corrupted (only broken/edited banks are unverified in singleplayer).
- Disable bank saving for players with a corrupted bank file (if they aren't new players, so they have a bank with at least one entry, force new players to save at least one entry like your personal bank version). Maybe disable the saving for all players, if they can depend on each other.
- If you add a version entry to your bank, you can migrate data like items with a map change to a new version or just completely reset the data, in case you make something like a season, etc.
Thanks for reading this and hopefully improving your bank handling to an excellent level.
You won't have people whining about lost bank files anymore. :)
I want the game to see if a bank exists and if it does retrieve stats from it and if it doesn't store some starter stats. There seems to be a problem though because even if it does exist it doesn't run the proper actions. I can tell because i have text messages displayed if the trigger goes into the "then" actions or into the "else" actions
@first loop
You need to write out every preload because preload is no real action. Basically it's a fake thing to make an xml entry with the bank name and the player number.
Your code will load the bank for player 0 I think. To fix it, you need to copy the action for every player, remove the loop and write the player number as a value into the action.
@second loop
- remove preload
To be honest, I don't really know what "bank exists" does or under which circumstances it could be used because opening banks will create an empty bank file. :S
Maybe you can filter out new players with that. I'm doing that with saving at least 1 entry into a bank.
Ahli's Guide to excellent bank handling:
- You should enable the signature of the banks and check it:
- - Unsigned and empty banks belong to new players playing the first time.
- - Unsigned banks with at least 1 section entry are corrupted banks. Corruption is created by edited bank files (cheating attempt), corrupted bank files (saving during a crash, etc) and the multiplayer bank limitations/bugs (to big bank file size). Without the signature enabled, even the average battle.net user can cheat.
- Also, please be kind to your players and do not force a bank reset. Add a window in singleplayer that allows you to reset the bank, if it is corrupted (only broken/edited banks are unverified in singleplayer).
- Disable bank saving for players with a corrupted bank file (if they aren't new players, so they have a bank with at least one entry, force new players to save at least one entry like your personal bank version). Maybe disable the saving for all players, if they can depend on each other.
- If you add a version entry to your bank, you can migrate data like items with a map change to a new version or just completely reset the data, in case you make something like a season, etc.
Thanks for reading this and hopefully improving your bank handling to an excellent level.
You won't have people whining about lost bank files anymore. :)
So I don't quite understand. How can i store bank values meant for new players without disrupting those of veterans?
@CHUNK008: Go uhm... different banks?
You open all banks and save them in an array with the player (or player - 1) as the key.