This is done by having scripts import and export global variables to a dummy save file; an export script runs whenever the tag is changed, and an import script runs at the title screen and whenever a save file's loaded. The tags are translated into global variables upon export, and vice-versa upon import.
(In this example, there's only one tag and one corresponding global variable. The export globals command is meant to work with multiple variables, but works fine with just one. I'm pretty sure that's not where the error's coming in.)
Code: Select all
global variable (5, dummy gv)
plotscript, importing globals, begin
dummy gv := import globals (1000, 5)
switch (dummy gv)
do (
case (0) set tag (5, 0)
case (1) set tag (5, 1)
case (else) show text box (18) # error message
)
end
plotscript, exporting globals, begin
wait (1)
dummy gv := check tag (5)
export globals (1000, 5, 5)
end
Is there a way to make it so that it carries over even if the player doesn't exit the menu?