Replacing a final question

I would like my game to ask you whether you want to start a new game, rather than whether you want to restart a game. (You’ll agree, this is more logical for Kerkerkruip.) So I’ve written this code:

When play begins: choose row with a final response rule of immediately restart the VM rule in the Table of Final Question Options; now topic entry is "new"; now final question wording entry is "start a NEW game".
Which works, except for one tiny detail: the new topic “new” is apparently not understood by the parser. The old “restart” no longer works, but the new “new” doesn’t work either, so the player can’t start a new game. What’s going wrong here?

I’d guess that the compiler does something fancy to add the topics to the dictionary which you can’t do at runtime. Wouldn’t the most straightforward solution be to simply replace the whole table?

A combination of known bugs. Inform doesn’t know that you mean “new” to be a topic, and so is putting a text in a topic column, which leads to trouble. To workaround it, you have to write the “new” in a context where Inform will interpret it as a topic:[code]Table of Literal Topics
text topic
“new” “new”

When play begins:
choose a row with a text of “new” in the Table of Literal Topics;
let new be the topic entry;
choose a row with a final response rule of immediately restart the VM rule in the Table of Final Question Options;
now the topic entry is new;
now final question wording entry is “start a NEW game”.[/code]

Edit: Or replace the table like Dannii said.

Thanks!

If you don’t want to replace the whole table, you can also blank out the old row and add the row you want:

[code]When play begins:
choose row with a final response rule of immediately restart the VM rule in the Table of Final Question Options;
blank out the whole row.

Table of Final Question Options (continued)
final question wording only if victorious topic final response rule final response activity
“start a NEW game” false “NEW” immediately restart the VM rule --[/code]

This has the disadvantage that “NEW” appears last in the final question options.

It would be lot easier to manipulate if the topic column was changed so that it holds text rather than topics. Consider this.

[spoiler][code]“Test”

Section 1 - Improved Final question (in place of Section SR3/2 - Final Question in Standard Rules by Graham Nelson)

This is the print the final question rule:
let named options count be 0;
repeat through the Table of Final Question Options:
if the only if victorious entry is false or the story has ended finally:
if there is a final response rule entry or the final response activity entry [activity] is not empty:
if there is a final question wording entry, increase named options count by 1;
if the named options count is less than 1, abide by the immediately quit rule;
say "Would you like to ";
repeat through the Table of Final Question Options:
if the only if victorious entry is false or the story has ended finally:
if there is a final response rule entry or the final response activity entry [activity] is not empty:
if there is a final question wording entry:
say final question wording entry;
decrease named options count by 1;
if the named options count is 0:
say “?[line break]”;
otherwise if the named options count is 1:
if the serial comma option is active, say “,”;
say " or ";
otherwise:
say ", ";

This is the standard respond to final question rule:
repeat through the Table of Final Question Options:
if the only if victorious entry is false or the story has ended finally:
if there is a final response rule entry or the final response activity entry [activity] is not empty:
if the player’s command matches the text command entry:
if there is a final response rule entry, abide by final response rule entry;
otherwise carry out the final response activity entry activity;
rule succeeds;
issue miscellaneous library message number 8.

Section 1 - Improved Final question options (in place of Section SR3/3 - Final question options in Standard Rules by Graham Nelson)

Table of Final Question Options
final question wording only if victorious command final response rule final response activity
“RESTART” false “restart” immediately restart the VM rule –
“RESTORE a saved game” false “restore” immediately restore saved game rule –
“see some suggestions for AMUSING things to do” true “amusing” – amusing a victorious player
“QUIT” false “quit” immediately quit rule –
“UNDO the last command” false “undo” immediately undo rule –

Section 2 - Game Code

When play begins:
choose row with a final response rule of immediately restart the VM rule in the Table of Final Question Options;
now command entry is “new”;
now final question wording entry is “start a NEW game”.

The block saying yes rule is not listed in the check saying yes rulebook.
The block saying no rule is not listed in the check saying no rulebook.

Carry out saying yes (this is the say yes rule):
end the story finally saying “You won!”.

Carry out saying no (this is the say no rule):
end the story saying “You lost!”.

The Testing Room is A Room.[/code][/spoiler]

A few tweaks to the standard rules and VictorGijsbers’s original code works perfectly.