# I can't find the error?

**URL:** <https://forum.choiceofgames.com/t/i-cant-find-the-error/2472>\
**Category:** ChoiceScript Help\
**Created:** [June 23, 2014, 4:29pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472 "2014-06-23T16:29:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 4:29pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/1 "2014-06-23T16:29:43Z")

</div>

Hello! I’m fairly new to choicescript and decided to make a test game. When I tried running it through quicktest i get this error:  
Error: ghost line 72: It is illegal to fall out of a \*choice statement; you must \*goto or \*finish before the end of the indented block.  
This should be the line it refers to:

#Problem line  
–some text  
----\*set var1 +5  
----\*page\_break  
----\*if (var1\>9)  
------\*goto end1  
----\*elseif (var1\<10)  
------\*goto badend

I tried tacking on a “\*finish” or a “\*goto\_scene ending” but it didn’t seem to work. Is there something really obvious I’ve missed? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![fantom](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fantom/32/8537_2.png) [@fantom](https://forum.choiceofgames.com/u/fantom)\
**Post date:** [June 23, 2014, 4:43pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/2 "2014-06-23T16:43:00Z")

</div>

@lenkaiscool I don’t suppose you could paste the actual \*choice in question?  
Be sure to wrap it in \< pre\> \< /pre\> tags, minus the spaces.

Edit. At a guess though, I’d say the issue is that you’re trying to insert a page break in the middle of a \*choice.

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 4:52pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/3 "2014-06-23T16:52:09Z")

</div>

Do’h! Sorry! ☹ It was just very long… Here it is:

```

*choice
  #choice 1
    some text
      *set var2 +5
    *page_break
    *if (var2>9)
      *goto end2
    *elseif (var2<10)
      *goto badend
  #This is the problem line!
    Some text
    *set var1 +5
    *page_break
    *if (var1>9)
      *goto end1
    *elseif (var1<10)
      *goto badend
  #choice 3
    some text again
    *set var3 +5
    *page_break
    *if (var3=15)
      *goto reallybadend
    *elseif (var3>=10)
      *goto end3
    *elseif (var3<10)
      *goto badend

```

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 4:53pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/4 "2014-06-23T16:53:26Z")

</div>

I don’t know why it does the   
 thing, it doesn’t look like that when I type it ☹

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 4:56pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/5 "2014-06-23T16:56:24Z")

</div>

The page breaks have worked in other choices though, and taking them out did nothing 😕

edit:  
The same error shows up even if I only do this:

```

*choice
  #choice 1 works perfectly fine for some reason, even though it's coded just like the other choices...
  #choice 2
    Some text
    *finish

```

---

<div class="post-metadata">

**Author:** ![fantom](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fantom/32/8537_2.png) [@fantom](https://forum.choiceofgames.com/u/fantom)\
**Post date:** [June 23, 2014, 5:10pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/6 "2014-06-23T17:10:27Z")

</div>

Try putting the \*goto command on a new line.

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [June 23, 2014, 5:12pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/7 "2014-06-23T17:12:29Z")

</div>

Is the \*goto badend on the same line as \*else if? If so that is the problem. If its not try replacing the second \*else if with just \*else

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 5:22pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/8 "2014-06-23T17:22:42Z")

</div>

@fantom @nocturnal_stillness  
Thank you both for being patient and answering me! The \*goto command is on a new line, I don’t know why it shows up like that when I copy it to the forums 😕

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [June 23, 2014, 5:30pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/9 "2014-06-23T17:30:18Z")

</div>

Try replacing the 2nd \*elseif with just \*else and see if that works.

For example

```

*choice
    #choice one
        *if var >15
            *goto win
        *elseif var >10
            *goto draw
        *else
            *goto lose

```

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 23, 2014, 5:35pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/10 "2014-06-23T17:35:36Z")

</div>

@nocturnal_stillness  
Yeah, I tried that too, but it didn’t seem to work either. There’s something wrong with the last two choices, but I can’t tell what. I don’t have time to work on this anymore today though. Thank you both so much for taking a look and offering your input! 🙂

---

<div class="post-metadata">

**Author:** ![aetheria](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@aetheria](https://forum.choiceofgames.com/u/aetheria)\
**Post date:** [June 23, 2014, 5:53pm UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/11 "2014-06-23T17:53:04Z")

</div>

This runs in Firefox and also passes quicktest, as far as I can tell:

```
*create var1 10
*create var2 1
*create var3 0

This is a choice.

*choice
  #choice 1
    some text
    *set var2 + 5
    *page_break
    *if (var2 > 9)
      *goto end2
    *else
      *goto badend
  #This is the problem line!
    Some text
    *set var1 + 5
    *page_break
    *if (var1 > 9)
      *goto end1
    *else
      *goto badend
  #choice 3
    some text again
    *set var3 + 5
    *page_break
    *if (var3 = 15)
      *goto reallybadend
    *elseif (var3 >= 10)
      *goto end3
    *else
      *goto badend
      
*label end1
This is the first ending.
*goto ending

*label end2
This is the second ending.
*goto ending

*label end3
This is the third ending.
*goto ending
    
*label badend
This is a bad end.
*goto ending

*label reallybadend
This is a really bad end.
*goto ending

*label ending
*finish

```

It’s actually your first choice in the original code that quicktest seems to be failing at (I think because of [this?](http://www.choiceofgames.com/make-your-own-games/testing-choicescript-games-automatically/#fakes)), so fixing all the choices to end with \*else as @Nocturnal_Stillness suggested does the trick.

---

<div class="post-metadata">

**Author:** ![lenkaiscool](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lenkaiscool](https://forum.choiceofgames.com/u/lenkaiscool)\
**Post date:** [June 24, 2014, 5:08am UTC](https://forum.choiceofgames.com/t/i-cant-find-the-error/2472/12 "2014-06-24T05:08:57Z")

</div>

Ah, thank you so much! Everything goes smoothly through quicktest now. Teaches me not to code at 3am I guess.  
(Since the issue has been resolved, a mod can feel free to close the discussion)
