DARA’S GUIDE: Remember Choices with if/elif/else

:heart:

1 Like

@Dara.Amarie

please help, my script says i have no errors but when i play the episode it wont remember what i chose from last episode.

what am i doing wrong?

MY REMEMBERED SCRIPT:

if (Outfit1){
@AMARA changes into AMARA_blackandbeige party
}else (Outfit1){
@AMARA changes into AMARA_revealing in red
}

if (Hair1){
@AMARA previews hair Straight
}elif (Hair1){
@AMARA previews hair Diva Curls
}else (Hair1){
@AMARA previews hair Beach Wave Hair
}

if (Lipcolour1){
@AMARA previews mouthColor Bubblegum Pink
}elif (Lipcolour1){
@AMARA previews mouthColor Scarlet
}else (Lipcolour1){
@AMARA previews mouthColor Ruby Red
}

MY DRESSING GAME:

label choosing_outfit

    AMARA (think)
What outfit do i want to wear?

choice “Black&beige”{
@AMARA walks to spot 1.190 -126 2
@pause for a beat
@AMARA changes into AMARA_blackandbeige party
@zoom on 687 0 to 235% in 0
@AMARA walks to spot 1.190 82 15
@zoom on 667 275 to 235% in 3
@zoom reset
gain Outfit1
}
“Revealing in red”{
@AMARA walks to spot 1.190 -126 2
@pause for a beat
@AMARA changes into AMARA_revealing in red
@zoom on 687 0 to 235% in 0
@AMARA walks to spot 1.190 82 15
@zoom on 667 275 to 235% in 3
@zoom reset
gain Outfit2
}
AMARA (think)
(Do i want to wear this?)

choice “yes i look hot af”{

    KARINA (talk_handsonhips)
Guys are gonna be all over you!

&AMARA is laugh_chuckle
@KARINA is laugh_chuckle

}“Try something else”{

    AMARA (think)
(I'll try something else)

@pause for a beat

goto choosing_outfit

}
AMARA (talk_gossip)
I need to do my hair and makeup

label choosing_hairstyle

    AMARA (think)
(What hairstyle do i want?)

choice “Straight”{

@zoom on 673 315 to 256% in 0
@AMARA is primp_brush_hair
@pause for a beat
@AMARA previews hair Straight
@pause for a beat
@AMARA is idle_happy
gain Hair1
}
“Curly”{

@zoom on 673 315 to 256% in 0
@AMARA is primp_brush_hair
@pause for a beat
@AMARA previews hair Diva Curls
@pause for a beat
@AMARA is idle_happy
gain Hair2
}
“Beach wave”{

@zoom on 673 315 to 256% in 0
@AMARA is primp_brush_hair
@pause for a beat
@AMARA previews hair Beach Wave Hair
@pause for a beat
@AMARA is idle_happy
gain Hair3
}
@zoom reset

    AMARA (think)
Do i want this hairstyle?

choice “Yes!”{

    AMARA (idle_happy)
(I love this hairstyle)

    AMARA
(Now my makeup)

}“try a different hairstyle”{

@pause for a beat

goto choosing_hairstyle

}

label choosing_lipcolour

    AMARA (think)
What lip colour do i want?

choice “Bubblegum pink”{

@zoom on 673 315 to 256% in 0
@add Lipstick to AMARA
&AMARA is apply_lipstick
@pause for a beat
@AMARA previews mouthColor Bubblegum Pink
@remove Lipstick from AMARA
@AMARA is idle_happy
gain Lipcolour1
}
“Scarlet”{

@zoom on 673 315 to 256% in 0
@add Lipstick to AMARA
&AMARA is apply_lipstick
@pause for a beat
@AMARA previews mouthColor Scarlet
@remove Lipstick from AMARA
@AMARA is idle_happy
gain Lipcolour2
}
“Ruby red”{

@zoom on 673 315 to 256% in 0
@add Lipstick to AMARA
&AMARA is apply_lipstick
@pause for a beat
@AMARA previews mouthColor Ruby Red
@remove Lipstick from AMARA
@AMARA is idle_happy
gain Lipcolour3
}
@zoom reset

    AMARA (think)
Do i want this colour?

choice “yes”{

    AMARA (talk_think)
What do you think?

    KARINA (talk_excited)
You look stunning!

@AMARA is primp

}“Let’s see what other options there are”{

goto choosing_lipcolour

}

else needs to be on its own, delete the gains from it, also you use the same gains for each option?

in your dressing/hair/lipstick game you need to confirm each choice, check HERE for a template

thankyouuuuu

I never figured the difference between if/elif, but I always put if, like:
if (1){
}
if (2){
}

And it seem to be working. Or there might be problems with this approach?

Is it possible for the chapters to remember past choices that lead to different events? Like say, if the player tells this character to go one way, then that character gets injured, but if the player tells this character to go another way, then that character would be completely fine? Like instead of choices about outfits, it’s about choices regarding the events of a story?
If so, I’ve been trying to do do the whole gain thing, or the naming the choice and doing if (choice is this), but nothing seems to be working when trying to get the next chapter to remember the past choices. No matter what, the preview just stops before the if(gain) part and won’t continue. Can someone help me?



also, every time I preview the story and the thing skips over the if parts, the coding part under the preview always goes “expr (text) == 0”. What does that mean?

Do you have to use gains to remember what the readers chose in character customization if you want the customization to stay the same after chapter 1 ?

No, you don’t. If a reader chooses something like blush lipstick, it’ll be on them for every episode until they change it (which they have the option to do so only if you put into your script the options for choosing something)

Don’t use gains for CC templates BTW, it won’t work.

*My script keeps going to the first outcome, no matter what i do.
*I always get errors if i use } else {

Helpppp.

“else” needs to be by itself with nothing next to it

} else {

So just on a separate line?
Also will that fix the issue of the outcomes too?

I have got a question, when we put our if and else choice how do we actually use it in the next chapter?

It carries over throughout every episode in your story. Once you gain something/have a choice remembered, it is remembered for every episode so you can use the if, elif, else statement in any episode whenever you need to and however many times you want to.

Just remember if you want to test out different paths to see if your story is working, reset your gains (flags) and select other options to see their outcomes.

so, we don’t have to write the commands each episode?

Yes, you do.

If you want to reference it, you have to write it. But it’ll remember what your reader chose as long as you script it right.

(Sorry to jump in, Jem <3)

1 Like

what if i had to use the choice in the middle how do i do that?

You can’t just reference the choice in the middle, you have to reference every choice.

if/elif/else. Read the above guides by Dara for more.

Don’t apologize, I appreciate it o helpful one :wink: :revolving_hearts:

1 Like

Thank you!

Hey I don’t get it why does this work
if (Female_me) {
NARR
I am the female part
}elif (Male) {
NARR
I am the male part
}

but this doesn’t?

if (Female_me) {
NARR
I am the female part
}else {
NARR
I am the male part
}