I7: Storing user input as a constant?

Okay, I’m stupid.

How the hell do you store a user inputed string? With a result along the lines of:

[b]What's your name?
>[i]Mike[/i]

Hi, Mike![/b]

The example “Identity Theft” in the Recipe Book explains how to do it. (I’d link to the HTML version of it, but the HTML version of the manuals doesn’t seem to be online or linked to properly at the moment.)

Thanks

I also used the same basic scheme as Identity Theft, but I’d like to take it one tiny step further. I’d like some way to make the parser understand that the player’s chosen name refers to the player object.


[b]What’s your name?

Mike

Hi, Mike! What would you like to do?

examine Mike

You’re looking great today! [/b]

Starting from the Identity Theft example, I tried using “understand”, adding this line of code:

 Understand "[player's forename]" as yourself. 

Running the modified Identity Theft results in this error message:

I’d appreciate some help figuring out what I did wrong / how to do it right.

Took another shot at this by trying to hijack the player’s command.

After reading a command: if the player's command matches substituted form of "[player's forename]": replace the matched text with "yourself".

Not using “substituted form of” gave the same error as above.

With “substituted form of” I get:

I will submit a bug report. Adding this extra info here as well in case it helps with my original question.

Instead of storing the input in the variable “The player’s forename,” you could store it in a property of the player, and then use the mechanism for understanding properties. See the example here. (Of course you should still file a bug report about that internal error.)

I promise I searched before posting :blush:

Thanks! :smiley:

Ha ha, no problem, it’s one of those “You don’t know what to search for unless you know what the post says” deals.