Is it possible to put a choice inside an if/elif/else bracket?

I’ve been using gains and in one route I wanted to put a choice inside but I keep getting an error, is it possible?

Yes, it is possible. The error might be something else. Can you send a screenshot?

What is the error saying? Also, you need dialogue before the choice.

There is dialogue before the choice.

No, you need dialogue before the choice on line 2390
Move the choice on line 2391 and add dialogue on line 2390

Is that think_rubchin supposed to be the dialogue for ‘Team up with Jessica?’ If so, put that on line 2390

And, add that } on line 2385

1 Like

That worked thank you but I was also wondering since you have to close the bracket before putting down a choice, will the choice still be under that specific route?

Yes, it will be under that specific route.

1 Like

Jumping in, hello lol~

That close bracket would have to be after the choice if you want the choice to be inside the if (suspicious_of_chi) branch.

So it would be something like:

if (suspicious_of_chi) {

(scene here)

CHI (think_rubchin)

choice
“Team up with Jessica to take down Darren.”{

CHI (talk_armscrossed_sad_loop)
Okay, fine…

(more scene here)

gain team_up_with_jess

@transition fade out black in 3

}
“Don’t team up with Jessica.”{

(scene here)

}
}

(the bold brackets completely enclosing the “if (suspicious_of_chi)” branch. :+1: )

Also, there should probably be an “else” branch after this “if” somewhere. Even if the else branch is empty, it’s good for learning/debugging. :+1:

2 Likes

Thank you.

1 Like

Hi I’ve been so busy I didn’t get the chance to try it out but I realize when I try to close the first branch and do this:

}
} else {

it gives me an error

Send your screenshot again?

1 Like

You don’t have a closing bracket } on line 2477

1 Like

there’s an error

Try getting rid of the } on line 2474 or 2476 or maybe you need some dialogue in the else statement.

@JemU776 , @amberose ? Can y’all help lol.

1 Like

Rather than use a choice within your if/else brackets… try using

If (something) {

bla bla bla bla bla

goto if_choice

label back_to_if

bla bla bla bla

bla bla bla

goto continue_story
}

label if_choice
choice “bla bla” {
Something Something
} “bla bla” {
Something Something
}
goto back_to_if

label continue_story

1 Like

Second option…

  1. place goto continue_story inside your else option.
  2. move your script down 1 line after your else choice end.
  3. put label continue_story right before your scene change

Third option…

  1. delete } on line 2477
  2. remove everything on line 2476
  3. Type" }}" on line 2476

You need two end brackets… one will close your choice, one will close your if.

Give these a try and see if it works

1 Like

if (suspicious_of_chi) {

NARR
Bla bla bla…

choice
“Team up with Jessica to take down Darren.”{

NARR
Script here for teaming up with Jessica.

gain team_up_with_jess

}“Don’t team up with Jessica.”{

NARR
The script for not teaming up with Jess goes here.

}
}else{

}

NARR
Continue story.

It’s pretty much what @Scarlet_Sapphire already said :+1:

2 Likes

After trying all these solutions again I noticed a closing bracket before the first choice that was preventing all of these solutions from working, I apologize for not noticing this sooner, thank you all for helping me.

2 Likes