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!
@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
@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!
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?), so fixing all the choices to end with *else as @Nocturnal_Stillness suggested does the trick.
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)