HOW TO: Nested Choices

Hi there!
I will talk about how nested choices are done : )

Here’s a sample of what a generic nested choice looks like:

NARR
What choice would you like to pick?

choice
“Choice one” {

NARR
You chose CHOICE1.

gain CHOICE1

} “Choice two”{

NARR
You chose CHOICE2.

}

NARR
And what is the second choice that you would like to pick?

choice
“Choice A” {

NARR
You chose CHOICEA.

gain CHOICEA

} “Choice B”{

NARR
You chose CHOICEB.

}

if (CHOICE1){
if (CHOICEA){

NARR
The scene for CHOICE1 and CHOICEA would occur here.

} else {

NARR
The scene for CHOICE1 and CHOICEB would occur here.

#notice below this line there are TWO closing braces
}} else {

if (CHOICEA) {

NARR
The scene for CHOICE2 and CHOICEA would occur here.

}else {

NARR
The scene for CHOICE2 and CHOICEB would occur here.

}
}

@pause for 0

So, an example would be:

NARR
What type of ice cream flavor do you want?

choice
“Chocolate” {

NARR
You chose chocolate.

gain CHOCOLATE

} “Vanilla”{

NARR
You chose vanilla.

}

NARR
And would you like sprinkles?

choice
“Yes” {

NARR
You chose to add sprinkles.

gain SPRINKLES

}“No”{

NARR
You chose to add no sprinkles.

}

if (CHOCOLATE){
if (SPRINKLES){

NARR
The scene for chocolate flavored ice cream with sprinkles goes here.

} else {

NARR
The scene for chocolate flavored ice cream with no sprinkles goes here.

#notice below this line there are TWO closing braces
}} else {

if (SPRINKLES) {
NARR
The scene for vanilla flavored ice cream with sprinkles goes here.

}else {

NARR
The scene for vanilla flavored ice cream with no sprinkles goes here.

}
}

@pause for 0

Of course, the nested choice you write will include more dialogue and more detail, this is a pretty simple one : )

I hope this helps :sparkling_heart:

27 Likes

I scripted it just like your example. The writer portal did not say that there was an error but when I preview it, it goes through both the "if"s instead of just one. Please help

You absolute gem… Jem :laughing: :heart:

1 Like

Hi, it should work!
Did you try re-setting the flags?
Here’s how to do it:



Hope it does work for you :green_heart:

6 Likes

Thanks!

Thanks so much
This saved me alot of time

1 Like

No problem : )
Thank you for showing support by liking <3
It means a lot to me :sunglasses::heart:

2 Likes

Thank you everyone for your nice comments :sparkling_heart:

I have now switched to goto for the nested choices but my script will still only play one of the conditions

I currently have a script that looks something like below. When I play through for both of the nested options I get if (option1nestedchoice) for both flags option1nestedchoice and option2nestedchoice. This is my first attempt at nested choices, what am I doing wrong?

  NARRATOR

Dialogue
choice
“Option 1 in Choice 1.”{
gain option1choice1
#bunch of stuff happens

choice
“Option 1 in Nested Choice for Choice 1.”
{
gain option1nestedchoice
}
“Option 2 in Nested Choice for Choice 1.”{
gain option2nestedchoice
}
#more stuff happens
if (option1nestedchoice) {
#stuff happens
}
elif (option2nestedchoice){
#different stuff happens
}

}“Option 2 in Choice 1.” {
#other stuff
}

NARR
Dialogue.

choice
“Option 1 in Choice 1.”{

#bunch of stuff happens

gain option1choice1

} “Option 2 in Choice 1.”{

#other stuff

}

NARR
Dialogue.

choice
“Option 1 in Nested Choice for Choice 1.” {

#stuff happens

gain option1nestedchoice

} “Option 2 in Nested Choice for Choice 1.”{

#stuff happens

}

if (option1choice1){
if (option1nestedchoice){

NARR
The scene for Option 1 in Choice 1 AND Option 1 in Nested Choice for Choice 1 goes here.

} else {

NARR

The scene for Option 1 in Choice 1 AND Option 2 in Nested Choice for Choice 1 goes here.

}} else {

if (option1nestedchoice) {

NARR
The scene for Option 2 in Choice 1 AND Option 1 in Nested Choice for Choice 1 goes here.

}else {

NARR

The scene for Option 2 in Choice 1 AND Option 2 in Nested Choice for Choice 1 goes here.

}
}

@pause for 0

1 Like

Bumping this :sunglasses:

1 Like

Another tiny bump :grin::tulip:

1 Like

Is it too soon to bump? :sweat_smile:
I think not :sunglasses::fries:

Another tiny bump, so tiny…:pleading_face::pleading_face::pleading_face:

Bumping this ^^
:green_heart::purple_heart::grin::purple_heart::green_heart:

Bumping this ^^

1 Like

Bump ^^

Bump : )

Bump :grin:

Bumping this : )