# Choicescript code error help!

**URL:** <https://forum.choiceofgames.com/t/choicescript-code-error-help/35245>\
**Category:** ChoiceScript Help\
**Created:** [February 11, 2018, 2:58am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245 "2018-02-11T02:58:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vessynessy20](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vessynessy20](https://forum.choiceofgames.com/u/vessynessy20)\
**Post date:** [February 11, 2018, 2:58am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/1 "2018-02-11T02:58:26Z")

</div>

I keep getting an error on line 8 and I need help please! No matter what I do it keeps telling me I need a goto or a finish, but I DO have a goto and it doesn’t even work. This is frustrating!

```
Out in the hall, you ponder where to go next.

*label hallway

*choice
  #Enter Commander Sorbel's quarters
    You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
    #"No thanks."
    *goto hallway
  #Enter Almaran's quarters
    You go into Almaran's quarters and find him in his armor, checking his blades. He looks up at you and smiles. "What?"
    #"Nothing."
    *goto hallway
#Go to the hangar.
  *goto hangar_choice

*page_break

*label hangar_choice
*choice
  #Get in a ship and fly to Earth.
    *goto_scene yfn3-1

```

---

<div class="post-metadata">

**Author:** ![Retrovirus](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retrovirus/32/43354_2.png) [@Retrovirus](https://forum.choiceofgames.com/u/Retrovirus)\
**Post date:** [February 11, 2018, 3:06am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/2 "2018-02-11T03:06:04Z")

</div>

What you have on line 8 is #“No thanks.” Is this meant to be part of another choice? You can’t have a # thing floating without a \*choice or \*fake\_choice command above it.

If I’m understanding correctly, the MC replies “No thanks” to Commander Sorbel, so I would code it like this:

```
*choice
 #Enter Commander Sorbel's quarters
  You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
  
  "No thanks."
  *goto hallway

```

Because what’s happening is that it’s not recognising the floating # you have so doesn’t understand that \*goto hallway command is part of the first choice.

Edit: if your intention is to let the player have a second set of choices with the “No thanks” part, you could do something like:

```
*choice
 #Enter Commander Sorbel's quarters
  You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
  
  *choice
   #"No thanks."
    *goto hallway
   #"Of course."
     *goto join_sorbel

```

and so on. Additionally, I don’t think your #Go to the hangar choice is indented the same as the others.

---

<div class="post-metadata">

**Author:** ![nuclearpolymer](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nuclearpolymer/32/199589_2.png) [@nuclearpolymer](https://forum.choiceofgames.com/u/nuclearpolymer)\
**Post date:** [February 11, 2018, 3:10am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/3 "2018-02-11T03:10:04Z")

</div>

I wonder if the indentation is messing you up. What I means is “\*goto hallway” needs to be indented further than #“No thanks.” I can’t tell if your file is literally like what shows in the post or not. (Also, “#Go to the hangar.” need to be indented.

Also, if you are trying to do choices imbedded inside other choices, there has to be another “\*choice” on the second level. What I mean is that if you have a choice after “Would you like to join me?”, you need to say “\*choice” there.

Anyhow, if I were you, I would try to write a simple single level choice first, get that working, then add the second level…I find that by writing a bit first, getting that working, then making it more complex, it’s easier to fix the errors. Good luck!

---

<div class="post-metadata">

**Author:** ![vessynessy20](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vessynessy20](https://forum.choiceofgames.com/u/vessynessy20)\
**Post date:** [February 11, 2018, 3:47am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/4 "2018-02-11T03:47:48Z")

</div>

Hi, I just got this today and started making a CYOA game, and I’ve gotten the hang of most of the basics, I guess, but I’m stuck now at a part that’s frustrating me because I just cannot make it work!

It keeps telling me this, no matter what I do! “yfn2-3 line 8: It is illegal to fall out of a \*choice statement; you must \*goto or \*finish before the end of the indented block.”

```
Out in the hall, you ponder where to go next.

*label hallway

*choice
  #Enter Commander Sorbel's quarters
    You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
    #"No thanks."
    *goto hallway
  #Enter Almaran's quarters
    You go into Almaran's quarters and find him in his armor, checking his blades. He looks up at you and smiles. "What?"
    #"Nothing."
    *goto hallway
#Go to the hangar.
  *goto hangar_choice

*page_break

*label hangar_choice
*choice
  #Get in a ship and fly to Earth.
    *goto_scene yfn3-1

```

Please can someone help me figure out what’s wrong, of it’s just broken? I don’t get why it’s telling me to put a goto or a finish command when I clearly have one! And why won’t THOSE work, and jump back up to the hallway like it’s supposed to? That’s how the tutorial said they work, right?

---

<div class="post-metadata">

**Author:** ![Lucid](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lucid/32/39775_2.png) [@Lucid](https://forum.choiceofgames.com/u/Lucid)\
**Post date:** [February 11, 2018, 3:02am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/5 "2018-02-11T03:02:45Z")

</div>

```
[quote="vessynessy20, post:1, topic:35244"]
Out in the hall, you ponder where to go next.

*label hallway

*choice
  #Enter Commander Sorbel's quarters
    You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
    *goto SOMEWHERE
  #"No thanks."
    *goto hallway
  #Enter Almaran's quarters
    You go into Almaran's quarters and find him in his armor, checking his blades. He looks up at you and smiles. "What?"
    *goto SOMEWHERE
  #"Nothing."
    *goto hallway
  #Go to the hangar.
    *goto hangar_choice

[/quote]

```

Some funny spacing and 2 missing \*gotos, I think. 🙂

---

<div class="post-metadata">

**Author:** ![Lucid](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lucid/32/39775_2.png) [@Lucid](https://forum.choiceofgames.com/u/Lucid)\
**Post date:** [February 11, 2018, 3:08am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/6 "2018-02-11T03:08:42Z")

</div>

With those spaces, you might have been trying for some nested choices, like this?

```
[quote="Lucid, post:2, topic:35244"]
*label hallway

*choice
  #Enter Commander Sorbel's quarters
    You enter the commander's quarters, and find them relaxing. "Would you like to join me?"
    *choice
        #"No thanks."
            *goto hallway
        #”Sure.”
            *goto SOMEWHERE
  #Enter Almaran's quarters
    You go into Almaran's quarters and find him in his armor, checking his blades. He looks up at you and smiles. "What?"
    *choice
         #"Nothing."
            *goto hallway
         #Somehing else
            *goto SOMEWHERE
  #Go to the hangar.
    *goto hangar_choice
[/quote]

```

---

<div class="post-metadata">

**Author:** ![vessynessy20](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vessynessy20](https://forum.choiceofgames.com/u/vessynessy20)\
**Post date:** [February 11, 2018, 4:00am UTC](https://forum.choiceofgames.com/t/choicescript-code-error-help/35245/7 "2018-02-11T04:00:42Z")

</div>

Thanks! I got it figured out yeah, I needed to add a second \*choice inside the first \*choice. 🙂
