I'm having problems with the if/elif

In my story, I have an outfit choice that affects dialogue later on but my if/elif thing isn’t working. I have put gain the_name_of_the_outfit like that but obviously, it’s the actual name of the outfit under the dressing game part when u agree to choose that outfit. But the problem is later on when I have the dialogue it doesn’t do it in the order based on the outfit it just does the first if first then the 2nd. Please help me aha, I will insert pictures of the first part where u pick the outfit then the dialogue that isn’t going to the correct if/elif based on the choice of outfit. !

(This is the first part)
thing|525x499

(This is the 2nd part)

If you guys could help me fix this it would be greatly appreciated.

I also says there are no errors in my script.

the problem is with if (your_glowing_darling). It should be something like this:

if (gain) {
dialogue here
} elif (gain) {
dialogue here
}

or

if (gain) {
dialogue here
} else {
dialogue here
}

and they should both work the same depending on the gain the reader received.

2 Likes

as [jazzysab13] wrote

you have 2 if

the choice using if /elif/else has always only one if, one else, and how many elif you need

so if you have only 2 choices you will use if / else
if you have 5 choices = if / elif / elif / elif / else

also, remember that when you write the gain in the brackets (or choice name…atc) - you write it only next to if and elif. You do not write it next to else (because here ghoe everything else than what you got next to if/elif

here it is in more detail:

1 Like

Thanks for the help but it still doesn’t seem to be working. When my character is wearing the your glowing darling outfit it still does the first set of dialogue which is meant for if you pick the other outfit. So idk :sweat_smile:

1 Like

After the reader picks the outfit, does it go straight to reactions? If so, what goto and label did you use (I’m mentioning this since I noticed you use goto bad_outfit_choice after the first outfit option, but I can’t see what you used for the second outfit option and so the problem may lie there)?

Here’s an example of how your script can look:

label dressinggame_1

NARRATOR
What to wear?

choice
“Ugly outfit” {
@character previews uglyoutfit

NARRATOR
Do I like this?

choice
“Yes, wear it.” {
@character changes into uglyoutfit
gain uglyoutfit
goto afterdg1
} “No, ew.” {
@character unpreviews uglyoutfit
goto dressinggame_1
}
} “Pretty outfit.” {
@character previews prettyoutfit
NARRATOR
Do I like it?

choice
“Yes, wear it.” {
@character changes into prettyoutfit
gain prettyoutfit
goto afterdg1
} “No, ew.” {
@character unpreviews prettyoutfit
goto dressinggame_1
}
}

label afterdg1
Dialogue here
if (uglyoutfit) {
Dialogue here
} else {
Dialogue here
}

Hey, thank you so much for all your help but I actually figured it out :joy:
All I had to do was refresh the page. But thanks so much it’s greatly appreciated all your help :heart:

1 Like

All goods! :grinning:

1 Like

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