Hello all
In 2014 I was doing some highly experimental stuff with Inform 7, and was able to get it to do some pretty crazy things. I decided to put it away for a little bit, and that little bit turned into a few years.
Upon loading my old code and extensions… it seems the language has changed somewhat and my code is now broken
In my story I have a character who only speaks and understands Japanese, and the hero of our story only understands English. The idea is that when you chat with the other character, you must write in Japanese for her to understand anything. Any command not invoked by calling her name first, goes though the parser correctly.
[code]>Take the pen
Taken.
Kaori, hon o totte kudasai.
かおり、本を取って下さい。
Kaori takes the book.[/code]
Now before anyone side-eyes and thinks this seems an impossible task… it was working and the Japanese parser had 56 verbs it could understand.
The parser works like this; I have an override after reading a command. It would take the player’s command and check to see if a Japanese speaker was being called to. If it was, then it would break apart the player’s command (Which was assumed to be in Japanese) and then put it back together in English and pass the result to Inform’s parser.
Sadly, it now seems that monkeying with the player’s command causes it to be deleted. I have the fist part of the parser below with some debug lines in there.
A Japanese name is some indexed text that varies.
An english name is some indexed text that varies.
Japanese output is some indexed text that varies.
Table 1.0 - Names
ename (indexed text) jname (indexed text)
"kaori," "香"
[Block Inform's parser. Start the Japanese parser]
after reading a command:
say "The player's command -> [the player's command][line break]";
[Clear variables used in the parser and sanitize]
Now Japanese output is "";
Let the player's command be the player's command in lower case;
say "The player's command -> [the player's command][line break]";
now the english name is the unpunctuated word number 1 in player's command;
if there is no jname corresponding to ename of english name in the table of names:
[if kaori's name isn't said, kick the input back to Inform's parser]
change the text of the player's command to player's command;
otherwise:
[Japanese parser goes here]
That should be enough that you can see at least the first part function.
However, it seems the command “Let the player’s command be the player’s command in lower case;” obliterates the players command and nothing is returned to the normal parser.
>take pen
The player's command -> take pen
The player's command ->
I didn't understand that sentence.
Can you alter the player’s command anymore? That would make me sad if that’s true.