I wanted to make a simple change to the “can’t undo” message to make it more user-friendly and relevant to my game, e.g. “This is pretty much a 1-move, 1-room game with a random solution. Undoing would sort of break it.”
However, I wasn’t able to find a way to do so without using an extension. And I want to avoid that, if possible.
[code]“easy-undoes-it” by Andrew
use undo prevention.
room 1 is a room.
[test with l.undo]
[/code]
This would do the job, and the following does what I want, too, just not succinctly.
"easy-undoes-it" by Andrew
include Conditional Undo by Jesse McGrew.
room 1 is a room.
Rule for deciding whether to allow undo:
say "It wouldn't be fair to allow undoing here, since you're only supposed to get one guess at the right answer.";
decide yes;
This is more than adequate, but I’d rather not include an extension if I don’t have to.
I’ve also tried the following, but it ignores my new verb, and I’m not sure why.
[code]room 1 is a room.
undoing is an action out of world. understand the command “undo” as something new. understand “undo” as undoing.
carry out undoing:
say “It wouldn’t be fair to allow undoing here, since you’re only supposed to get one guess at the right answer.”
[/code]
Also the rather cheap looking
after reading a command:
if player's command includes "undo":
say "Oops, different undo message.";
reject the player's command;
…doesn’t work.
Is there any way I can do things without an extension or is UNDO too ingrained in the Inform core to do anything? Nothing popped up when I tried to RULES before UNDO, either.
This is more general wondering than an actual brick wall, so, thanks again for any suggestions!