Using the if/else/elif command with another choice?

This might be a tad confusing, but I was wondering if there was a way to remember a certain choice with another choice later in the story? Like, if a character chooses to receive an object, and later comes a choice that can only be shown if the character chose to receive the object? Thanks, sorry if this question is confusing.

1 Like

You can use gains… for example like this:

When receiving the object:

choice
“I can’t take this”{

}
“Thank you”{
gain got_object
}

Later on in the story:

if (got_object){
choice
“Pick up your object.”{

}
“Don’t pick it up”{

}
}

ALL THIS IS AN EXAMPLE :sweat_smile:

1 Like

Moved to Directing Helps and Tips since this is about coding. Make sure to check out our Forum Tutorial for more info about creating topics, and feel free to PM me if you’ve got questions. :smiley:

1 Like

You can use gains like below or you can also name the choice. Personally, I find gains easier but sometimes I like to use this way.

choice (NAME OF CHOICE)
”eat alone”{

Etc

Then
If (NAME OF CHOICE is ”eat alone”){
Blah blah blah…

1 Like

do you want your readers to know that the amount of responses was dependent of a past choice? if so, you could do a locked choice, or just give them a reader message. this is what the coding could look like:

BAD BOY
I love you, baby girl.

readerMessage Additional responses might be available due to a prior choice made.

label choice_babygirl_chapter_1

BABY GIRL
(OMG! What should I say??)

choice
< GREEN > “Squeak squeak squeak” {

BABY GIRL
Skdskdskdokbye.

BAD BOY

} < PREMIUM > “I love you too” if (wore_a_super_cute_outfit)

BABY GIRL
I love you too.

BAD BOY
Heart eyes <3
Let’s get married!

BABY GIRL
!!
K!

} < LOCKED > “I love u too” if ( [NOT wore_a_super_cute_outfit] ) {

NARRATOR
This choice is not available because you didn’t wear a cute outfit today.
Sorry, reader.

goto choice_babygirl_chapter_1

}

Thank you all so much!!