How do you add a name?


#1

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.


#2

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?


#3

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.


#4

What is the error message?


#5

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


#6

${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


#7

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


#8

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


#9

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


#10

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


#11

That was the problem, thank you for the help!


#12

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