Problem with coding a script that uses if/else/elif

Hello all.
I have a problem.
I have a scene where character chooses the wedding dress among different outfits and the one she chooses needs to be memorized by the script for the chapter where there is going to be the actual wedding, and she will be wearing the dress the reader chosed, but I have no clue what do I need to do to make it happen.
I used Joseph Evanses template but don’t know how to turn it into script with gains that will actually remember the readers choice for when I’m going to need it (not in the same episode).
I am copying the script under if there is some good soul willing to help me out with this.
Thank you so much <3

@DOLL spot 0.840 65 210 in zone 2 at layer -2 AND DOLL faces left

@DOLL1 spot 0.840 164 210 in zone 2 at layer -1 AND DOLL1 faces left

@DOLL2 spot 0.840 262 210 in zone 2 at layer 0 AND DOLL2 faces left

@DOLL starts idle

@DOLL1 starts idle

@DOLL2 starts idle

@DOLL3 spot 0.840 65 210 in zone 3 at layer -2 AND DOLL3 faces left

@DOLL4 spot 0.840 164 210 in zone 3 at layer -1 AND DOLL4 faces left

@DOLL5 spot 0.840 262 210 in zone 3 at layer 0 AND DOLL5 faces left

@DOLL3 starts idle

@DOLL4 starts idle

@DOLL5 starts idle

@CHAR1 spot 0.920 -100 148
@CHAR2 spot 0.920 -110 148
&CHAR1 walks to spot 0.920 77 148 in zone 1 in 2 and CHAR1 faces right and CHAR1 is walk_neutral_loop
@CHAR2 walks to spot 0.920 186 148 in zone 1 in 2 and CHAR2 faces right and CHAR2 is walk_neutral_loop
(DIALOGUE)

@pan to zone 2
@pause for a beat
@pan to zone 3
@pause for a beat
@pan to zone 2
@zoom on 320 270 to 231% in 3

label outfit1

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“Next outfit -->”{

@zoom on 490 270 to 231% in 0.5

goto outfit2

}
“Choose outfit 1”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label outfit2

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“Next outfit -->”{

@zoom on 640 270 to 231% in 0.5

goto outfit3

}
“<-- Previous outfit”{

@zoom on 320 270 to 231% in 0.5

goto outfit1

}
“Choose outfit 2”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label outfit3

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“Next outfit -->”{

@pan to zone 3 in 0.5

goto outfit4

}
“<-- Previous outfit”{

@zoom on 490 270 to 231% in 0.5

goto outfit2

}
“Choose outfit 3”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label outfit4

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“Next outfit -->”{

@zoom on 800 270 to 231% in 0.5

goto outfit5

}
“<-- Previous outfit”{

@pan to zone 2 in 0.5

goto outfit3

}
“Choose outfit 4”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label outfit5

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“Next outfit -->”{

@zoom on 960 270 to 231% in 0.5

goto outfit6

}
“<-- Previous outfit”{

@zoom on 640 270 to 231% in 0.5

goto outfit4

}
“Choose outfit 5”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label outfit6

@pause for a beat

    NARRATOR
This one?

choice (outfit)
“<-- Previous outfit”{

@zoom on 800 270 to 231% in 0.5

goto outfit5

}
“Choose outfit 6”{

    NARRATOR 
This one is my favourite.

goto chose_dress

}

label chose_dress

@cut to zone 1

Is this the dress you want to wear?

choice
“Yes, that dress is stunning!”{
CHAR1 (talk_excited_happy)
Yes, that dress is stunning!

}
“Not anymore! Let me have another look!”{
CHAR1 (think_rubchin)
Not anymore! Let me have another look!

@CHAR1 faces right and CHAR1 is idle
@pan to zone 2

@zoom on 320 270 to 231% in 3

goto outfit1

}

(DIALOGUE)

if (outfit is “Choose outfit 1”){

@CHAR1 changes into WEDDING DRESS

}elif (outfit is “Choose outfit 2”){

@CHAR1 changes into WEDDING DRESS1

}elif (outfit is “Choose outfit 3”){

@CHAR1 changes into WEDDING DRESS2

}elif (outfit is “Choose outfit 4”){

@CHAR1 changes into WEDDING DRESS3

}elif (outfit is “Choose outfit 5”){

@CHAR1 changes into WEDDING DRESS4

}else{

@CHAR1 changes into WEDDING DRESS5

}

