accessing is an action applying to nothing. understand “[the pass_code]” as accessing.[/code]
this is the error
[code]This is the report produced by Inform 7 (build 6G60) on its most recent run through:
Problem. I was unable to understand what you meant by the grammar token ‘the pass_code’ in the sentence ‘understand “[the pass_code]” as accessing’ .
[/code]
You can’t turn any variable into a grammar token. Grammar tokens stand in for kinds. The kind of the pass_code variable is text. So you want something like this:
[code]A pass_code is a text that varies.
Accessing is an action applying to one topic.
Understand “[text]” as accessing.[/code]
Note that the action does apply to something, viz. the text that the text token holds a place for.
I suppose you’d also better put some condition on the understand clause (like »Understand “[text]” as accessing while in the Entrance to the Secret Vault.»), or the accessing rules will fire as soon as a player misspells a verb—possibly long before he/she knows there is anything in the game to access by a password.
You could make the condition be when the command actually matches the code. Unfortunately I was not able to find a concise way to do this. This is the best I’ve got:
The pass_code is a text that varies. The pass_code is "xyzzy".
Accessing is an action applying to one topic.
Understand "[text]" as accessing when command matches code.
To decide whether command matches code:
let T be an indexed text;
now T is the player's command;
if T is the pass_code:
decide yes.
If the code words are fixed, you could just make them into things:
A pass-code is a kind of thing. Xyzzy is a pass-code. Frotz is a pass-code.
Accessing is an action applying to one visible thing.
Understand "[any pass-code]" as accessing.
If you want to be able to change the pass-codes at runtime (say, by letting the player enter a new code), then you can work around the problem by giving your pass-codes a variable name, like this:
The special code is a privately-named pass-code.
The special code has some indexed text called the code-word.
The code-word of the special code is "plugh".
Understand the code-word property as describing the special code.