well i dont get why you are loading stats from the bank just to write them again to the bank, you are not changing any value. besides that did you try to preload your bank in preload settings or with the trigger option preload bank?
You need to set the signature system active after opening the bank, not after saving it. You also need to verify the signature and if it fails then discard its contents (since it has likely been hacked).
I am guessing the main reason it does not work is that you have not pre-loaded the bank file. This is more than a native call and in fact adds the bank file name to a special pre-load file list. In multiplayer you can only use banks which have been pre-loaded.
The trigger action should be placed inside some dummy trigger. It does not mater where (as it does not execute any code!) but it generally should be at map initialization, use string constants for the file name and only be declared once.
It's better and easier to preload banks using the map->preload info route (this actually loads it prior to triggers running) [1]
Which is what the triggers do? As I said, they are dummy actions that do not result in any code generation but do add the provided string to the preload lists of the map so that the bank can be used in multiplayer.
I always figured, that in triggers they looked for and ran that action first prior to any others (but still when triggers begin to run), and then ran the rest. Hence the need to add banks to the preload info. But now that I look back at what he said again, i guess it doesn't change anything, but it does make it more convenient.
One reason might be that using the script dummy function is not really "worse" than the preload UI. I just personally think it makes more sense to use the UI as the dummy action is sort of confusing as it doesnt actually compile to script.
My only guess is it has to do with you running that trigger multiple times from within itself.
P.S. I'm assuming that it is a typo that you have the whole thing running when the compile timer == 10 and that the missing "else" has nothing to with the stats.
I tried setting bank to a variable, but it didn't help anything.
The compile timer = 10 updates the stat board once at the beginning, and once the timer is = to 0, then it compiles the current round onto the career stats and shows them.
Solved it. You can't use the "_" character in your bank name otherwise it saves as "orbitaakca" and when the program tries to find "orbitaa_kca" it fails resulting in a fresh bank.
Apparently you cannot open banks using loops, and that's exactly what I was doing. It's working now, but my time value is still saving a bit odd, I'll figure it out.
Edit: That issue was based on the calculation considering match time, instead of match time + career time added.
See, exactly this is why you use the UI and not the script.
The script version implies that normal control structures can be used, which obviously cant work because the dummy action doesnt actually convert to Galaxy and no real logic is performed.
The script version implies that normal control structures can be used, which obviously cant work because the dummy action doesnt actually convert to Galaxy and no real logic is performed.
It mentions clearly that it is a macro in the action description.
The issue here is people not understanding enough Galaxy.
I disagree that the issue is Galaxy here. The GUI editor is specifically built so that it is not necessary to understand Galaxy in order to code.
The function looks very simple to use, which is why many people will not read the documentation very carefully.
Its just that nobody expects such behavior as it is highly unusual.
I disagree that the issue is Galaxy here. The GUI editor is specifically built so that it is not necessary to understand Galaxy in order to code.
Well clearly it does not do its job well seeing how many questions get asked. A lot of them are self explanatory if you understand what is going on "under the hood".
Quote:
The function looks very simple to use, which is why many people will not read the documentation very carefully.
Driving a car also looks simple. Too bad it is not. This is why you always read the documentation provided with your API as even what seems to be the most implicitly named functions can do something completely different.
Quote:
Its just that nobody expects such behavior as it is highly unusual.
Actions which "create new threads" are as unexpected. If you look under the hood they bind the action definition function to a trigger and then use global registers to pass the arguments when the trigger is executed with "do not wait" mode with the arguments instantly being copied to locals at the beginning of the function. This is why you ended up with articles like that horrific "Multithreading and AI" one which talk complete... garbage... which I have hopefully managed to burn away with fire!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I am using the following code to open my banks, process, and save new ones.
Basically it takes the stats from the current game and adds them to the previous matches, giving you a career total.
I've never set up banks before, so what am I doing wrong?
I believe I had a problem pertaining to using sections as keys, but i swapped them and it didn't help..
Thanks
well i dont get why you are loading stats from the bank just to write them again to the bank, you are not changing any value. besides that did you try to preload your bank in preload settings or with the trigger option preload bank?
You need to set the signature system active after opening the bank, not after saving it. You also need to verify the signature and if it fails then discard its contents (since it has likely been hacked).
I am guessing the main reason it does not work is that you have not pre-loaded the bank file. This is more than a native call and in fact adds the bank file name to a special pre-load file list. In multiplayer you can only use banks which have been pre-loaded.
The trigger action should be placed inside some dummy trigger. It does not mater where (as it does not execute any code!) but it generally should be at map initialization, use string constants for the file name and only be declared once.
@ImperialGood: Go
It's better and easier to preload banks using the map->preload info route (this actually loads it prior to triggers running)
[1]
That being said if he's not doing it that way or through triggers, then he needs to do that.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Which is what the triggers do? As I said, they are dummy actions that do not result in any code generation but do add the provided string to the preload lists of the map so that the bank can be used in multiplayer.
@ImperialGood: Go
I always figured, that in triggers they looked for and ran that action first prior to any others (but still when triggers begin to run), and then ran the rest. Hence the need to add banks to the preload info. But now that I look back at what he said again, i guess it doesn't change anything, but it does make it more convenient.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Should use the UI for preloading the banks rather than the script.
The script action only exists for backwards compatibility. Back in the day the UI for preloading banks didnt exist.
Why is it not labelled as deprecated? Like the "Unit Is Attacked (Deprecated)" and "Unit Starts Attacking (Deprecated)"?
@ImperialGood: Go
One reason might be that using the script dummy function is not really "worse" than the preload UI. I just personally think it makes more sense to use the UI as the dummy action is sort of confusing as it doesnt actually compile to script.
So... I changed the location of the verification, but it didn't help.
I am Pre-loading the bank for each player during initialization...
Do banks not work in offline testing?
Am I using the keys and sections correctly?
Thanks
@Sapphire_united: Go
Banks work offline.
My only guess is it has to do with you running that trigger multiple times from within itself.
P.S. I'm assuming that it is a typo that you have the whole thing running when the compile timer == 10 and that the missing "else" has nothing to with the stats.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
I tried setting bank to a variable, but it didn't help anything.
The compile timer = 10 updates the stat board once at the beginning, and once the timer is = to 0, then it compiles the current round onto the career stats and shows them.
Solved it. You can't use the "_" character in your bank name otherwise it saves as "orbitaakca" and when the program tries to find "orbitaa_kca" it fails resulting in a fresh bank.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
That wasn't all that was wrong.
Apparently you cannot open banks using loops, and that's exactly what I was doing. It's working now, but my time value is still saving a bit odd, I'll figure it out.
Edit: That issue was based on the calculation considering match time, instead of match time + career time added.
Thanks for the help guys!
@Sapphire_united: Go
You can use a loop to open and save, but you can't preload one using a loop
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
See, exactly this is why you use the UI and not the script.
The script version implies that normal control structures can be used, which obviously cant work because the dummy action doesnt actually convert to Galaxy and no real logic is performed.
It mentions clearly that it is a macro in the action description.
The issue here is people not understanding enough Galaxy.
@ImperialGood: Go
I disagree that the issue is Galaxy here. The GUI editor is specifically built so that it is not necessary to understand Galaxy in order to code.
The function looks very simple to use, which is why many people will not read the documentation very carefully.
Its just that nobody expects such behavior as it is highly unusual.
Well clearly it does not do its job well seeing how many questions get asked. A lot of them are self explanatory if you understand what is going on "under the hood".
Driving a car also looks simple. Too bad it is not. This is why you always read the documentation provided with your API as even what seems to be the most implicitly named functions can do something completely different.
Actions which "create new threads" are as unexpected. If you look under the hood they bind the action definition function to a trigger and then use global registers to pass the arguments when the trigger is executed with "do not wait" mode with the arguments instantly being copied to locals at the beginning of the function. This is why you ended up with articles like that horrific "Multithreading and AI" one which talk complete... garbage... which I have hopefully managed to burn away with fire!