Hiding name in stats page until chosen by player


#1

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

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}

#3

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.


#4

I am late for the answer.

But happy anniversary!
:cake:


#5

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}


#6

first_name or firstname?


#7

^I just copied and pasted the error


#8

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?


#9

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


#10

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

Curious it’s not showing the dollar sign.

$!{first_name}


#11

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


#12

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: ’ )


#13

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

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

#14

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