i have a problem with trigger: i think i did everything ok, but when i test map by Test Document option - i get message, that the bank is not valid. i use signature for checking if the bank has been modified by game or not.
i will attach image in a minute.
if i use that trigger without Signature Option and without Verify Bank - i get "no value", this is strange too, because in the bank there is a value of the specified key and section.
i think they don't. a couple of days ago i've been testing bank operations (preload, open, save, store) and i could load bank anytime i wanted to. i made a trigger, which was executed, when player typed "load" in chat messages. it worked properly, but now - none of the bank operation works :/ (except storing and saving)
anyone knows the way to fix that?
while i've been trying to make thing work, i made a function:
LoadPlayerBank
Options: Action
Return Type: (None)
Parameters
iPlayer <Integer>
Grammar Text: LoadPlayerBank(iPlayer)
Hint Text: (None)
Custom Script Code
Local Variables
Actions
Bank - Preload and synchronize bank "ATC" for player iPlayer
Bank - Open bank "ATC" for player iPlayer
Bank - Set Option Signature for Bank (Last opened bank) to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank (Last opened bank) is verified) == true
Then
UI - Display "Bank is valid." for (All players) to Subtitle area
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank (Last opened bank) has "Hero" in section "SaveData") == true
Then
Bank - Restore "Hero" of section "SaveData" from bank (Last opened bank) for player iPlayer at Player Spawn Point 01 facing 0.0
Variable - Set PlayerHeroes[iPlayer] = (Last restored unit)
Else
UI - Display "Hero data not found." for (All players) to Subtitle area
CreatePlayerHero(iPlayer)
Else
UI - Display "Invalid bank file." for (All players) to Subtitle area
but that functions returns only "Invalid bank file.", but, as i think, it should create (restore) "hero" unit. i use that function in Map Initialization trigger (only Map Initialization). trigger is used for 8 players, but while testing, there was only one (me).
any ideas how to fix the problem?
You should enable signature right after opening the bank, don't edit the bank before doing so. Your string did not match the signature because you stored it before the Set Bank Option action, which generates a signature based on the values currently in the bank.
i moved preloading section to map initialization main trigger (but that doesn't matter for now). the thing that matters is that i used a constant expression while preloading. i mean:
Bank - Preload and synchronize bank "ATC" for player 1
(not "for player iPlayer" - that means: not for variable.)
i have detected that in at least one trigger there should be at least one "open bank" or "preload bank" with a constant expression for all players. so, if i want to use my bank, i should put "preload bank for player" in the "map initialization" trigger with constants of all human players.
anyway, thanks for replies.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
i have a problem with trigger: i think i did everything ok, but when i test map by Test Document option - i get message, that the bank is not valid. i use signature for checking if the bank has been modified by game or not.
i will attach image in a minute.
if i use that trigger without Signature Option and without Verify Bank - i get "no value", this is strange too, because in the bank there is a value of the specified key and section.
I believe preloading bank, and/or open bank actions can only be done in map initialization
i think they don't. a couple of days ago i've been testing bank operations (preload, open, save, store) and i could load bank anytime i wanted to. i made a trigger, which was executed, when player typed "load" in chat messages. it worked properly, but now - none of the bank operation works :/ (except storing and saving) anyone knows the way to fix that?
while i've been trying to make thing work, i made a function:
LoadPlayerBank
but that functions returns only "Invalid bank file.", but, as i think, it should create (restore) "hero" unit. i use that function in Map Initialization trigger (only Map Initialization). trigger is used for 8 players, but while testing, there was only one (me). any ideas how to fix the problem?
does anybody know what is wrong?
You should enable signature right after opening the bank, don't edit the bank before doing so. Your string did not match the signature because you stored it before the Set Bank Option action, which generates a signature based on the values currently in the bank.
i use the following function to save data:
as you see, setting signature to enable is set after opening the bank, but the problem still exists.
i think i solved the problem.
i moved preloading section to map initialization main trigger (but that doesn't matter for now). the thing that matters is that i used a constant expression while preloading. i mean:
i have detected that in at least one trigger there should be at least one "open bank" or "preload bank" with a constant expression for all players. so, if i want to use my bank, i should put "preload bank for player" in the "map initialization" trigger with constants of all human players.
anyway, thanks for replies.