Help with choicescript please

I’m having trouble with getting to understand choicescript.

Basically, i’m stuck with *choice
#First choice
you chose this
#Second option
you chose this one
I always get the error of missing *finish, *goto and *label but i don’t know how to use it. I read guides but i either can’t understand because i’m not native, or if i’m just completely stupid. I just don’t know anything.

There’s tutorial videos on youtube, I am pretty sure. Basically, add a *goto intro (or whatever you name the label) below the choice.

Goto is a command which executes a label (a path). You can name the label whatever you want.

*label intro
You go here. Bla bla.
Is this understandable?

1 Like

If i understand correctly, it basically gives a name to the choice?

1 Like

What exactly are you trying to do?

If you want flavor text that ends up in the same place, you’ll want to use *fake_choice:

*fake_choice
  #First option
    You chose A.
  #Second option
    You chose B.
Here's text on next page.

Which will get you:
“You chose A. Here’s text on the next page.” or “You chose B. Here’s text on the next page.”
Edited to add: *fake_choice doesn’t require *goto or *label, because both choices lead you to the same place.

If it’s a more branching decision, though, you basically need to create the branches using *goto and *label, like:

*choice
  #First option
    *goto A
  #Second option
    *goto B

*label A
Here's text for choice A. This is one story branch! 
*finish

*label B
Here's text for choice B. This is another story branch! 
*finish

Here, choosing “First option” will take you to A (“Here’s text for choice A. This is one story branch!”), while choosing "Second option will take you to B (“Here’s text for choice B. This is another story branch!”).

2 Likes

I found this page very useful in the beginning. I suggest you have a look at it, as well as the wiki! :slightly_smiling_face:

With goto and label commands, I find that spelling errors are easily missed, so what I do is I copy the label, and then paste it after the *goto.

1 Like

It gives a name to the mini-scene the reader reads after selecting the choice.

i want to do it like this:
*choice
#this is the first choice
you chose the first choice
#this is the second choice
you chose the second choice

After you chose one of the previous choices you went to sleep

(Next)

You woke up
*choice
etc.

Since it sounds like both options go to the same place, you can just use *fake_choice. So that’ll look like:

*fake_choice
  #this is the first choice
    you chose the first choice
  #this is the second choice
    you chose the second choice

After you chose one of the previous choices you went to sleep
*page_break
You woke up

I think the bit you’re missing is this:

Whatever choice is made MUST goto a subsequent (or even a prior) label.

*goto paragraph1

*label paragraph1

A choice jumps to a label.

If you want to use *choice, you could, but it seems messier to me. That would look like:

*choice
  #this is the first choice
    *goto first
  #this is the second choice
    *goto second

*label first
you chose the first choice
*goto sleep 

*label second
you chose the second choice
*goto sleep

*label sleep
After you chose one of the previous choices you went to sleep
*page_break
You woke up

No, not like that, (geez, i’m so stupid xD)
*choice
#choice num.1
wow num.1
*page_break
(After you choose the first choice) You did this and that and you still didn’t understand
*page_break
*choice
and more choices

You’re not stupid! I’ve spent years coding other things, so the tutorial made sense to me – jumping in without that experience is absolutely intimidating/confusing!

Give me few minutes to type up what I think you might want.

*choice
  #this is the first choice
    *goto first
  #this is the second choice
    *goto second

*label first
you chose the first choice. but you still don't understand! What now?
*fake_choice
  #try A
    you try A.
  #try B
    you try B.

It helped you understand!
*goto sleep 

*label second
you chose the second choice. you totally understand.
*goto sleep

*label sleep
Now you understand, so you go to sleep.
*page_break
You woke up.
...(more choices, etc)

It’s basically stringing together blocks of choices. So if you choose first choice–>A, you’ll get, “you chose the first choice. but you still don’t understand! What now? you try A. Now you understand, so you go to sleep.”
Whereas if you choose the second choice, you’ll get, “you chose the second choice. you totally understand. Now you understand, so you go to sleep.”

and if i want a text without choices?

Edit: the *page_break command is what gets you the “Next” button rather than a choice.

Text without choices you can just type. So, e.g.,

Here's a page of text without choices; you get to the next page by hitting next. 
*page_break
This is the next page of text without choices.
*page_break
And so on....
*page break
Now we're at a page with choices.  What do you choose?
*choice

(Where after choice, you do the choice scripting from before.)

i did that, but it says “expected choice body”.
Is something wrong in the text?
“hello world”!
*choice
#Dis is da first opton
*goto intro
#Dis is de second opton
*goto secintro
*label intro
did dis work?
*fake_choice
#yes
maybe.
#no
i knew it
*label secintro
you understand 101!
*goto sleep
*label sleep
i’m going to sleep.
*page_break
You woke up.

I believe it’s a problem in into. Try:

did dis work?
*fake_choice
  #yes
    maybe.
  #no
    i knew it
YOU NEED SOME TEXT HERE. AND THEN YOU NEED TO TELL ME WHERE TO GO, e.g,:
*goto sleep

It could have to do with indentation. Could you copy your code in a formatted block? (Use the </> option at the top of the message box.)

Nope. Didn’t work. Still have the weird error.

"hello world"!
*choice
 #Dis is da first opton 
*goto intro
 #Dis is de second opton
*goto secintro
*label intro
did dis work?
*fake_choice
 #yes
 maybe.
 #no
 i knew it
*label secintro
you understand 101!
*goto sleep
*label sleep
i'm going to sleep.
*page_break
You woke up.

Check the indents. Common cause.

Yeah, it looks like the indents! You’ll want:

"hello world"!
*choice
 #Dis is da first opton 
  *goto intro
 #Dis is de second opton
  *goto secintro
*label intro
did dis work?
*fake_choice
 #yes
  maybe.
 #no
  i knew it
*label secintro
you understand 101!
*goto sleep
*label sleep
i'm going to sleep.
*page_break
You woke up.

Edit: basically, make sure the *gotos are indented more than the #option they respond to, just like you do for the *fake_choice flavor text