--- Erik Temple on 11/28/2013 2:11 PM, wrote:
> First issue: It seems that the Start passage is auto-saved by
> default, so that if you try to call a macro from the Start passage
> to auto-load the autosaved game, you will be too late--the game will
> have autosaved on the Start passage and the old saved state will be
> gone.
That's the problem (one of the problems?) with wanting to save on
every single passage. Still, there are solutions.
> This can be got around by configuring autosave system to save
> automatically only for passages with a given tag: If we leave the
> Start passage untagged and tag every other passage with the autosave
> tage, we are able to access the old save from the newly begun story's
> Start.
You could do that, but there's a much better and easier way. Use the
config.saves.isAllowed property, which is checked by all saves, even
the autosave.
Set config.saves.isAllowed to something like this:
config.saves.isAllowed = function () {
if (tale.get(state.active.title).tags.indexOf("nosave") === -1) {
return false;
}
return true;
};
And then tag any passage (e.g. Start) where you don't want saving to
be allowed with "nosave". For normal saves, in addition to the save
being disallowed, the user will get a message about it. For the auto-
save, the save will simply be disallowed, no message will be given.
> Second issue: Unfortunately, I can't *quite* seem to get an autoload
> macro working. ...
>
> SaveSystem.loadAuto;
That bit right there. You're referencing the function definition,
not calling the function. Try this instead:
SaveSystem.loadAuto();
Tangentially, I wouldn't use the non-strict equality operators unless
you actually need to (there are a few instances that require them).
So, instead of this:
if (retVal == true) {
I'd suggest:
if (retVal === true) {
> Also, would it make sense to always exempt the Start passage from
> autosaving?
For most stories/games, where the Start passage is used as landing
passage/opening screen of sorts, yes. In that case, I'm honestly
not sure what anyone would gain from saving there.
However, it's not inconceivable for a story to use the Start passage
as a real, functional part of the story/game and to allowing passing
through it multiple times. Disallowing saves there by default would
be bad.
So, I'm inclined to leave things as they are. This issue only affects
the all-saves-all-the-time setting of config.saves.autosave and, as
noted, config.saves.isAllowed can be used to alleviate any problems
with that.
I probably should point out that pitfall in the docs, however.
--
Thomas Michael EDWARDS
Email:
tmed...@motoslave.net Website:
http://www.motoslave.net/thom/
"That a word like unnatural exists at all indicates a serious deficiency
in common sense...." -- Anna Puma, Dominion: Conflict 1 (No More Noise)