Trouble with Choices and If/Else

Hi! I’m confused why the choice coding in my script isn’t working. I have it like this (don’t mind the weird animations):

if (boyfriend) {
MALE MC
(I should…)
choice
“Thank him.” {

MALE MC (talk_smile_happy_loop)
Thank you for being here for me. You’re the best boyfriend I could ask for.

} “Hug him.” {

MALE MC (idle)
Thank you for being here for me. You’re the best boyfriend I could ask for.

} “Kiss him. :heart:” {

MALE MC (kiss_dip_give)
Thank you for being here for me. You’re the best boyfriend I could ask for.

}️
} else {
MALE MC
(I should…)
choice
“Thank him.” {

MALE MC (talk_smile_happy_loop)
Thank you for being here for me. You’re the best friend I could ask for.

} “Hug him.” {

MALE MC (idle)
Thank you for being here for me. You’re the best friend I could ask for.

}
}

Is there anything I’m missing? Because it keeps showing an Unexpected block end error in the } else { line. If anyone can help pointing out the mistake it’d be of tremendous help!

I think what might be happening is that you have a choice embedded in there, which can work, but is often tricky for me. What I’d do is something along the lines of;

if (boyfriend) {

goto boyfriendchoice

} else {

goto singlechoice

{

###

 label boyfriendchoice

 Your choice with the boyfriend goes here.

 goto storycontinue


 ###

 label singlechoice

 Your choice without a boyfriend goes here.

 goto storycontinue

 ###
 
 label storycontinue

 Your story continues as normal here.

Obviously, this works for quick fixes, but doing this too often in one Episode might make your code look like spaghetti and be too hard to navigate. You might want to have your story branch off to two separate branches (the boyfriend branch and the single branch) until they merge back together later in the story.

ahh yeah, i didn’t think of this. thank you so much!

1 Like

Looks fine to me. Sometimes I get errors and just have to remove all the spaces.

thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.