Help with deep branching/coding

Okay, I was wondering how to code this.Ive done basic gains before but not sure how to go about this.

Let’s say I gave the reader the choice to kiss Jose or not kiss him.
So they kiss Jose.
Then they had the choice to kiss Tommy.
They kissed Tommy.

How would I go about to bringing their remembered choice like this in dialogue?

Tommy: You kissed me after kissing Jose too?!
Tommy:How could you kiss me and him?
Liam: You seriously kissed Jose and Tommy?

Or
Liam:So I heard you kissed Jose, but you rejected Tommy…
Tommy is pretty heart broken.

Btw these are just random names i made up🤣
Hope I’m being clear.

So let’s say these are the flag names: kissed_jose and kissed_tom

if (kissed_jose) {
if (kissed_tom) {

#dialogue for kissing both jose and tommy

} else {

#dialogue for kissing jose but not tommy

}
} else {
if (kissed_tom) {

#dialogue for not kissing jose, but they kissed tommy

} else {

#dialogue for not kissing anyone

}}

2 Likes

This is helpful!I see that there are 2 elses that have no gains right next to it.The last one makes sense to me but im confused by the 1st else.Would I put if kissedjose on the 1st else or leave it like the way you had it?

And I figured that same method would apply with choosing an option right?
(Had a previous choice from ch 2 to kiss/reject Jose or kiss/reject Tommy)

Ch6
*go to park with Jose.
Or
*go to park with Tommy
If Jose_park
If Tommy_kiss
insert scene here

If Jose_park
If Jose_kiss
insert scene here

If Tommy_park
If Tommy_kiss
insert scene

(Else)If Tommy_park
aka you kissed no one
(Else) If Jose_park
aka you kissed no one

Not a perfect format but hope that’s clear to where I’m getting at &if I’m doing it right.

bump :hugs:

An “else” is “anything that is not the gain”. And the reason for the multiple else’s in my example is because there are if/else’s inside an if/else

1- the red text is the main if/else. So the red “else” is if they didn’t kiss jose.
2- the blue text is the if/else inside the “kissed_jose” branch, so those outcomes are for if they kissed jose and kissed tom or didnt kiss tom
3- the green text is the if/else inside the branch where they didn’t kiss jose, so the outcomes are if they didn’t kiss jose but they did kiss tom, or they didn’t kiss either jose or tom

if (kissed_jose) {
if (kissed_tom) {

#dialogue for kissing both jose and tommy

} else {

#dialogue for kissing jose but not tommy

}
} else {
if (kissed_tom) {

#dialogue for not kissing jose, but they kissed tommy

} else {

#dialogue for not kissing anyone

}
}

1 Like

bumping cause ill need later.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.