Once again I come to you with the ever-changing Test Game by C.E.J. Pacian. This time I want to ask the player to supply a number.
Based on the example Down in Oodville, I came up with the following:
[code]“Test Game” by “C.E.J. Pacian”
Someplace is a room.
Instead of jumping:
say “You carefully consider your jumping routine.”;
now the command prompt is "How many times do you want to jump? > ".
To decide whether hopping:
if the command prompt is "How many times do you want to jump? > ", yes;
no.
Understand “[number]” as selecting.
Selecting is an action applying to one number.
Carry out selecting:
say “You don’t need to supply a number right now.”
Instead of selecting when hopping:
say “You jump [the number understood] times.”;
now the command prompt is “>”.
Instead of doing something other than selecting when hopping:
say “Maybe not then.”;
now the command prompt is “>”.[/code]
This gives us the following:
That’s all fine apart from that last bit. Borrowing some code from here:
Rule for printing a parser error when the latest parser error is the didn't understand that number error (this is the Numbered Disambiguation Choices don't use number rule):
now the latest parser error is the didn't understand error;
make no decision.
We now get:
Which I guess kind of fixes the last command (although is there a reason it shouldn’t be a “not a verb I recognise error”? when does the “didn’t understand error” actually get triggered normally?) but now our attempt to jump “loads” is worse.
Is there some way to just read in the player’s command (as in Identity Theft, for example) and see if it’s a number?
NBx1: Why not just implement a new command like “jump [number] times”? In this simplified example, that might be the right answer. In my actual project, the command required would be lengthy and non-intuitive.
NBx2: I am still using 6G60 - however the main reason I was sticking with this old version was in a vain attempt to release for the Z machine, which my project has recently exceeded. I’m not super thrilled with dealing with the ten million syntax errors I expect to get based on my brief flirtation with 6L38 way back when it first came out, but I’ll bite the bullet if it’ll help.