How do you add a name?

I’m very new at coding and I’m starting to have some trouble giving the reader a name despite reading the Introduction to Choice Script. What I’m doing is, on the startup.txt, I am typing *create name “unknown” (I am trying to have their name be unknown until they get the option to change it…which I obviously don’t know how to do, but I figured I’d learn this first)

Then on the stats.txt, I type,

text name

I have also tried to type, text name “unknown” on the stats.txt, but both result in it telling me,

Invalid expression, couldn’t extract another token: “unknown"

I’m not entirely sure what I’m doing wrong, even though I’m positive it is an obvious mistake that I should have easily figured out myself. Still, I’d appreciate if you can help a newcomer with this problem.

To display stats you need to use a

*stat_chart

command first. Have you used that before typing text name? And if so, has it been indented properly?

1 Like

I did put it before, I actually have a few percentages that are working fine. I indented the text name the same amount of spaces as the other percentages and the same error keeps appearing.

What is the error message?

If you want to just display the name, putting ${name} will work

1 Like

${name} works too.

I have a very simple name tutorial

Also try

The wiki

@RETowers has a tutorial covering all of choicescript

As does @Lglasser

Invalid expression, couldn’t extract another token: “unknown"

You only need text name for that one. You don’t need the “unknown” in the stats screen.

I only add “unknown” to the startup.txt and the same error occurs.

Check your quote marks. In two of those examples you’ve posted you have curly quotes. “ You don’t want those, you want “”.

That was the problem, thank you for the help!

I figured out the problem, but I still really appreciate you helping me out! Thanks!