K
krugen
Guest
I am having problem with save file. Before this, I could run the game, click new game, save game, exit game and continue game. I could still continue game if I close the program and run again provided I save my game before I close the program.
Now, I can run new game, saved and continue, but not when I close and rerun again. The continue button is there but it says my ds_grid is not set before reading it.
My new game code:
My save code
My continue code:
Is there anything I'm missing?
__________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Mouse Event for Left Pressed
for object obj_continue:
global variable name 'local_info_items' index (100034) not set before reading it.
at gml_Object_obj_continue_Mouse_4 (line 63) - ds_grid_read(global.local_info_items, local_info_items_buffer);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_continue_Mouse_4 (line 63)
Now, I can run new game, saved and continue, but not when I close and rerun again. The continue button is there but it says my ds_grid is not set before reading it.
My new game code:
Code:
global.local_info_items = ds_grid_create(20, 3);
var i, j;
i = 0;
j = 0;
repeat (ds_grid_width(global.local_info_items))
{
repeat (ds_grid_height(global.local_info_items))
{
ds_grid_set(global.local_info_items, i, j, 0);
j += 1;
}
j = 0;
i += 1;
}
My save code
Code:
var dsw_local_info_items = ds_grid_write(global.local_info_items);
ds_map_replace(global.game_status, "k_local_info_items", dsw_local_info_items)
My continue code:
Code:
var local_info_items_buffer = global.game_status[? "k_local_info_items"];
ds_grid_read(global.local_info_items, local_info_items_buffer);
Is there anything I'm missing?
__________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Mouse Event for Left Pressed
for object obj_continue:
global variable name 'local_info_items' index (100034) not set before reading it.
at gml_Object_obj_continue_Mouse_4 (line 63) - ds_grid_read(global.local_info_items, local_info_items_buffer);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_continue_Mouse_4 (line 63)