Gender line 15: Non-existent variable 'name'

Hello, i don’t understand what’s wrong with my code.
I read all the help related comments but there is nothing i can do to fix it

Select your gender.
*choice
#Male
*goto male
#Female
*goto female

*label male
Welcome, stranger. In this adventure, you’re playing a young man named…
*input_text name
*finish

*label female
Welcome, stranger. In this adventure, you’re playing a young woman named…
*input_text name
*finish

It keeps saying : "
gender line 11: increasing indent not allowed, expected 0 was 2 "

Why is that?
Help pls!

It would be helpful, If you could Post the code snippet as Code ( perfomated Text). So we can see the indents and find the bug

You need to put your code between ``` so it can keep the format as Kaelyn said.
If that’s all your code, and I assume you’re using a 2 spaces indent, it should look like this:

Select your gender.
*choice
  #Male
    *goto male
  #Female
    *goto female

*label male
Welcome, stranger. In this adventure, you’re playing a young man named…
*input_text name
*finish

*label female
Welcome, stranger. In this adventure, you’re playing a young woman named…
*input_text name
*finish

Now it tells me “gender line 15: Non-existent variable ‘name’”
I don’t know what’s going on

yes, exactly.

I didn’t 'know that

For any variable (like ‘name’ in your example), you need to create it somewhere before you can use it.
In your startup.txt you’ll want to have a line like

*create name “”

That creates your variable, so your *input_text will now know about the variable called ‘name’.
There’s some more info on variables on this wiki here, that might help you out. :slight_smile:

EDIT: in your startup.txt, not choicescript_stats.txt. Thanks to @Havenstone for correcting me on that!

1 Like

Better in startup.txt – that’s where to *create all your stats.

1 Like

I keep getting this. I can’t move forward to the scenes I labeled…
I tried to create temp* commands at the very top of the scene file but it doesn’t works.

I just want the labeled scenes to appear…

Thank you so much, now it woks

Sounds like you’re still getting used to the fundamentals. Go through the tutorial again and solidify your understanding that way.

2 Likes