As I continue the monumental task of updating old extensions (specifically ones I want to use in ECTOCOMP but shhh), I’m seeing what improvements I can make with the wisdom of years on my side. And one of those is the Autosave extension, which previously didn’t give authors any control over the autosave filename. This means that it’s entirely possible for different games’ autosaves to overwrite each other, since they’re all named autosave.glksave
.
(Or maybe they won’t. The interpreter is allowed to keep save files in different places, since they’re not expected to be compatible between games. But best not to rely on this.)
Here’s how I’m hoping to give the author control over this:
The autosave filename is a text variable.
The autosave filename variable translates into I6 as "autosave_fn".
The autosave filename is usually "autosave".
// Then:
glk_fileref_create_by_name(
fileusage_SavedGame + fileusage_BinaryMode,
Glulx_ChangeAnyToCString(autosave_fn),
0
);
But I don’t know if this is a valid/supported use of Glulx_ChangeAnyToCString (or rather, of Glulx_PrintAnyToArray, which ChangeAnyToCString is a thin wrapper around). Can I print an I7 text this way? Or do I need to mess around with Text_TY_Say instead?