Hiding name in stats page until chosen by player

I’ve been looking for more info on temporary stats, but can’t find much to teach myself how to temporarily hide the PC’s name. With no name inputted, I just get the choicescript_stats line 3: Non-existent variable ‘full_name’

Sorry if this might be a simple problem to fix, I’m new to choicescript

Thanks in advance for the help!

2 Likes

Sounds more like you either have a typo or forgot a create (or something at the create)

The easiest way to hide a name, if i understand you correctly would be

*create name ""
*create firstname ""

And have it on the page as

Name: $!{firstname} $!{name}
5 Likes

Also bear in mind the variable needs to be written EXACTLY as it is in the “create” in the startup. This includes any capitals or dashes. (For example Full_Name is a different variable to full_name.) If MeltingPenguins’ suggestion doesn’t fix it (which I think it should), best option is to post your code for trouble shooting.

2 Likes

I am late for the answer.

But happy anniversary!
:cake:

2 Likes

happy anniversary from me too!

I changed what you said to use instead, and no I get this error when trying to open my stats page:

choicescript_stats line 3: Invalid expression, couldn’t extract another token: $!{first_name}

2 Likes

first_name or firstname?

1 Like

^I just copied and pasted the error

1 Like

I think it’ll be the best if you put all your codes here.

Can we see your codes both in the startup.txt and the choicescript_stats.txt?

1 Like

Haha, I have no idea what I’m doing, thanks for helping guys!

Stats page:

*stat_chart
text !{first_name} !{name}
percent Enchantment
percent Charm
percent Stealth
percent Wisdom
percent Daring
percent Perception
percent Athletics

Startup create:
*create first_name “”
*create name “”
*create Enchantment 5
*create Charm 5
*create Stealth 5
*create Wisdom 5
*create Daring 5
*create Perception 5
*create Athletics 5

It needs to be !{first_name} and !{name}

Curious it’s not showing the dollar sign.

$!{first_name}

1 Like

there are dollar signs in my code, and still there’s the error…

Oh, I see the error I think:

try this:

Name: $!{first_name} $!{name}

*stat_chart
   percent Enchantment
   percent Charm
   percent Stealth
   percent Wisdom
   percent Daring
   percent Perception
   percent Athletics

The way you had it it was looking for a variable to display there.

*text

is usually used to display plain numbers, like

*stat_chart
   text money Your money

(it will automatically display this as 'Your money: ’ )

3 Likes

Put the [first_name] and [name] outside the *stat_chart

Name: ${first_name} ${name}
*stat_chart
   etc.
1 Like

Thank you thank you! Yup, it was just that I had put the name in the wrong spot!

1 Like