Error making option selectable

I am trying to make the first option in the first set of choices in my game selectable, however when I click on it, it gives me an error about the second option. It is illegal to fall out of a *choice statement, you must *goto or *finish before the end of the indented block.

I put goto under the first selection, then the second selection vanished. the same thing with finish. I don’t know how to fix it.

Could you post your code using the pre-formatted feature like this please?


*choice
 #The Helios: The Sun Chariot- Blessed by the Sun God Helios, these elves use the power of Helio's fire the strongest of the fire magyk called Phoebus Apollo. Hold out arms to the sky...
     The humans glared at the elf and rushed toward him, shouting as the flaming cuffs tightened around his wrists. He smiled at them, even as they raised their swords. The elf held his arms out to the sky. 
     example text
     

 #The Nanna: The Sīn Blessed- Blessed by the Moon God Sīn, these elves are intuned with the natural ebb and flow of the strongest and deadliest form of lunar magics, known as Suen Crescent. Frequently depicted as pale of hair and flesh, they draw on the power of Sīn himself. Reach out and touch the nearest human noble...

example text

It looks like both of the #options in your *choice are missing *goto commands. Did you not include them when you pasted your code? It should look something like this:

*choice
  #Option One
    Text
    *goto label1
  #Option two
    Text
    *goto label2

*label label1
Text

*label label 2
Text

If you don’t want to use so many *labels and *gotos, you should consider using *fake_choice or enabling implicit control flow

ETA: although I can’t tell for sure since I think some of your code is missing, your second #option might be disappearing because there is so much blank space between #Option 1 and #Option 2

2 Likes

Thing is, I don’t understand any of that…
just took out the text that was there

Let me try to annotate the code and explain what’s happening

@TheYaoiEmpire (tagging you to make sure you get a notification that I’ve edited my post)

