Imputing name error


#1

Basically, I am trying to make a game and decided to let the player decide their name. My problem is: startup line 93: Invalid expression, couldn’t extract another token:

*label name

-Normal text- ( it’s too big)

*input_text name.
*finish

I’ve looked and that (*input_text name.) seems to be right code. Hopefully I’m not just being dumb.

If it matters, I also did

*create name “Unknown” and *set full_name "!{name} !{lastname}"
I don’t think it does, but just in case.


#2

*create name “unknown”
*create last_name “unknown”

*input_text name
*input_text last_name

Display on stat screen:
Name: {name} {last_name}

If this is not working for you, check whether something else may be the problem. Are all of your quotes and other punctuation in plain text, or is there a non-curly version you haven’t realized is missing? Does the “name” variable only set if it was previously “Unknown”, and the actual string is “unknown” without a capital? Punctuation and capitalization can easily throw off something that should otherwise work.

p.s. - You have a period after “name”. Is that actually in your code, or was that a typo? If so, extra punctuation and typos in the code can cause this sort of problem.


#3

Everything else was already done.
The dot was exactly the problem.
Yet, I faced another one. The text that you input doesn’t change your name!


#4

It does when I try to use that command. Could you copy over your exact code for setting a name? You can highlight it and use the </> button to preserve the right formatting.


#5
*create name "Unknown"
*create lastname "Unknown"
*create lastname "Unknown"*set full_name "$!{name} $!{lastname}"
....
*goto name

*label name
It was quite obvious, you already knew that it was the first letter of your name. It could only mean...

*input_text name
*finish

All of that is in the startup page.
Here is in the other one:

Name: $!{full_name}
*line_break

#6

Are these on different lines in your code? Because they need to be.

I am so bad at concatenation (adding two strings to be one string), but looking it up, it looks like it’s formatted wrong. Here is the right way to do it, from the Wiki:


#7

Thanks for your help! Without it , I wouldn’t even be able to actually fix the text input.

Anyway, I managed to solve another way. I just took out the fullname thing, like everything with fullname.
Instead of using the Name: !{full_name} I used {name} ${lastname}

Now it works! I even added a last name one. Thanks a lot! You’re the best!


#8

Yeah, watch having punctuation in things where it shouldn’t be, capitals too, and that all quote marks are the straight ones like "

I know I’m a little too late but I wrote a tutorial on some of these basics. A Basic Tutorial on Name, Relationship and Gender Variables

Also the wiki’s generally useful. choicescriptdev.wikia.com

And @Reaperoa’s created a guide. The Beginners Guide to ChoiceScript