DARA’S GUIDE: Enable/Disable Choice Options with Conditions

Please visit my website for more templates and guides!
https://www.dara-amarie.com/

This guide talks about the use of remembering choices and the points system.
You can learn about them here:

The Use of if (condition) in Choices

  • You can enable or disable a choice button based on certain flags a reader has gained.
  • This means that if a reader has gained a flag, a choice button will be available for them to tap on. But if the reader has not gained that flag, then the choice button will not show up for them to tap.​

choice
“Option 1” if (flag_1) {
} “Option 2” {
}

  • Readers will only see “Option 1” if they have gained flag_1
  • If readers did not gain flag_1 then “Option 2” will be the only available option for them.

You can also use this coding for the “choice name” method and the points system:

choice
“Option 1” if (choice_name is “Option Title”) {
} “Option 2” if (CHARACTER=1) {
}

The Use of if ( [NOT flag_name] ) in Choices

*this only works with flags

  • If you want a choice option to be available if a flag has not been gained, you would use this coding:

choice
“Option 1” if ( [NOT flag_1] ) {
} “Option 2” {
}

  • In the above coding, “Option 1” will not be available to a reader if they have gained flag_1
  • That option will only be available if flag_1 has NOT been gained.

Example:

NARRATOR
It’s the big moment, what are you going to do?

choice
“Kiss him for the first time!” {
gain first_kiss

} “Back away” {
}

Then later on in the story…

NARRATOR
He’s leaning in for the kiss…!

choice
“Kiss him again!” if (first_kiss) {

} “Get your first kiss!” if ( [NOT first_kiss] ) {

} “Push his face away…” {
}

  • In the example above, the “Kiss him again!” option will only be available if the reader gained the first_kiss flag from the first choice.
  • If the reader chose to back away in the first choice, then they did not gain that flag, so they will see the “Get your first kiss!” option instead of the “Kiss him again!” option.


**Both if (flag_name) and if ( [NOT flag_name] ) work with tappable overlays as well!

Eliminating/Disappearing Choices

1- Here is how you can have choices disappear once they have been tapped on, then have the option to tap on more choices or to end the choice.

Expand Coding
label main_choice

        NARRATOR
    Choose all options.

choice
"Option One" if ( [NOT tapped_1] ) {
gain tapped_1
gain tapped_once
goto option_1

} "Option Two" if ( [NOT tapped_2] ) {
gain tapped_2
gain tapped_once
goto option_2

} "Option Three" if ( [NOT tapped_3] ) {
gain tapped_3
gain tapped_once
goto option_3

} "Option Four" if ( [NOT tapped_4] ) {
gain tapped_4
gain tapped_once
goto option_4

} <GREEN> "I'm done choosing" if (tapped_once) {
goto done_choosing
}


label option_1
#scene goes here
goto main_choice


label option_2
#scene goes here
goto main_choice


label option_3
#scene goes here
goto main_choice


label option_4
#scene goes here
goto main_choice


label done_choosing
#continue on with your story here


2- Here is how you can have choices disappear once they have been tapped on, then continue on with the story once all choices have been tapped on.

Expand Coding
label main_choice

if (tapped_1) {
if (tapped_2) {
if (tapped_3) {
if (tapped_4) {
goto done_choosing
}}}}

        NARRATOR
    Choose all options.

choice
"Option One" if ( [NOT tapped_1] ) {
gain tapped_1
goto option_1

} "Option Two" if ( [NOT tapped_2] ) {
gain tapped_2
goto option_2

} "Option Three" if ( [NOT tapped_3] ) {
gain tapped_3
goto option_3

} "Option Four" if ( [NOT tapped_4] ) {
gain tapped_4
goto option_4
}


label option_1
#scene goes here
goto main_choice


label option_2
#scene goes here
goto main_choice


label option_3
#scene goes here
goto main_choice


label option_4
#scene goes here
goto main_choice


label done_choosing
#continue on with your story here
57 Likes

Thank you @Dara.Amarie! BOOKMARKED. :blush:

3 Likes

ouu thanks for this :sparkling_heart::sparkling_heart:

2 Likes

Thank you for sharing Dara :smiling_face_with_three_hearts:

1 Like

Thanks so much Dara! Queen!!!

1 Like

Ahh I needed this ages ago!!! :joy:

1 Like

I think this will be very useful when it comes to the point system.

1 Like

I knew I was forgetting something! Thanks for reminding me haha! This coding also works with points and the “choice_name” method of remembering choices.

choice
“Option One” if (CHARACTER=#) {
“Option Two” if (choice_name is "Option Title) {
}

Glad I could help :blush:

1 Like

:heart_eyes::heart_eyes::heart_eyes: thank you!

1 Like

This was super helpful saved my story ngl!!

1 Like

ayy this is really cool. I was thinking about an experiment with the way I could code this to life. I appreciate this tutorial @Dara.Amarie :grin:

Does this also work in an if/else statement without a choice? Such as:
if ( [NOT flag_1] ){

} else {

}

Yes it works, but would be a little redundant since the “else” would be the “NOT flag” part if you did:

if (flag_1) {

} else {

}

1 Like

What if the reader needs two gains to enable a choice? Can this work with two gains as well?

Lol, figured it out! Thanks for this thread anyway! :smiling_face_with_three_hearts:

This is so helpful - thank you @Dara.Amarie :raised_hands:t3:

1 Like

Bump :cupcake:

1 Like

Bump

1 Like

This is the information I’m trying to figure out. How do I do that?