Here’s what a *choice should look like (I’m only going to include one #option in order to illustrate what you have to do)

*choice
  #Option 1
    Text: 
    *goto next

*label next

Text: This is what you’ll see when you pick an #option. This doesn’t affect the code, just what the player sees
*goto: *goto commands tells the code where to go. If you don’t tell the code where to go, it doesn’t know what to do. Code is dumb like that. You always have to give it instructions. Every #option in a choice or *if/*elseif/*else statement needs a *goto command so that it knows where to go. You can also use *goto in other places if you want the story to skip to a new place
*label: a label is a spot in the code. You can put one anyway and then use the *goto command to send the game to a new label. You might want some #options to go to some labels and other options to go to other labels.

The code that you posted above has two #options, but neither #option has a *goto. When the code gets to this choice (no matter which #option you pick), it doesn’t know what to do. You have to tell it what to do with a *goto command.

That seems like a good starting point. If you have questions, please be as specific as possible

5 Likes
*choice
    #The Helios: The Sun Chariot- Blessed by the Sun God Helios, these elves use the power of Helio's fire the strongest of the fire magyk called Phoebus Apollo. Hold out arms to the sky...
        The humans glared at the elf and rushed toward him, shouting as the flaming cuffs tightened around his wrists. He smiled at them, even as they raised their swords. The elf held his arms out to the sky. 
        example text
        *goto example
     
     #The Nanna: The Sīn Blessed- Blessed by the Moon God Sīn, these elves are intuned with the natural ebb and flow of the strongest and deadliest form of lunar magics, known as Suen Crescent. Frequently depicted as pale of hair and flesh, they draw on the power of Sīn himself. Reach out and touch the nearest human noble...
        The text that will appear after you choose this option. 
        *goto example

*label example
example text

This is what your code is supposed to look like. You are not using commands like *goto and *finish with *choice and your indentation is inconsistent.
If you use 4 spaces as indents then you must keep using 4 spaces thoughtout the whole file.

1 Like

will test this out, thanks guys!

1 Like

How do I make it end and head to a new chapter if the first option is selected without having the error?

When you are ready for your game to progress to a new chapter, you can use the *finish command. This can go inside an #option like the *goto command, or anywhere else. Make sure that your scene list (in startup.txt) has the chapter name (the name of the .txt file) that comes next

Your other option is to use *goto_scene. To use this one, format it like: *goto_scene text_file_name.txt. You can put this command under your #option or anywhere else


I want to give you a few resources that will help you learn how to use choicescript.

When you need help, try using the search feature to find threads that might help you. If you search for the error message you are receiving, like “It is illegal to fall out of a *choice statement, you must *goto or *finish before the end of the indented block” that you mentioned above, you will probably find threads about that issue, many of which will have solutions that hopefully help you

3 Likes

still getting the same error.

Please post your code with the updates you’ve made

*choice
	#The Helios: The Sun Chariot- Blessed by the Sun God Helios, these elves use the power of Helio's fire the strongest of the fire magyk called Phoebus Apollo. Hold out arms to the sky...
		The humans glared at the elf and rushed toward him, shouting as the flaming cuffs tightened around his wrists. He smiled at them, even as they raised their swords. The elf held his arms out to the sky. 
		"You will never be allowed to get what you seek, may the sun's flames engulf you!" The fire on the cuffs that bound him, burst forward and shot out at the charging mortals. The sound of his wailing child hit his ears and he struggled to stand, however an arrow shot from one of the advancing soliders, found its mark in his gut. He fell forward, the sun's fire burning away those who had attacked him. The human holding his baby, rode off into the darkness.
 		    
   #The Nanna: The Sīn Blessed- Blessed by the Moon God Sīn, these elves are intuned with the natural ebb and flow of the strongest and deadliest form of lunar magics, known as Suen Crescent. Frequently depicted as pale of hair and flesh, they draw on the power of Sīn himself. Reach out and touch the nearest human noble...
    The humans stared at him with scorn, one of them reaching for his sword. Akashal's eyes caught this and he acted quickly. He could feel the raw power of the moon as it slowly rose in the distance. Akashal watched forlornly as the humans ripped his baby away from him, he reached out and grabbed the nearest human. The power of the Moon flows through Ashakal, his voice like venom as it seeps into the ears of the humans nearby. The tattoed markings in the shape of a crooked tree that lines his forehead, down to his chin, change from red to a deep purple color. The sky, once black now bled a dark purple, the men looked on in terror as the elf gripped the throat of the human so tightly, the bones could be heard, snapping one after the other.    
        "A sacrifice to Sīn, let the moonlight be as witness!" The moonlight shone done on Ashakal, his facial and body markings glowing a deep silver. "I will never allow you to carry out that which should have never been!"	Akashal let the power flow through his hand, ignoring the flaming cuffs, the moon draining the life from the human. A moment later, blood sprayed from his mouth, a spear stabbing through his gut. He fell to his knees and coughed up blood, the humans riding away with his wailing baby in their grip.
*finish

Trying to put goto or finish at the bottom of the first choice makes the second choice vanish

You have to put your *finish or *goto command within your #option blocks–plural because each #option has to have a command that tells it where to go. The indentations also look inconsistent, which are going to cause errors.

*choice
.. #The Helios: The Sun Chariot- Blessed by the Sun God Helios, these elves use the power of Helio's fire the strongest of the fire magyk called Phoebus Apollo. Hold out arms to the sky...
....TEXT
....*finish
..#The Nanna: The Sīn Blessed- Blessed by the Moon God Sīn, these elves are intuned with the natural ebb and flow of the strongest and deadliest form of lunar magics, known as Suen Crescent. Frequently depicted as pale of hair and flesh, they draw on the power of Sīn himself. Reach out and touch the nearest human noble...
....TEXT
....*finish

I have used periods (".") to illustrate what your spacing shoud look like.

Putting the *finish at the bottom won’t work regardless because it has to go within the *choice block (one for each) option. However, I think your second #option is disappearing on you because of your indentations

The only times when you don’t need a command to tell the code where to go in a *choice block or *if/*elseif/*else statement is when (1.) you are using *fake_choice or (2.) you have enabled implicit control flow. If neither of those things appeal to you, or you don’t feel comfortable trying something new, then you must use a command (*goto, *goto_scene, *finish, or *ending) with each and every #option within a *choice block

2 Likes

Issue is, it’s not about trying something new, I’ve read through the tutorials and things like that but I still don’t understand it. I changed all spaces to tabs and got an error on the first choice, expected option starting with #, outside of that I keep getting errors in the text blocks and no matter how I adjust it, it’s not working. Overall this is extremely frustrating honestly.

Coding can be very frustrating. It’s not for everyone. Unfortunately, short of writing it for you, there’s not a whole lot more I can do to help you solve this issue.

My recommendation to you is to look at the original scene files that you get when you download choicescript. Instead of starting from scratch with your own code, play around with what you see in those files. Experiment to see what works and doesn’t and what happens when you make changes.

If you want to PM me about those files and talk about them together, my inbox is open. I think we’ve exhausted the usefulness of this particular thread, however

4 Likes
*choice
    #option
        option text
        *goto x

This is the spacing you should have, it sounds like you might have your *goto lined up with your #option but without seeing the code that’s giving you the error currently it’s impossible to tell.

1 Like