How to remember past choices?

These are the choices I added to my story:
choice
“The Classic My Grandma is Sick Excuse”
“The Aunt Sallie is Sick Excuse”
“Use what you learned from drama class”
“Ain’t got no time to talk”

So how should I coded these choices for the script to remember past choices later on? I’m trying to make it impact the story.

@ViviOfficially,

The easiest way in my opinion is by using gains. Basically to remember using gains you will add gain some_choice. You can out this gain anywhere inside your choice option. I prefer putting it at the end so that it is out of the way. To recall the gain you will use an if statement to remember the choice.

For example:
CHARACTER (talk_think)
Should I go to the party on Friday?
choice
“Excited Yes”{
CHARACTER ( talk_excited)
I am definitely going to the party.
gain excited_party #Here is the gain to remember excited yes.
} “Sure”{
CHARACTER ( talk_shrug)
Sure. I guess I’ll go.
gain sure_party #Here is the gain to remember sure.
}“No”{
CHARACTER (talk_arms_crossed)
No way am I going to that party.
gain no_party #Here is the gain to remember no.
}

A few scenes or chapters later.

CHARACTER2 (talk_gossip)
Are you going to the party tonight?
if (excited_party) {
CHARACTER (talk_excited)
I wouldn’t miss it for the world!
}elif (sure_party){
CHARACTER (talk_shrug)
I have nothing better to do, so I thought why not.
}else{ #You can use else because else basically means anything not previously mentioned.
CHARACTER (talk_shrug)
Parties aren’t really my thing.
}

For 4 choices just add another elif to the middle.

1 Like

I’ll just do a different example to the above comment using your choices.

AMY
(What should I do?)

choice
“Use The My Grandma Is Sick Excuse”{
AMY (talk_sad_timid)
Sorry miss, I couldn’t do my homework because we spent the weekend visiting my sick grandma.

gain excuse_grandma
}
“Use The Aunt Sallie Is Sick Excuse”{
AMY (talk_sad_clutch)
Sorry miss, I don’t have my homework because we were visiting my poorly Aunt Sallie all weekend.
gain excuse_auntsallie
}
“Use What You Learnt In Drama Class”{
AMY (cry_sob)
I – M-My friend from Applegrove High, Amara, got in a car accident – and – she – …

gain excuse_drama
}
“Ain’t Got Time To Talk”{
AMY (talk_apathetic)
Sorry miss, I’ve got better places to be than in this classroom!

gain excuse_sassy
}

of course more speech, action, scenes can be added.
then later on…

if (excuse_grandma){
MUM
Amy, why did I get a text this morning from Mrs Smith with condolences of Nana being sick?
}
elif (excuse_auntsallie){
MUM
Amy, why did Mrs Smith send me a text hoping that Aunt Sallie would get better soon?
}
elif (excuse_drama){
MUM
You don’t even know anybody called Amara! Why are you making lies about something as serious as a car accident?
}
(For the last branch, you can either use “else” or another “elif”. Both will give the same result. I’m gonna use else.)
else {
MUM
Why are you here, Amy? You’re meant to be in detention for being rude to Mrs Smith!
}

I hope this helped you!
If you ever need help, I can help you with just about everything except sound and music :joy:

1 Like

Omg I finally got some of the choices to work! tysm! Is it normal for one of the choices to remember choices that are not been chosen? Like let say that I coded an elif for Aunt Sallie, but later in the story… it remembers the sick grandma excuse instead even though it is not been chosen. I have been stumped on that problem all morning :frowning:

1 Like

Omg I finally got some of the choices to work! You are right, the gains are so easier! But is it normal for one of the choices to remember choices that are not been chosen? Like let say that I coded an elif for Aunt Sallie, but later in the story… it remembers the sick grandma excuse instead even though it is not been chosen. I have been stumped on that problem all morning :frowning:

@ViviOfficially,

So without playing through the whole of the chapters that contain the choice and if statement, it will by default grab and use the else statement. If there is no else statement, I think it skips the entirety of the if statement. I would assume that as long as the code looks correct, it will run correctly for the reader.

But the thing is, it is on the same chapter. So let’s say I clicked on choice three, but it remembers choice two. In the script I used elif for both of these choices. Could that be the problem?

@ViviOfficially,

No, that wouldn’t be the problem. The way an if, elif, else function works is it goes down the list looking for the matching phrase; once the matching phrase is found, the function is stopped. elif really means else if. So it works just like an if. If the phrase is not the exact phrase it is looking for, it will not stop and grab it.

I don’t know what the issue may be, but make sure the phrases are exactly like your gains.

And I don’t know if you are doing this, but if has to be partnered with an elif and/or else.

@Purple_Ghost I finally got all the choices to work smoothly now :slight_smile: thanks for the help

Is it because you’ve tested the grandma “route” before? Since it comes before Aunt Sallie in the coding it remembers you’ve done it before. Go to “navigation” on the side then “reset story progress” and you’ll have to do this between every test

1 Like

Yes, it makes so much sense now :upside_down_face: I renamed the phrase, thinking it has to do with the phrase

Closing due to one month of inactivity :slight_smile: