# Name choice error

**URL:** <https://forum.choiceofgames.com/t/name-choice-error/38714>\
**Category:** ChoiceScript Help\
**Created:** [May 10, 2018, 4:30pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714 "2018-05-10T16:30:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 4:30pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/1 "2018-05-10T16:30:56Z")

</div>

I’m having trouble with the character being able to choose their name.

This is what i have written there:

```
*label name
*choice
 #Jacob
 #John
 #Jonathan
 #Jack
 #Henry
*input_text name
 #Wait, these are not my names
 
  Your name is ${name}, is that right?
*choice
 #Yes
 #Wait, no it's not.
*goto name

```

My error looks like this:  
startup line 34: Expected choice body

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [May 10, 2018, 4:35pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/2 "2018-05-10T16:35:22Z")

</div>

```
*choice
   #Jacob
      *set name "Jacob"

```

Repeat this kind of structure for every options

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 4:38pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/3 "2018-05-10T16:38:03Z")

</div>

But i want the character to write their name down and select it, if you know what i mean.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [May 10, 2018, 4:39pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/4 "2018-05-10T16:39:43Z")

</div>

Well, if you want to give the player a “create my own name,” you just need to add a separate option

```
   #I want my own name
      *input_text name

```

---

<div class="post-metadata">

**Author:** ![lunawisp](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lunawisp/32/85423_2.png) [@lunawisp](https://forum.choiceofgames.com/u/lunawisp)\
**Post date:** [May 10, 2018, 4:41pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/5 "2018-05-10T16:41:46Z")

</div>

Then you don’t need the choice statement. Just print something to tell the player what they’re doing and follow it with the input statement.

Enter name:  
\*input\_text name

The choice statement prints a list of options, each of which has to be followed by some text or an instruction.

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 4:49pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/6 "2018-05-10T16:49:07Z")

</div>

#Wait, these are not my names  
\*input\_text name  
Works.

**Doesn’t work**  
\*goto is  
\*label is  
Your name is ${name}, is that right?  
\*choice  
#Yes  
#Wait, no it’s not.  
\*goto name  
Error: Expected choice body.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [May 10, 2018, 4:51pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/7 "2018-05-10T16:51:49Z")

</div>

Just like the previous one, you need some rando-bunch of text below the option

```
#option
   rando-bunch of text

```

* * *

CScript doesn’t like “empty” choices.

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 4:53pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/8 "2018-05-10T16:53:28Z")

</div>

But it wants a choice after i put in \*goto name … Why?

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [May 10, 2018, 4:55pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/9 "2018-05-10T16:55:07Z")

</div>

Because you put it back into the choice.  
It doesn’t really matter, IMO. The player can always pick the “create my name” option again.

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 5:03pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/10 "2018-05-10T17:03:15Z")

</div>

```
Ok, and what is that?
*create name "Jacob"
*create name "John"
*create name "Jonathan"
*create name "Jack"
*create name "Henry"

```

(This is at the beginning of startup)

```
These are the choices:
#Jacob
  *set name Jacob
 #John
  *set name John
 #Jonathan
  *set name Jonathan
 #Jack
  *set name Jack
 #Henry
  *set name Henry

```

And this is the error:  
startup line 35: Non-existent variable ‘jacob’

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [May 10, 2018, 5:05pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/11 "2018-05-10T17:05:07Z")

</div>

You can click the preformatted text button to put your code into, so we can see if there are any issues with spacing.

It’s the button that looks like this:

```
</>

```

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [May 10, 2018, 5:10pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/12 "2018-05-10T17:10:28Z")

</div>

Ok yeah, you only need to create the `name` variable one time like this:

`*create name ""`

You can also put in a stand-in name just for now:

`*create name "Default"`

Because it will change when you set the name.  
When you change a variable that you created with quotations, like the name variable, whatever you set it to also has to be in quotations. So, you’ll want to do…

```
*set name "Jacob"

```

And so on…

Because if you have `*set name Jacob` without quotes that means it’s trying to look for a variable called `Jacob`

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 5:12pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/13 "2018-05-10T17:12:51Z")

</div>

Version for idiots, please.

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 5:19pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/14 "2018-05-10T17:19:32Z")

</div>

I mean, i already did that, i did `*create name "Jacob"` and then in the choice `*set name Jacob` So why is it telling me that the variable doesn’t exist?

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [May 10, 2018, 5:23pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/15 "2018-05-10T17:23:01Z")

</div>

> [@YeThatFella](#):
>
> I mean, i already did that, i did `*create name "Jacob"` and then in the choice `*set name Jacob` So why is it telling me that the variable doesn’t exist?

Because `Jacob` is a variable and `"Jacob"` is a string.

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 5:25pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/16 "2018-05-10T17:25:25Z")

</div>

And how do i fix that? Like i said, version for idiots, please.

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [May 10, 2018, 5:26pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/17 "2018-05-10T17:26:35Z")

</div>

Whenever you do `*set name`  
You need to have quotes around the name, like `*set name "Jacob"`

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [May 10, 2018, 5:33pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/18 "2018-05-10T17:33:35Z")

</div>

> [@YeThatFella](#):
>
> \*label name  
> \*choice  
> #Jacob  
> #John  
> #Jonathan  
> #Jack  
> #Henry  
> \*input\_text name  
> #Wait, these are not my names
> 
> Your name is ${name}, is that right?  
> \*choice  
> #Yes  
> #Wait, no it’s not.  
> \*goto name

```choicescript
*label name
*choice
   #Jacob
      *set name "Jacob"
      *goto is
   #John
      *set name "John"
      *goto is
   #Jonathan
      *set name "Jonathan"
      *goto is
   #Jack
      *set name "Jack"
      *goto is
   #Henry
      *set name "Henry"
      *goto is
   #Wait, these are not my names
      *goto name_input

*label name_input
Then what's your name?
*input_text name
*goto is

*label is
Your name is ${name}, is that right?
*choice
   #Yes
      *goto next
   #Wait, no it’s not.
      *goto name_input

```

There you go

---

<div class="post-metadata">

**Author:** ![YeThatFella](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/yethatfella/32/56742_2.png) [@YeThatFella](https://forum.choiceofgames.com/u/YeThatFella)\
**Post date:** [May 10, 2018, 5:36pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/19 "2018-05-10T17:36:54Z")

</div>

Since when did gods exist?

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [May 10, 2018, 5:40pm UTC](https://forum.choiceofgames.com/t/name-choice-error/38714/20 "2018-05-10T17:40:36Z")

</div>

I could show you how to make a name-check subroutine scene and put it in there if you like?

[Next page](https://forum.choiceofgames.com/t/name-choice-error/38714.md?page=2)
