Im running into an annoying problem where my bank is completely empty every time I restart my map. To clarify the issue, I can confirm that I am saving the bank, and later within the map I am checking if those values that I just saved are still indeed there; and they are. I can also confirm that the values are indeed in my BANK_NAME.SC2Bank file. However when I launch my game, I am getting a 0 sections counted when I try to debug why there is nothing in the bank.
Here is how I PRELOAD the bank at the beginning of my map:
Every time, I get "section count: 0", and there is no need to show the rest of my loading code because at that point I know I have failed.
Is there some sort of 'gotcha' with banks that I am not seeing?
Edit: Another weird bug I am seeing is that every time I save the bank, it creates a whole new XML file with only the properties I saved from that session and does not keep the values that were inserted from a previous run from the map. This makes me think that somehow I am deleting the file right at the beginning of loading my map or something.
You cannot use a variable for preloading, Even if it is a constant. Also it would be easier for you to preload by going the map ->preload data -> Banks-> input bank name.
Unforunately I cannot test this map now because I am at work. That said, I have no qualms with opening up the editor to take screenshots. If it is any interest I can publish the map as public / unlocked. I do not care much about sharing code since this was a retrofit on an existing map made back in 2010, you will just have to bare with some of the leftover variables / triggers have not been removed, but that shouldnt be a problem since none of the code touches it.
Figured out the problem. It was because my literal string had an underscore in the name, and was not translating into the Bank File that was being created for saving and loading. The reason I was able to access the data in the same game run I was still using was because under the hood blizzard is caching the Bank I have already loaded.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Im running into an annoying problem where my bank is completely empty every time I restart my map. To clarify the issue, I can confirm that I am saving the bank, and later within the map I am checking if those values that I just saved are still indeed there; and they are. I can also confirm that the values are indeed in my BANK_NAME.SC2Bank file. However when I launch my game, I am getting a 0 sections counted when I try to debug why there is nothing in the bank.
Here is how I PRELOAD the bank at the beginning of my map:
where BANK_SCORE is a constant string defined in the variable list.
Now here is where I LOAD the bank, and attempt to check if I have any sections:
Every time, I get "section count: 0", and there is no need to show the rest of my loading code because at that point I know I have failed.
Is there some sort of 'gotcha' with banks that I am not seeing?
Edit: Another weird bug I am seeing is that every time I save the bank, it creates a whole new XML file with only the properties I saved from that session and does not keep the values that were inserted from a previous run from the map. This makes me think that somehow I am deleting the file right at the beginning of loading my map or something.
You cannot use a variable for preloading, Even if it is a constant. Also it would be easier for you to preload by going the map ->preload data -> Banks-> input bank name.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Anything preloaded cannot be variable defined. Oh and willuwontu, I'm having troubles uploading the map to Dropbox.. It's uploading quite slow.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
I have adjusted the preload and bank opening calls to use literal strings and I am still having the same issue.
preloading:
saving:
loading:
Any ideas?
Well, could we see the loadScore and saveScore function?
I checked my own working bank save system and you don't need an Open bank action for saving.
Also, lay off the underscoring for now.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
@riftgarret: Go
You're not checking in test document right? it doesn't truly save and load there.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
Lol, it does for me, willu. My stats for The Thing in test mode is 490 games played. I'm pretty sure it works.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
Unforunately I cannot test this map now because I am at work. That said, I have no qualms with opening up the editor to take screenshots. If it is any interest I can publish the map as public / unlocked. I do not care much about sharing code since this was a retrofit on an existing map made back in 2010, you will just have to bare with some of the leftover variables / triggers have not been removed, but that shouldnt be a problem since none of the code touches it.
loading score:
saving score:
Figured out the problem. It was because my literal string had an underscore in the name, and was not translating into the Bank File that was being created for saving and loading. The reason I was able to access the data in the same game run I was still using was because under the hood blizzard is caching the Bank I have already loaded.