Hey all,
I'm experiencing some difficulties creating a save game system, specifically with saving / loading maps that store lists inside them.
I have a map oData.map_oIntObj_indexes which stores lists with data about certain objects.
In my save script I have tried both this (where _map is the map to be saved using JSON):
_str = ds_map_write(oData.map_oIntObj_indexes);
ds_map_add(_map,"map_oIntObj_indexes", _str);
And later on this:
_temp_map = ds_map_create();
ds_map_copy(_temp_map, oData.map_oIntObj_indexes);
_str = ds_map_write(_temp_map);
ds_map_add(_map,"map_oIntObj_indexes", _str);
And respectively I've tried in my load script both:
ds_map_read(oData.map_oIntObj_indexes,_map[? "map_oIntObj_indexes"]);
And:
_load_map =ds_map_create();
_str = _map[? "map_oIntObj_indexes"];
ds_map_read(_load_map, _str);
ds_map_copy(oData.map_oIntObj_indexes, _load_map);
And in both instances when I load the game I get the error "Data structure with index does not exist" which refers to a line where lists I have stored in the map (map_oIntObj_indexes) are referred to, which makes me believe that while the map is 'saved' the lists inside it are not.
I am experiencing no difficulties in saving and loading lists, arrays, etc, only with type of data structure.
I'm using Windows 10 and my GM version is IDE 2.2.5.481, Runtime 2.2.5.378.
Please help if you can Thanks!
I'm experiencing some difficulties creating a save game system, specifically with saving / loading maps that store lists inside them.
I have a map oData.map_oIntObj_indexes which stores lists with data about certain objects.
In my save script I have tried both this (where _map is the map to be saved using JSON):
_str = ds_map_write(oData.map_oIntObj_indexes);
ds_map_add(_map,"map_oIntObj_indexes", _str);
And later on this:
_temp_map = ds_map_create();
ds_map_copy(_temp_map, oData.map_oIntObj_indexes);
_str = ds_map_write(_temp_map);
ds_map_add(_map,"map_oIntObj_indexes", _str);
And respectively I've tried in my load script both:
ds_map_read(oData.map_oIntObj_indexes,_map[? "map_oIntObj_indexes"]);
And:
_load_map =ds_map_create();
_str = _map[? "map_oIntObj_indexes"];
ds_map_read(_load_map, _str);
ds_map_copy(oData.map_oIntObj_indexes, _load_map);
And in both instances when I load the game I get the error "Data structure with index does not exist" which refers to a line where lists I have stored in the map (map_oIntObj_indexes) are referred to, which makes me believe that while the map is 'saved' the lists inside it are not.
I am experiencing no difficulties in saving and loading lists, arrays, etc, only with type of data structure.
I'm using Windows 10 and my GM version is IDE 2.2.5.481, Runtime 2.2.5.378.
Please help if you can Thanks!