I've been facing a problem for a few months and just now found the cause.
I use ini files to keep track of what rooms the player has visited, so I can use this data to display a map screen.
Whenever he enters a room, the game stores this information and when he saves, it writes the information on a .ini file.
The problem occurs after visiting a certain number of rooms: after you save the game, it instantly freezes. I've tried making alternate ways to see if it was a problem with that specific room, but it seems the problem happens after you've visited "x" rooms.
My question is, is there a limit to write data on a .ini file? Because the system works through all the game until a certain number of rooms is visited, so I can only think it has reached a limit or something.
Parts of my code below.
After saving the game:
global.data_structures_loaded=false
save_ds()
ds_list_destroy("visited")
game_save("Save.dat")
save_ds():
ini_open("E111111.dat") //this is the ini file, btw
ini_write_string("data","visited",ds_list_write(visited))
ini_write_real("data","room",room)
ini_close()
When loading the game, an object has this in its begin step:
if global.data_structures_loaded=false
{
load_ds()
alarm[2]=2
global.data_structures_loaded=true
}
load_ds():
if file_exists("E111111.dat")
{
ini_open("E111111.dat")
if ini_key_exists("data","visited") && ini_key_exists("data","room")
{
visited = ds_list_create();
ds_list_read(visited,ini_read_string("data","visited",""))
global.myFont = font_add_sprite(font_spr, ord(' '), false, 4); //just adding the font again, ignore
}
else
textbox(-1,bck_text,"Error! File corrupted!")
ini_close()
}
else
textbox(-1,bck_text,"Error! File not found!")
Any help deeply appreciated. And sorry for the confusing post..