This dialogue for my "if" isn't showing up in my story




So in my story, when I pick the option to dodge earlier in the story, this later option of dialogue shows up when Archer wants to tell Athena about school. But when I click in the story earlier to hit, it skips over this dialogue. and goes straight to “Anyway” I am confused as to why it skipping over this.

1 Like

have you used the “elif” twice? in your second screenshot, I’m seeing it used twice for the same dialogue

1 Like

Yeah, I used it three times in a row. Sorry I am new to these commands. Do I use else instead or do I use if? Is my coding even right?

1 Like

I think I can help :heart:
When you hit preview are you starting from the beginning or starting from that choice?
When you preview from the beginning It will start from the beginning and goes to else because it cannot remember a choice.
If you preview from the label that that choice goes to you can see “the outcome of that choice”.

If,elif,else code looks like this for example

If(LI_boy){

goto male_LI_branch

}elif(LI_girl){

goto female_LI_branch

}else{

goto nonbinary_LI_branch

}

(If you have more options than 3 elif can be used multiple times in the same template, for example 4 options you would use if elif elif else ect… If you have less you would use if else. I recommend checking out Dara Amarie’s website)
https://www.dara-amarie.com/remember-choice

For example if I preview from the beginning of my script it will start on the Lable nonbinary_LI_branch because else literally means anything else so because it can’t remember a choice it goes straight to else.
If I want to preview Label female_LI_branch I have to scroll down to where that Lable starts (I like to use the scenes tool for this cuz it makes it faster) and make sure my cursor is on it and then hit preview, then it will preview that label. (It will say previewing from line 5225 or something like that)

The other way you can check is to use your phone and go into the app to preview your story it will then remember the choice you made and you can check out if your code works that way.

1 Like

Yes, I previewed it on my phone and it won’t remember the code when I select hit instead of dodge. I don’t know if it’s because I have the “hit” command and the “BROTHER AFTER FIGHT” command together.

1 Like

So the method you are using is choice naming, I have yet to use this method but I understand it a little bit.
After "if fight is “Hit” you don’t have anything happening because that choice it is empty underneath…
For example it would look like this:

If (fight is "Hit") {

Character does action/says something ect...

}elif (fight is "doge"){

Character does action/says something ect...

}else{

Character does action/says something ect...

All the labels have to match as well so “brother after fight” can’t have spaces in between it has to look like this: “brother_after_fight”

And if you need the choices nested together, choice naming might not be suitable, I would use regular if, elif, else code for that. I can show you how I would do that as well if you want :heart: (I have done nested choices before)

1 Like

Thank you so much, when I get back on my laptop I will try this and see if it fixes it.

1 Like

Yea, it didn’t work. How do I nest choices?

1 Like

Well nesting choices just means putting a choice within a choice, so what are you trying to do?
Are you trying to make different choices within actions in dialogue or are you trying to make a nested choice?

What didn’t work specifically?

1 Like

So, it’s hard to explain, but I am kind of merging outcomes. So, what is not working specifically is the if choices: if (FIGHT is “Hit”) and if (BROTHER_AFTER_FIGHT is “Who’s safety do you care about more? Me or hers”). Above (in the screenshots) for one of the outcomes, I am trying to do dialogue for, Athena hitting her mom and yelling at Archer, but these are under two different choices.

1 Like

so if it’s more than 3 choices, you keep using the “elif” and then the last choice would be “else”

have you used the “if” after the “elif” in your last screenshot? the code won’t work as it must always be if/elif/else - it looks like yours is going if/elif/elif/elif/if from what I can see in the screenshots.

I am in no way very well versed in coding myself, I do recommend visiting dara.amarie’s website if you need the extra help, as mentioned by Mirwen.

best of luck!

1 Like

I will have to admit that I am confused :woman_facepalming:

I recommend checking out Dara Amarie’s website It has guides and templates that walk you through the coding.

I will try to help as much as I can but I’ll have to take a look at the screenshots again :heart:

1 Like

The if elif else code choice names don’t match and are not in the correct order.

The choice name “fight” and the choice name “brother_after_fight” can’t be used together, they are two different “labels”

If (fight is "Hit") {

Character does action/says something ect...

}elif (fight is "doge"){

Character does action/says something ect...

}else{

Character does action/says something ect...

They are separate choice sections

If (brother_after_fight is "safety") {

Character does action/says something ect...

}elif (brother_after_fight is "grateful"){

Character does action/says something ect...

}else{

Character does action/says something ect...

3 Likes

If I am understanding you correctly, you want to have a specific branch for the scenario where the reader chooses two specific answers to two past choices. If that is correct, I know there is a way to “merge” flags (i.e., take 2+ gains into account when branching). For that, you can check out this thread. However, I am not sure if this trick works for the “Choice Naming” method of remembering choices, which appears to be what you’re using here. If it does not, you would have to nest the branching as others have said.

3 Likes

OH MY GOD THANK YOU SO MUCH. I was about to break my computer. It was just as simple as separating it.

1 Like

Hey, sorry to come here days later, but i have another question. When someone clicks dodge, they still see the BROTHER AFTER FIGHT choice. How do I make them not see this choice.

No worries!
Move where the choice is in your script.

Unfortunately it’s hard for me to visualize what’s going on if you could send me a screenshot that would be helpful :heart:

1 Like






Sorry, this is kind of lot.

1 Like

In the first image you have if twice instead of if, elif, did you mean to do that?

Second you have the "brother after fight"choice listed after the completed “doge” choice. Do you want it to not show up if “doge” is selected?

1 Like

I did not mean to do that, thank you. And yes, if one selects dodge, I don’t want them to see this choice after completed.

1 Like