Is it possible to make a if/else that combines 2 or more past choices?


I wonder if there is a way for me to combine past choices in a if/else.

I would like to do something along the lines of:

If the reader picked (choice_1 is “answer1”) and (choice_2 is “answer 2”) → then this happens

Is that possible and if so, how do I code it? I would like to do this with up to 10 different choices.

You can put one inside the other, like:

if (choice is “A”) {
if (choice is “B”} {

} else {
} else {

1 Like

Oh! okay.

So I can just have as many if (choice is “whatever”) as I want and then they all have to be true for it to be visible to the reader?

I believe so! I’ve combined up to 4 choices before like this and it worked for me. You just have to make sure all the else commands come after the scene so that all of the choices are contained inside of the first one.

1 Like

Right. Thank you so much!
I’m gonna try and see if I can wrap my head around that :sweat_smile:

I really appreciate your help. Thank you!

1 Like

No problem! Let me know if you need more help or an example or something.

1 Like

I do have a follow-up question if you don’t mind.

Would I have to write something in all the “else”?
Or how does that work :thinking:

You don’t have to! It depends what you want to happen in the scene. If you do it the way I wrote above and add your dialogue/whatever into the blank space, the readers will see that scene if they selected all of those choices. If they didn’t, they’ll just skip to the part that comes after it.

1 Like

Oh cool!
So if I have 10 choices combined I just have to make the same number of else commands (10) and then I can write below the last one, yeah?

Yep! It’ll probably look like a mess with all the else commands haha but just make sure you keep track of the brackets.

1 Like

Yeah, I can imagine :rofl:
Thank you so much!! I think I understand it now.

1 Like

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