Help with if/elif/else code

I’m using the if/elif/else code for the first time and I’m using @Dara.Amarie 's guide for it and I thought I figured it out but i’m getting an error on the line with else that says “Unexpected expression: Did you leave out the word “choice”, or forget to put a character name in ALL CAPS?”
This is my code:

code

LYDIA (dustoff_neutral_loop)
Okay, let me just take my hoodie off and then I have to go.
@LYDIA is dustoff_neutral_loop
if (PARTY_OUTFIT is “Outfit 1”) {
@LYDIA changes into partyoutfit1

} elif (PARTY_OUTFIT is “Outfit 2”) {
@LYDIA changes into partyoutfit2

} elif (PARTY_OUTFIT is “Outfit 3”) {
@LYDIA changes into partyoutfit3

} elif (PARTY_OUTFIT is “Outfit 4”) {
@LYDIA changes into partyoutfit4

} else (PARTY_OUTFIT is “Outfit 5”) {
@LYDIA changes into partyoutfit5
}

And this is my choice code from before:

choice code
    NARRATOR (LYDIA)
What should I wear to the party?

choice (PARTY_OUTFIT)
“Outfit 1” {
@LYDIA changes into partyoutfit1
@pause for a beat

} “Outfit 2” {
@LYDIA changes into partyoutfit2
@pause for a beat

} “Outfit 3” {
@LYDIA changes into partyoutfit3
@pause for a beat

} “Outfit 4” {
@LYDIA changes into partyoutfit4
@pause for a beat

} “Outfit 5” {
@LYDIA changes into partyoutfit5
}
@pause for a beat

    LYDIA (think_rubchin)
Do I want to wear this one?

choice
“It’s perfect!” {
LYDIA (talk_primp_neutral)
I look great!
} “No, I want to try on the others!” {
goto dressing_game_1
}

Can anyone help me figure out what I’m doing wrong??

1 Like

@LYDIA sorry for the tag aha

I’m not exactly sure what’s causing the error here, but this technique won’t work for remembering outfits. You’ll need to use the point system if you’re using a confirmation choice.

Remove (PARTY_OUTFIT is “Outfit 5”), you don’t need to code anything on that.

.
.
}else{
@LYDIA changes into partyoutfit5
}

This is one of the techniques in remembering outfit choices other than gains and point systems.
By naming the choice, and to match with the option title in the later chapter if you want to remember the choice.

e,g, choice name is (CHOICE_NAME), option title is “Blah blah blah”.
The format for the if/elif will be:
(CHOICE_NAME is “Blah blah blah”)

I know it is. It’ll account for any choices tapped, I believe. So it will, like gains, remember all previously selected choices. I’ve tried it before, it didn’t work out. I’m highly aware it’s a technique :slight_smile:

I changed it to that and now she changes into partyoutfit5 no matter what option I click.

Did you run the whole script? Like from the part where she get to choose her outfit to the part where it needs to be remembered? Because if you skip and just run the middle of the script, the system will just go for the “else” option.

Ohh okay thank you that worked!

I did. But then I tried it with gains and it worked so I’m good now :slight_smile:

Points or gains? Gains and points are different things, you’ll need to use points specifically if you want the outfit choice to have confirmation.

Similarly to what’s used in dara.amarie.ep’s tappable dressing game templates. If you’re not using MC points, you can add to your MC’s totals (by using @MC = outfit#ofpoints).

Then later you’d do…

if (MC =1) {
@LYDIA changes into partyoutfit1

} elif (MC =2) {
@LYDIA changes into partyoutfit2

} elif (MC =3) {
@LYDIA changes into partyoutfit3

} elif (MC =4) {
@LYDIA changes into partyoutfit4

}elif (MC =5) {
@LYDIA changes into partyoutfit5
}

If you’re using character points for your MC, I’d just make a new character just for outfit remembering :slight_smile:

Oh, yeah sorry I used gains/flags. That was the second option in Dara’s guide.

No need to apologize :slight_smile: I’m just warning you on what may happen as a result of using gains <3

This part should just be

} else {

This technique does work for remembering outfits and it’s (in my opinion :wink:) the best technique for remembering outfits as it’s the easiest to use

Ah, alright. I had tried it in the past before and it continually showed the wrong outfits :woman_shrugging:t2: Maybe it’s updated since then, though.

I read your reply above explaining why you think this doesn’t work. This technique doesn’t work if you have an outfit template that’s formatted like a CC template where there’s a label and a goto inside each choice to goes back to the label to start the choice over with a “Done” button (like as if you were choosing a hair style and viewing all options before clicking the done button). So in that situation this technique wouldn’t work. But her dressing game above is formatted differently to where this does work.

1 Like

Ohh, yeah that makes sense. Thank you for clearing it up :relaxed::heart:!

1 Like

Yeah I don’t know what was causing the error but I just ended up using the gains/flags like you explained in your guide and it worked great so thanks :upside_down_face:

1 Like

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