When I try to read a saved variable (interger in this case) after having opened the bank through BankLoad() in custom script, I get nothing. Even though the file is there.
Recompiling the map and instead opening the bank like in the first picture works however.
This works
while this doesn't
Looking at the script, the whole code is EXACTLY the same, still one works and the other doesn't.
Could someone please confirm or explain this?
Also, using a variable (const string) for bank name or player number gives the same error.
You're not allowed to use any variables in bank names, not even constants are allowed I think. That's because banks actually don't really load through the script. They seem to be handled outside of all triggers.
No idea why the custom script one wouldn't work, though.
Yes, I tried them multiple times, and the first one works even after restarting, the second doesn't at all.
My solution is to open and save the banks like this:
Edit:
Eh, I don't really know what I've changed, but running everything as a custom script from the map init function works too, even with variables for bank name and player number.
When I try to read a saved variable (interger in this case) after having opened the bank through BankLoad() in custom script, I get nothing. Even though the file is there. Recompiling the map and instead opening the bank like in the first picture works however.
This works
while this doesn't
Looking at the script, the whole code is EXACTLY the same, still one works and the other doesn't. Could someone please confirm or explain this?
Also, using a variable (const string) for bank name or player number gives the same error.
I know that some bank functions forbid use of variables. I think it's just the preload function, however.
Did you try them multiple times? From what I've read, neither of those will work after starcraft is quit and relaunched since there's no preload/sync.
You're not allowed to use any variables in bank names, not even constants are allowed I think. That's because banks actually don't really load through the script. They seem to be handled outside of all triggers.
No idea why the custom script one wouldn't work, though.
How about doing that:
Yes, I tried them multiple times, and the first one works even after restarting, the second doesn't at all. My solution is to open and save the banks like this:
Edit:
Eh, I don't really know what I've changed, but running everything as a custom script from the map init function works too, even with variables for bank name and player number.
I must've run another BankLoad function through the "Initialization Function (Optional):"-thingy before or something.