1 Force Save
judicornadamsfoster edited this page 2026-06-29 16:07:20 +01:00

This code forces a save rather than asks if you want to save.

forcesave

src/start_menu.c

add to end of file:

void Script_ForceSaveGame(struct ScriptContext *ctx)
{
    SaveGame();
    ShowSaveInfoWindow();
    gMenuCallback = SaveCallback;
    sSaveDialogCallback = SaveSavingMessageCallback;
}

asm/macros/event.inc

add to end of file:

	.macro forcesave
	callnative Script_ForceSaveGame
	waitstate
	.endm

To use, add forcesave to your script (and release if your script doesn't already have it).

code script for the example in the gif:

LittlerootTown_EventScript_TownSign::
msgbox LittlerootTown_Text_TownSign, MSGBOX_SIGN
forcesave
release
end