That’s bad news for this project, I think, since hyperlinks (I’m using Bisquixe for this) are also doing their own thing with the keyboard.
Is there a reasonable way to get something like this going?
check ID_restarting:
say "Restarting the game will not delete any metagame progress. Do you wish to continue?
";
hyperlink "yes" as "yes";
say " or ";
hyperlink "no" as "no";
follow the restart confirmation rule;
this is the restart confirmation rule:
if the player consents:
follow the immediately restart the VM rule;
otherwise:
say "Mission resumed.";
say line break;
I’m not sure how you’d do this with older versions of Inform, but I do want to let you know that when Inform 11 gets released (hopefully very soon now) this will be basically built in.
In the collab game I worked on for Parser Comp (which does not use Bisquixe), he wanted me to edit the yes/no prompt to add more variations of what is accepted. I had to chop really deeply into the inform code to get it to work; yes/no prompts are very very low-level Inform architecture.
For anything at all involving changing the ‘player consents’ format, I’d recommend a ‘fake’ yes/no prompt with something like:
(this isn’t tested or real code) :
To go answertime:
now the command prompt is "yes/no ?>";
After reading a command when the command prompt is "yes/no ?>":
if the player's command matches 'yes/y/etc.":
do the yes thing;
now the command prompt is ">";
if the player's command matches "no/n/etc.":
do the no thing;
now the command prompt is ">";
otherwise:
say "You have to answer yes or no."
If we look at what the If The Player Consents mechanism does:
Takes a yes or no response, accepting both Y and YES, N and NO
Waits until it gets one.
The result can be analysed with the phrase ‘if the player consents’
That’s not very special stuff. You can replace it entirely with your own code – like your skeleton code – which takes a YES or NO somehow, then reacts, thus dispensing with the phrase ‘if the player consents’. Once you’re not using the mechanism, the command or input can (presumably?) go via the normal command pipeline, or not have to.
I guess you’ve got Bisquixe as an extra layer of complexity. Maybe I’d need more info about specific hurdles to say more.
PS My aborted CYOA extension is doing what I described above. e.g. in my Cloak of Darkness (two modes) demo, it has hyperlinks. Start in choice mode, press M for menu, click 9 Quit Cloak of Darkness, then it gives YES or NO hyperlinks to confirm, avoiding ‘if the player consents’. (I know you’ve seen this file before, I’ll just reattach here for convenience)
I was hoping to stick with the built-in prompt just to avoid spinning out custom actions or dipping into reading a command (there are several more cases in the project), but it sounds like that’s infeasible! Thanks everyone for the suggestions.
I decided to go with after reading a command rules. I’m marking this solved!
carry out id_restoring:
say "It has been [restore timer] turns since you last updated your case notes. Do you wish to review them once more?
";
ask the autorestore question;
now the command prompt is " ";
now id_restore is true;
after reading a command when id_restore is true:
let p be the player's command in lower case;
if p is "yes" or p is "y":
autorestore the game;
say "An error occurred restoring your game. Apologies! Please let the author know.";
now the command prompt is "[root-actions]>";
now id_restore is false;
reject the player's command;
if p is "no" or p is "n":
say "Carry on, officer.";
now id_restore is false;
now the command prompt is "[root-actions]>";
reject the player's command;
otherwise:
ask the autorestore question;
reject the player's command;
to ask the autorestore question:
say "Answer the question, officer: ";
hyperlink "yes" as "yes";
say " or ";
hyperlink "no" as "no";
say ".";