stringbefore;stringafter;bankprogressBank=BankLoad("test",1);//Load bankbefore=BankValueGetAsString(progressBank,"a","b");//Check if "c" is thereBankValueSetFromString(progressBank,"a","b","c");//Add cafter=BankValueGetAsString(progressBank,"a","b");//Check resultBankSave(progressBank);//Save to diskTriggerDebugOutput(1,StringToText("Before:"+before+" After:"+after),true);//Always displayes only the second c
It is embedded in a custom script init function. The last line (the debug output) shows up, so the code gets executed. I load a bank, add a value to it and save it. If I run this map twice, the value should be in the bank even before I add it (since the bank was saved). However, it isn't! The debug output always shows only the second c. In addition, no bank file gets created in the banks directory.
So what am I doing wrong? Are there any restriction on banks, like they cannot be created during map init?
Banks are kind of a tricky subject.
There are quite a lot of things you have to watch out for, when working with them.
I don't see what exactly could be wrong with this one.
If you're testing this map via battlenet you need to Preload the bank first. However, preloading only works via the GUI command, there is no Galaxy representation for that, and it NEEDS to be preloaded during map init, or it won't work.
In general banks are easier to work with when you're trying them out in GUI first, that's what you should do.
To many people are using UI and don't know about the code , i could have helped if i felt inside the coding stuff but im just starting to do some sc2 work ( i modded a lot of other games before) so i don't even know what bank in sc2 is yet :p
Banks can store data which can be loaded on the next map run.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I have this galaxy code:
It is embedded in a custom script init function. The last line (the debug output) shows up, so the code gets executed. I load a bank, add a value to it and save it. If I run this map twice, the value should be in the bank even before I add it (since the bank was saved). However, it isn't! The debug output always shows only the second c. In addition, no bank file gets created in the banks directory.
So what am I doing wrong? Are there any restriction on banks, like they cannot be created during map init?
Banks are kind of a tricky subject.
There are quite a lot of things you have to watch out for, when working with them.
I don't see what exactly could be wrong with this one.
If you're testing this map via battlenet you need to Preload the bank first. However, preloading only works via the GUI command, there is no Galaxy representation for that, and it NEEDS to be preloaded during map init, or it won't work.
In general banks are easier to work with when you're trying them out in GUI first, that's what you should do.
Banks can store data which can be loaded on the next map run.