Inform 7: Replace 'undo' messages

In the Standard Rules, we find this rule for ‘Undo’:

The immediately undo rule translates into Inter as "IMMEDIATELY_UNDO_R" with
	"The use of 'undo' is forbidden in this story." (A),
	"You can't 'undo' what hasn't been done!" (B),
	"Your interpreter does not provide 'undo'. Sorry!" (C),
	"'Undo' failed. Sorry!" (D),
	"[bracket]Previous turn undone.[close bracket]" (E),
	"'Undo' capacity exhausted. Sorry!" (F).

I would like to replace some of that text with new text. I tried:

The immediately undo in-world rule is the new immediately undo rule.

But the compiler complains about this (" The sentence ‘The immediately undo in-world rule is the new immediately undo rule’ seems to say that ‘immediately undo in-world rule’, which I think is a rule, and ‘new immediately undo rule’, which I think is an object, are the same.")

Is there some way to do this? There are older threads about using the Default Messages extension by David Fisher, but that seems to be out of date (or at least is no longer included in the latest Inform).

2 Likes

Are you trying to change the texts of undo, or the behaviour?

1 Like

Just the text.

1 Like

I use the Response Assistant by Aaron Reed (https://github.com/zedlopez/extensions/blob/master/Aaron%20Reed/Response%20Assistant.i7x) to quickly find response messages I need to change from the default text.

The undo command is a bit special but when I enabled the response tracker at startup it could tell me how to change one of the default messages:

>undo
[You can't "undo" what hasn't been done! - response 5]
 
>response 5
immediately undo rule response (B)
 
Currently:
"You can't 'undo' what hasn't been done!"
 
To change, copy and paste the following line into your source:
The immediately undo rule response (B) is "New response text."
 
* Note: if this response was defined in your own source text, of course, it's easier to change it by searching for the text in your project and updating the original.
> 

So to change all undo response messages, you can write

The immediately undo rule response (A) is "New response text."
:
The immediately undo rule response (F) is "New response text."

See also the Inform7 documentation: 14.11. Changing the text of responses (ganelson.github.io)

5 Likes

A solution and a method for figuring this out in the future! That’s fantastic; thank you so much.

1 Like

Also 14.12. The RESPONSES testing command (ganelson.github.io) mentions the cool RESPONSES testing command, which allows you to get the whole list after you mentally prepared yourself. Take a deep breath, and do:

> responses all
:
    report waving hands rule response (A): "[We] [wave]."
    report waving hands rule response (B): "[The actor] [wave]."
    block buying rule response (A): "Nothing [are] on sale."
    block climbing rule response (A): "Little [are] to be achieved by that."
    block sleeping rule response (A): "[We] [aren't] feeling especially drowsy."

>

(I do not use it myself, the scroll buffer of quixe is apparently too small to contain the entire text, there are a LOT of response messages)

2 Likes

Neutral Standard Responses not only provides alternatives for many responses, it’s also useful as a reference: it provides all the original responses in comments, too.

For the command-line crowd in *nix-ish environments, there’s an easy way to capture output in a file:

echo 'responses all'|cheap-git gamefile.ulx > gamefile_responses.txt

(and the transcript command is a pretty easy way for everyone.)

4 Likes