You can add gains in here

Then when you need to remember it:

if (weddingdress1){

@CHAR1 changes into WEDDING DRESS

}elif (weddingdress2){

@CHAR1 changes into WEDDING DRESS1

}elif (weddingdress3){

@CHAR1 changes into WEDDING DRESS2

}elif (weddingdress4){

@CHAR1 changes into WEDDING DRESS3

}elif (weddingdress5){

@CHAR1 changes into WEDDING DRESS4

} elif (weddingdress6){

@CHAR1 changes into WEDDING DRESS5

}

And it should work

hi you already have in your script if/elif/else which remembers the choice

so what is the problem is it not working right?

Your if/elif/ ele is based on naming choice which works more the less the the same way as gains.

I was not testing the script itself but if thi ef elif else you have works fine than you no not need an other changes niether adding gains.

Thank you so much!!! I will try it out now and let you know <3
So basicly for any kind of choice that we want the script to remember I just put gain and then If/elif?

1 Like

The choice works for that chapter but not for the chapter when I need it again.
Now she is trying out the dress and script remembers it for this chapter but in like 3 episodes from now I will need the dress the reader choses on the actual wedding and the script doesn’t remember the correct dress but just randomises inbetween the ones she was trying on in previous episode.

That is not true if you will use the same if elif else in later chapter it will work the same way.

There are 3 ways how to make script remember choice.

  1. naming choice - that is what you have
  2. gains
  3. point system

and for all 3 you will use if/else to make alternations based on the remembered choice

Exactly!

Well it’s not working…so what should I do?

is it not working in this chapter on in the next one?

If only in the next one that if you test it in portal it is normal because portal works differently than the app and portal doesnt remember any choices.

To test it earher test it in app in your phone or use the storymodifiers … you see this option on the preview window… there you can simulate the previouse choices for testing.

more to how to remember choices

also as dara explains named choices and gains do not usually work with dressing games because of the labels that alow reader to go back to choice and pick up different option. Dara has there also explanation how to solve this including template ( in case it is not working even in the first chapter)

1 Like

If you are testing using the portal, it will not be able to access any data from choice names in previous episodes. It similarly will not have access to flags or character points, although they put in a random override. You’d have to test it on your phone in order to determine that it works. Additionally, if you turn on the picker in the preview, it will let you test the outcomes of different options by prompting you to select which branch you want to follow. Choice names should still work several chapters later, they’re just a bit harder to test.

Hope that helped! Good luck with your story

It works on this episode. Not in the next one.

then it is just the problem of that portal doesnt remember any choices … use the modifiers as I told you it should work with them.

Am reading daras explanation and am still not getting if its better to use if/elif/else for this scene or flags?
I don’t have any other choices in this chapter or dressing games

I will try but need to figure out where modifiers are

Thank you so much yes I was testing from the portal. Where do I find the picker?

when you see the preview window it is on the right side

So I leave the script the way it is now in this chapter and when I get to actual wedding scene I just put this in the scene

if (outfit is “Choose outfit 1”){

@CHAR1 changes into WEDDING DRESS

}elif (outfit is “Choose outfit 2”){

@CHAR1 changes into WEDDING DRESS1

}elif (outfit is “Choose outfit 3”){

@CHAR1 changes into WEDDING DRESS2

}elif (outfit is “Choose outfit 4”){

@CHAR1 changes into WEDDING DRESS3

}elif (outfit is “Choose outfit 5”){

@CHAR1 changes into WEDDING DRESS4

}else{

@CHAR1 changes into WEDDING DRESS5

}

Right?
P.s. where do I put it? Instantly at the begining of the scene after the background or?

if you want to wear the dress from start of the scene that place it among first things under the backgroud it can be before you even spott her on scene

If you click on the “navigation” button on the right side of the screen, the picker should be the bottom thing on the menu that pops up.