Input Player Name [Resolved]

I’m having difficulty with the input_text function. It’s the beginning of the game, so I’m doing the typical ChoiceGames thing and having the player input the character’s name. When I test it, everything goes fine until I click “Next” after typing in a name.

(Another note: I’ve added the name to the stats screen, and when I check it after the error comes up, the name’s in place)

So…what gives?

Can you paste in the relevant code?


You’re going to have to explain what the error you’re getting is.

The error I’m getting is: startup line 95: Invalid expression, couldn't extract another token: “$!{player_name}”

The beginning variables are coded like this:

*create player_name 0
*create Leadership 50
*create Intimidation 50
*create Reputation 60
*create Charisma 50
*create Survival 50
*create Martial 60
*create DogSaved false

and the input is coded like this:

Type your name here
*input_text player_name
*set player_name “$!{player_name}”

The error doesn’t show up until I actually type something in.

1 Like

I’m not positive, but perhaps it’s because you created player_name as a numeric variable but you actually want it to be a string? Try:

*create player_name ""

and see if that helps perhaps?

EDIT: Oh I lied! It’s because you’re using curly inverted commas—you want ‘straight quotes’, not ‘smart quotes’.


Not this:


I suspect both the curly punctuation and creating player_name as a numeric variable are the problems.

Good catch on the curly inverted commas, @Fiogan! I would not have thought of that.

1 Like

Oh…TextEdit automatically turns straight quotes into curly quotes. Do you know how to fix that?

Try checking under edit/substitutions/ in the menu and make sure ‘smart quotes’ is not checked. That should do it, I think.

1 Like

Ah, that fixed it - thanks!