Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(6 edits)

Hello! I have downloaded and tried with my rom. All works fine except the saving.

I notice the following behaviour:

My rom is called game.gb 

Inside Godot IDE, it creates a game.sav and it loads it. However the Restart function never loads the save again. If I stop and play it loads the save correctly.

When I export to windows, the save file is name_of_project.sav instead of game.sav but the loading works. However, same as before, the Restart function never loads the save. I have to close the .exe and open again to load the save.

EDIT: the easiest fix is just to add this:


func _on_pause_menu_restart() -> void:
gb.load_rom_buffer(rom.rom)
# ADD THIS
#user:// path is used by Godot for save data. It's a logical save location for each OS.  
save_path = "user://" + rom.resource_path.get_file() + ".save"
var ram_file = FileAccess.open(save_path,FileAccess.READ)
if ram_file != null:
var buffer = ram_file.get_buffer(ram_file.get_length())
gb.load_ram_buffer(buffer)
(+2)

Cool, if you can do a Merge Request on GitLab, I can merge that. Otherwise, I’m out of town and can’t review/fix it properly for a bit.

But thank you for bug+fix!

(+1)

Not gonna lie, I don't even have a gitlab account 😂 

Btw the other thing, different names for the save file depending if using the IDE or just run it, still happens. I can check it too but I don't know if that is intentional.