Author Topic: [Solved but strange] Problem with save variables in custom game manager  (Read 563 times)

PhoenixII54

  • Newbie
  • *
  • Posts: 9
    • View Profile
In my test game, i made a custon central game and save manager.
When creating a game, everything seems fine but it doesn"t seem to take the save and get savegame values function in account. For example, in initialization, i set max life to 10 and two option values for the sound and music volumes in costom named variables, but when calling the game:save() function, max life reverts to 1 and the option variables just don't exist. No error is thrown.
My question is : did i make something wrong or is there a bus with the save management ?

I attached the game manager script so you can chack foir any error.

Thanks in advance for your answer.
« Last Edit: June 16, 2015, 12:16:55 pm by PhoenixII54 »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1030
    • View Profile
Re: Problem with save variables in custom game manager
« Reply #1 on: June 16, 2015, 10:29:47 am »
I don't see an error just by reading the code.
Maybe someone else will find something?
If not, can you give a link to your whole quest (with google drive or something) so that we can reproduce the bug?

PhoenixII54

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Problem with save variables in custom game manager
« Reply #2 on: June 16, 2015, 10:46:07 am »
Here it is. Hope it helps you.



https://drive.google.com/folderview?id=0BzXzhPafClIMfkV3a2FESnVrUDdCNlRzbWpyZ3JYMmRQZkZ1aUhySzBpQXlTTWNuTld5Tzg&usp=sharing


Note : Feel free to switch the "debug" variable in main to see the cell viewer i made to find the problem with streams
« Last Edit: June 16, 2015, 10:48:20 am by PhoenixII54 »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1030
    • View Profile
Re: Problem with save variables in custom game manager
« Reply #3 on: June 16, 2015, 11:44:03 am »
I have just tested and I don't see what you describe. When I save, values are not reverted. My save file has the correct values: max_life is 10 and I have your two new values:
Code: [Select]
_ability_tunic = 1
_current_life = 1
_joypad_action = "button 0"
_joypad_attack = "button 1"
_joypad_down_key = "axis 1 +"
_joypad_item_1 = "button 2"
_joypad_item_2 = "button 3"
_joypad_left_key = "axis 0 -"
_joypad_pause = "button 4"
_joypad_right = "axis 0 +"
_joypad_up_key = "axis 1 -"
_keyboard_action = "space"
_keyboard_attack = "c"
_keyboard_down = "down"
_keyboard_item_1 = "x"
_keyboard_item_2 = "v"
_keyboard_left = "left"
_keyboard_pause = "d"
_keyboard_right = "right"
_keyboard_up = "up"
_max_life = 10
_starting_map = "tests/out_tile_test_map"
_starting_point = ""
_version = 2
option_music_volume = 50
option_sound_volume = 50
« Last Edit: June 16, 2015, 11:47:34 am by Christopho »

PhoenixII54

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Problem with save variables in custom game manager
« Reply #4 on: June 16, 2015, 12:15:41 pm »
OK, thanks for testing.

Just tested and it worked fine too...

Sounds funny as the last time i tried it just didn't work. Maybe restarting the editor and/or the computer did help.