(Solved) I need help with ds_maps

RetnuH

Member
So it works for me the saving loading etc works for me when i play it in the gml2 but when i post the file to itch.io and someone downloads it and they try and press play (where it usually loads the game file) it crashes, because im assuming it doesnt have my saved data and its trying to load something but how do i make a fresh game save if you dont have one already and if you do it loads that.
 

Homunculus

Member
You’ll generally include a fresh save file in the “included files” section. Or generate a fresh save if the file is not found at game start.
 

RetnuH

Member
You’ll generally include a fresh save file in the “included files” section. Or generate a fresh save if the file is not found at game start.
yea and i know i need to do exactly that but i dont know what code i would need to use to check that like do i have to just check if the load file is 0 or 1 (i dont know if it automatically sets it to true or false if it has something in it) or what would i go about doing this (im also very new to ds_maps so what i just said might just make no sense to someone who knows what they r doing lol)
 

Homunculus

Member
Depends on the structure of your file. There has to be a “default” state for every entry in your ds_map right? In this case, use file_exists to check the presence of the file, if found, load it and proceed as you already do, otherwise create a new ds_map with default values and save it.

The load file being 0 or 1 makes no sense, either there is a save file, and you are able to load it, or there isn’t. You use file_exists to check this.
 
Top