I feel like this should be super simple, but I can’t make it work to save my life.
It’s a simple case of finding a password, and telling someone the right password in order to advance.
PasswordSeed is a number that varies.
Password is a text that varies.
When play begins:
now PasswordSeed is a random number between 1 and 30;
if PasswordSeed is 1, now Password is "AMERICANO";
if PasswordSeed is 2, now Password is "BARCAROLA";
if PasswordSeed is 3, now Password is "SERENISSIMA";
if PasswordSeed is 4, now Password is "DOGE";
And so on. The game is correctly selecting a new random password with each playthrough. The problem is it doesn’t work when I ask the player to provide that password:
After reading a command when the guard is engaged:
if the player's command is "[Password]":
now the meetingplace is discovered;
move meetingplace to Street;
say "The man nods and points somewhere to the south-east.";
now the command prompt is ">";
now the guard is unengaged;
otherwise:
say "The man didn't understand that. Try again.";
now the command prompt is ">";
now the guard is unengaged.
This isn’t worknig. It’s very irksome because it DOES work if I try it with a static word ("if the player’s command is “XYZZY”) but when it’s a variable, it just doesn’t recognize it as correct.
I know the problem is with the variable because if instead of "player’s command IS “password” I use "player’s command INCLUDES “password”, then it doesn’t even compile:
Problem. I was unable to understand what you meant by the grammar token 'Password' in the sentence 'if the player's command includes "[Password]"' .
You DO understand what that grammar token is, Inform, because you’re printing it on demand.
Why is it a problem understanding it when it’s the player who inputs it?
Should I just give up and have the password be one static word, always the same?