So I have been using Sara’s tappable outfit choices but I am stuck in one thing is that how can we remember the outfit choice we made?
I am changing my one characters outfit two times in one episode one in past and present so how should I remember present outfit choice that I made? Can anyone plzz helppp
hi! try this out the if/elif/else:
To remember a choice you must use the if/elif/else coding, which looks like this:
if (condition_1) {
} elif (condition_2) {
} else {
}
if is always first, elif is always in the middle, and else should always be the last one by itself with no condition next to it; else is anything that isn’t the other conditions.
if you have 2 options, you only need to use if and else
if (condition_1) {
} else {
}
if you have 3 options, use if then elif then else
if (condition_1) {
} elif (condition_2) {
} else {
}
if you have more than 3 options, keep using elif for the middle parts, but always make sure that if is first and else is last
if (condition_1) {
} elif (condition_2) {
} elif (condition_3) {
} elif (condition_4) {
} else {
}
I did this but no use
have you tried the Flags/Gains??
No how to use flag?
choice
“Option Title” {
gain flag_name
}
To remember a choice using flags, you must use the if/elif/elsecode with only the flag name inside the parentheses for the if’s and elif’s:
if (flag_name1) {
} elif (flag_name2) {
} else {
}
Example:
NARRATOR
What do you want to drink?
choice
“Orange Juice” {
gain orange_juice
} “Coffee” {
gain coffee
} “Water” {
gain water
}
Then later on in the story, I’d use the if/elif/else code to remember which drink option a reader chose:
if (orange_juice) {
CHARACTER
Yuck! I hate pulp in my orange juice!
} elif (coffee) {
CHARACTER
I always need a cup of coffee in the mornings!
} else {
CHARACTER
Nothing is healthier than just water.
}
Things to remember:
- Once a flag is gained, you cannot “un-gain” it.
So be sure to not use this method with dressing games. If you do, you will need to put a “yes/no” choice inside each outfit option with the flag inside the “yes” choice.
i recommend on visiting https://www.dara-amarie.com she has a bunch of templates and help
Ok I will try this one
I actually think that assigning points is the easiest way to do this, since flags cannot be ungained which can make dressing games a bit tricky!
Take a look at this code for example. She assigns points to outfits (when she changes into outfit 1, outfit =1) and so on and so forth. Then later on, you can code
if (OUTFIT =1) {
} elif (OUTFIT =2) {
} else {
}
To remember the choice you’ve made. Hope this was all clear!
It worked gain method but it won’t be any problem after I publish the story?
Hey it worked the gain method but it won’t be any problem after publishing it right?
no there shouldnt be a problem
Outfit = 1 where should we add this?? In Sara’s code?
No, outfit was just an example. Your code already has the point system built into it, where it says COCO =1 so you don’t have to change anything! The code you’re using uses those numbers so it will remember the outfit in the future. Just use
if (COCO =1) {
} elif (COCO =2) {
} else {
}
And it should be remembered in the furure. Take out the “outfit =1,” that isn’t necessary since I didn’t realize your original code had points built into it.
Okkkk got it thank you
Thank you
np!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.