That’s all working fine. A player can look up a note from a source with the language “[source] [number]”, so looking at note 1 from source cas would require player input “cas 1”.
Well, testers have asked for a way to also input it without the space, as in “cas1”.
After a day or so, I’ve determined that I can’t do it myself. Using the documentation, I can break up words to fix commands (“getall” to “get all”). I’m getting the number stuff wrong.
understand "cas[number]" as looking up a cas is no good.
Lots of things seem to work fine without the number. [number] seems to be the source of my problem. stuff like:
if the player's command matches "cas[number], try looking up a cas [number] and the like don’t work.
if the player's command matches "cas[number], replace the matched text with "cas [number]"
This does something:
After reading a command: if the player's command includes "[number]": say "you entered a number."; reject the player's command.
but this doesn’t:
After reading a command: if the player's command includes "[number]": say "you entered the number [number]."; reject the player's command.
Explicitly changing the command to a defined text, as in
After reading a command: let PC be "[the player's command]";
It seems to me that the big problem I’m having is getting a number (that might be treated as text) to behave like a number. The lack of spacing with a number seems to be part of the problem, too. phrases like “cas1” get dumped to parser errors (
That's not a verb I recognize) without trying to substitute/match parts of the command.
I see that documentation discusses regular expressions with regard to substitutions, but honestly I have no idea what I’m looking at.
How can I change the command “cas1” into “cas 1”? I feel I’m missing something obvious.