If/Else not working properly

Hi, me again. So I’ve been trying to follow a guide for if/elif/else, and I had to not use it because no matter who I chose in my scenarios, it was just the same character.

This is how I had the code:

Even with the Roman dialogue, it still showed up on my phone as Blake. I reset story progress, I chose Roman to test it out (I fixed the choices in the same order they were, because I gave the option for readers to skip a scene and choose who helped out in the scene) and both dialogues were all Blake. What am I doing wrong?

ppls show me also the choice

Give me a moment, let me screenshot everything

Okay, so this is when you can skip the scene, and what happens after with the if/else (for both screenshots, the dark purple means that’s what I chose):

And this is when you can read the scene and choose Roman:

In my script, the if is Roman, and the else should be Blake (at least that’s what I imagine), and I followed the instructions for both, but I’m not sure what I did wrong.

Edit: Not entirely sure why the last set of screenshots are out of order

I meant the code for the choice. :smiley:

I just want to check if you have the gains set right

also do I get it right that you have 2 choices where reader can choice Roman/Blake?

  1. who helped you
  2. whoom to call

?
Then I need to see both choices - the coding

OH I am so sorry :sob: :sob:

Here:

This is the read or skip code. If you choose read, then you have the love interest options shown here:

And that’s where those choices are done if you read it. The ones below are the options if you skip the scene:

Also I read about the gains, but I’m still new to coding, so I’m not sure how to actually do them.

I don’t see all lines of the choice but in the one where you ask “who helped you”

you do not have any gain here so this choice will not be remembered - so …why you have it there?

Maybe just describe to me what you want to have - since it seems time unclear.

which choice is the one you need to be remembered?

gains are for remembering choices

so very simply on an exapmple:

NARR
Whom should I call?
choice
“Roman”{
gain call_roman
} “Blake”
}

you use the gain name as a condition of the if-else

if (call_roman){
¨#here add scene with Roman
}else{
#here add scene with Blake
}

Okay, so basically:

If the reader chose to skip the scene, and they choose who helped them, if they chose Roman, I want the next scene for them to be texted by him. If they chose Blake, they get texted by Blake. Both have different dialogue.

Same with if they choose to read the scene. I’m sorry I don’t know how to explain this, but if I can’t make this happen, then I have a backup that doesn’t involve any of the options having different outcomes. So no worries!

Okay, let me try this out for both and see what happens.

then you need to have gains in both this choices to make the if/else work properly

AH, okay, that worked. I really feel dumb now for not realizing that the first time :sob: Thank you so much!

1 Like

nah dont say that - you are just learning. :smiley:

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