- Joined
- Sep 28, 2009
- Messages
- 222
hi guys
i got some big problem. i just finished an early version of my save load system, but it doesnt work. when i save the hero and then load it directly after the saving, so without restarting the map, all works fine. but if i save the hero, then restart the game and then load it, it says he couldnt find the entry. but i thought bank files are exactly made for this case? it seems like the bank file gets deleted after map restart? oO
save trigger:
so again: it works all fine without restarting the map, but if i restard he cant find the entry.
so whats wrong with this?
Edit: i think i got it to work. you must preload the bank file on map init, otherwise it doesnt work
i got some big problem. i just finished an early version of my save load system, but it doesnt work. when i save the hero and then load it directly after the saving, so without restarting the map, all works fine. but if i save the hero, then restart the game and then load it, it says he couldnt find the entry. but i thought bank files are exactly made for this case? it seems like the bank file gets deleted after map restart? oO
save trigger:
-
save hero
-
Events
- Dialog - Any Dialog Item is Clicked by Player Any Player
-
Local Variables
- player = (Triggering player) <Integer>
-
Conditions
- (Used dialog item) == herosavedialogbutton
-
Actions
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- hero[player] != No Unit
-
Then
- Bank - Open bank "World of Starcraft SAVEFILE" for player player
- Bank - Store unit hero[player] as "hero" of section "heroes" in bank (Last opened bank)
- Bank - Save bank (Last opened bank)
- UI - Display a Message custom dialog with Title "Success" and Text "Your hero was saved." for (Player group(player)) (Unpause game)
-
Else
- UI - Display a Message custom dialog with Title "Warning" and Text "WARNING: YOUR HERO COULD NOT BE FOU..." for (Player group(player)) (Unpause game)
-
If
-
General - If (Conditions) then do (Actions) else do (Actions)
-
Events
-
load hero
-
Events
- Dialog - Any Dialog Item is Clicked by Player Any Player
-
Local Variables
- player = (Triggering player) <Integer>
-
Conditions
- (Used dialog item) == loadhero
-
Actions
- Bank - Open bank "World of Starcraft SAVEFILE" for player player
-
General - If (Conditions) then do (Actions) else do (Actions)
-
If
- (Bank (Last opened bank) has "hero" in section "heroes") == true
-
Then
- Bank - Restore "hero" of section "heroes" from bank (Last opened bank) for player player at (Center of Cosmozang) facing 0.0
- UI - Display a Message custom dialog with Title "Success" and Text "Your hero was loaded!" for (Player group(player)) (Unpause game)
-
Else
- UI - Display a Message custom dialog with Title "Error" and Text "Error: No saved hero was found. If ..." for (Player group(player)) (Unpause game)
-
If
-
Events
so again: it works all fine without restarting the map, but if i restard he cant find the entry.
so whats wrong with this?
Edit: i think i got it to work. you must preload the bank file on map init, otherwise it doesnt work
-
preload heros
-
Events
- Game - Map initialization
- Local Variables
- Conditions
-
Actions
- Bank - Preload and synchronize bank "bank" for player 0
- Bank - Preload and synchronize bank "bank" for player 1
- Bank - Preload and synchronize bank "bank" for player 2
- Bank - Preload and synchronize bank "bank" for player 3
- Bank - Preload and synchronize bank "bank" for player 4
- Bank - Preload and synchronize bank "bank" for player 5
- Bank - Preload and synchronize bank "bank" for player 6
- Bank - Preload and synchronize bank "bank" for player 7
- Bank - Preload and synchronize bank "bank" for player 8
- Bank - Preload and synchronize bank "bank" for player 9
- Bank - Preload and synchronize bank "bank" for player 10
- Bank - Preload and synchronize bank "bank" for player 11
- Bank - Preload and synchronize bank "bank" for player 13
- Bank - Preload and synchronize bank "bank" for player 14
- Bank - Preload and synchronize bank "bank" for player 15
-
Events
-
preload heros
-
Events
- Game - Map initialization
- Local Variables
- Conditions
-
Actions
-
Player Group - Pick each player in (All players) and do (Actions)
-
Actions
- Bank - Preload and synchronize bank "bank" for player (Picked player)
-
Actions
-
Player Group - Pick each player in (All players) and do (Actions)
-
Events
Last edited: