Struggling with past choices!


#1

Goodnight everyone. Lately I am struggling to make the script remember an outfit that I chose.

In the third scene of chapter 4, I put a label dressing_game. After that another scene and them a flashback follows (where I made the character change to another outfit).
After of that scene, I would like the character wear the outfit that I selected previously, but the character is still using the outfit I put in the flashback., Although I put the code to remember past choices. Could it be that I’m missing a piece so that it works as I want? (All in the same chapter.)

My coding:
label dressing_game

    ERNESTO (idle)
(What should i wear today?)

choice (ERNESTO)
“Outfit1”{

@ERNESTO stands screen center in zone 1

@ERNESTO changes into ERNESTO_default

gain Outfit1
}
“Outfit2”{

@ERNESTO stands screen center in zone 1

@ERNESTO changes into ERNESTO DOS

gain Outfit2
}
“Outfit3”{

@ERNESTO stands screen center in zone 1

@ERNESTO changes into ERNESTO TRES

gain Outfit3
}
“Outfit4”{

@ERNESTO stands screen center in zone 1

@ERNESTO changes into ERNESTO CUATRO

gain Outfit4
}
“Outfit5”{

@ERNESTO stands screen center in zone 1

@ERNESTO changes into ERNESTO CINCO

gain Outfit5
}

@ERNESTO stands screen center in zone 1

@pause for a beat

    ERNESTO (think_rubchin)
(I look like a beggar with this outfit?)

choice
“Wear this outfit.”{

    ERNESTO (talk_pointup_happy)
(Well, at least i look decent!)

}
“Try something else.”{

goto dressing_game

}


EXT. SPANISH TOWNSQUARE 4 - DAY

if (Outfit1 is “ERNESTO_default”){
@ERNESTO changes into ERNESTO_default
}elif (Outfit2 is “ERNESTO DOS”){
@ERNESTO changes into ERNESTO DOS
}elif (Outfit3 is “ERNESTO TRES”){
@ERNESTO changes into ERNESTO TRES
}elif (Outfit4 is “ERNESTO CUATRO”){
@ERNESTO changes into ERNESTO CUATRO
}elif (Outfit5 is “ERNESTO CINCO”){
@ERNESTO changes into ERNESTO CINCO
}


#2

The last elif should just be else:

if (Outfit1 is “ERNESTO_default”){
@ERNESTO changes into ERNESTO_default
}elif (Outfit2 is “ERNESTO DOS”){
@ERNESTO changes into ERNESTO DOS
}elif (Outfit3 is “ERNESTO TRES”){
@ERNESTO changes into ERNESTO TRES
}elif (Outfit4 is “ERNESTO CUATRO”){
@ERNESTO changes into ERNESTO CUATRO
}else{
@ERNESTO changes into ERNESTO CINCO
}


#3

Hello! I tried what you told me but there was another problem. For example, I select outfit 3 but in the other scene the character comes up with the outfit 5. What can I do in that case?

I replaced the code in this way, and the script tells me Unexpected BLOCK_BEGIN: {

if (Outfit1 is “ERNESTO_default”){
@ERNESTO changes into ERNESTO_default
}else{
@ERNESTO changes into ERNESTO DOS
}else{
@ERNESTO changes into ERNESTO TRES
}else{
@ERNESTO changes into ERNESTO CUATRO
}else{
@ERNESTO changes into ERNESTO CINCO
}


#4

All of the middle ones should still be elif. Just the last one should be else.

if (Outfit1){
@ERNESTO changes into ERNESTO_default
}elif (Outfit2){
@ERNESTO changes into ERNESTO DOS
}elif (Outfit3){
@ERNESTO changes into ERNESTO TRES
}elif (Outfit4){
@ERNESTO changes into ERNESTO CUATRO
}else{
@ERNESTO changes into ERNESTO CINCO
}


#5

The format inside the parentheses should be:
(choice_name is “Option”)

ERNESTO is the choice name and the choice option should be inside the quotes just like in the choice.

if (ERNESTO is “Outfit1”) {

} elif (ERNESTO is “Outfit2”) {

and so on…


#6

Thank you so much, it works perfectly!


#7

You may not get any errors when you change the else’s back to elif’s but you need to do what I said above. Because the way you formatted what’s inside the parentheses is not correct and that is why your character isn’t changing back into the outfit that was chosen.


#8

Thank you Dara! :smiley:


#9

I want to give you credits, the code you gave me worked. :smiley:


#10

You don’t have to give me credits for this code, but if you would like to you can credit to @purple_ghost13. :purple_heart: