Yet another autosave thread--undo output control and autosaves

I decided to break away from Wade’s thread because I don’t currently have or use external files for a story mode, just two extensions that seem pretty unexotic. I’m referring to Daniel’s autosave solution below, which I may misunderstand, but I don’t think it’s doing what I am trying to do.

Like Wade, my issue is that I have something that relies on a saved undo state (via Undo Output Control), which Parchment’s autosave feature does not retain. And I think players expect that to work.

I like Daniel’s autosave, but it appears to take a snapshot wherever the code is in action processing. Is that right? Undo, on the other hand, goes all the way back to the beginning. Just to clarify what’s going on here, I’ll share some snippets.

I can do this with Daniel’s command preload and Nathan N’s undo output control extensions. They work as advertised, I just dropped them in. This is all my rudimentary code, Wade isn’t to blame for any of it.

resuming is an action out of world applying to nothing [undo works, this calls it].

carry out resuming (this is the resume play rule):
	if the player is in-scene [if story mode is paused]:
		undo the current turn;
	otherwise if the player is guided [if story mode is active]\:
		say "Resuming is only possible if the player has temporarily paused story mode.";
		say "Resuming is specific to story mode, which isn't currently active.";
		stop the action.

then I can append some code after the undo is complete…

report undoing an action:
	if playmode is 2:
		if undo pending is true:
			now the player is guided;
			say "[lb][bk][it]Reverting to a previous world state and resuming story mode[dot][rt][cb][lb]";
			choose row action count from the table of story steps [return to exact place in walkthrough and preload the pending command];
			preload the command input entry;
			try looking;
			now undo pending is false;
			rule succeeds;
			say "[bk]Previous turn undone[dot][cb][lb]";
			choose row action count from the table of story steps;
			preload the command input entry;
			rule succeeds;
		say "[bk]Previous turn undone[dot][cb][lb]";
		rule succeeds.

the end result looks like this:

play example

->jump [here, the player replaces the next command in the walkthrough with “jump,” exiting story mode]
[Temporarily leaving story mode. You can return at any time by entering a blank/empty command or else typing RESUME.

If you wish to permanently leave story mode, enter LEAVE STORY MODE at the command prompt.]

The first time I inhabited a primeoid shell, I jumped and did all other sorts of primeoid things. That was thousands of years ago.

(Story mode paused. RESUME before quitting, closing, or saving your game.)

[Reverting to a previous world state and resuming story mode.]

Approaching the Scrying Hall (1980)
I hover before a transparent plane of glass that reflects my orange and luminescent eyes. Far behind me, the indistinct shadows of trees reach upward. They are darkness pinned to a lesser, starlit darkness. Through the glass, an adolescent primeoid gazes into a brightly glowing scrybox. There is no apparent sign of the psychic bleed that drew me here. The source must lie someplace beyond this hall of divination.

While there are many ways that I might depart from this spot, the only location that interests me can be found INSIDE the house. [PS 1].

->diagnose lawn [after resuming, the current pending command is preloaded]

None of this is terribly hacky or intricate (if it were, I wouldn’t be able to do it). Playtesters have gone through an entire game with this feature.

I think the way things are today, a problem in Parchment makes the game a non-starter due to “play online” functionality and embedded html at That’s not bad, I like Parchment. I’ve gone out of my way to use it with my content. But I’m wondering about building my game for a specific interpreter, if that’s where we want to take things. & external files seem to add a different level of complexity. Right now, I think any beginner/intermediate developer could understand my code, which I like. I would like people to embrace story mode (mine or Wade’s).

I guess in a way, this is really about compatibility of undo output control, which I think is generally considered safe.

Anyway, I’ll stop clogging Wade’s thread.

[moved to new thread to avoid distracting from Wade’s request]

1 Like

I’ve decided to move ahead. Ultimately, I don’t want to support homebrew undo requests in my game. Not knocking anybody who does, but I would rather go with parser undo, a built-in feature of Inform which seems to work fine outside of a very specific case.

@Draconis , are you planning to upload “command preload” to the repository? I am planning to include it in my extension. Let me know, please.

Is it not in there already? I thought I’d already uploaded it.

If not, then yes, I’ll get that in the repository.

1 Like