S
spaghettimaker
Guest
I'm been following Roman's Metroidvania Map Implementation thread and have hit a road block.
The map is working as it should but I'm trying to save the map data (array) to an .ini file at save points.
Below is the array and save point code:
ARRAY
ini_open(global.save_selected_temp)
for (var i = 0; i <= 40; i++)
for (var j = 0; j <= 58; j++)
mapGrid[i, j] = ini_read_real("row" + string(i), string(j), 0);
ini_close();
SAVE POINT
if (file_exists(MAPFILE)) file_delete(MAPFILE);
//Create new map save
ini_open("Map.ini");
ini_write_real("Map","row",ds_grid_write(obj_map.mapGrid));
ini_close();
I'm currently getting the following error message:
ds_grid_write argument 1 incorrect type (array) expecting a Number (YYGI32)
Any suggestions would be greatly appreciated!
The map is working as it should but I'm trying to save the map data (array) to an .ini file at save points.
Below is the array and save point code:
ARRAY
ini_open(global.save_selected_temp)
for (var i = 0; i <= 40; i++)
for (var j = 0; j <= 58; j++)
mapGrid[i, j] = ini_read_real("row" + string(i), string(j), 0);
ini_close();
SAVE POINT
if (file_exists(MAPFILE)) file_delete(MAPFILE);
//Create new map save
ini_open("Map.ini");
ini_write_real("Map","row",ds_grid_write(obj_map.mapGrid));
ini_close();
I'm currently getting the following error message:
ds_grid_write argument 1 incorrect type (array) expecting a Number (YYGI32)
Any suggestions would be greatly appreciated!
Last edited by a moderator: