Nested choices help

I haven’t written this section of code, because I’m not sure how to and I’ve been mulling it over for about two hours now. I’ll try to explain what I intend to do as best as I can.

I need a *fake_choice to go into a nested *fake_choice then go into another nested choice and display the same text regardless of which choice was chosen.

Essentially, if it was a flow chart, it would look kind of like this:

- = - = -

Each option in the nested choice should present unique dialog before it flows into the secondary nested choice. THIS is the part I’m having trouble with.

The last time I made the attempt, I ended up just duplicating text dialogue in order to make it work (which is still not what I’m trying to do) and made a mess of code that I ended up deleting.

It’s for a conversation happening in the associated choice, that moves away from the original conversation and presents options to players that made specific choices well before getting to this choice. If it helps, thinking of it as a conversation within a conversation is how I’m trying to do this.

I can provide code that I do have if you’d like. Like I said, I am not sure how to get this to work.

This is my best guess:

*fake_choice
  #Blah blah
    Blahblablablablab
    *fake_choice
      #Blahblah
        Text one
      #Yadayada
        Text two
      #Lolololol
        Text three
      The text that needs to display regardless of which option was chosen
      *fake_choice
        #Blah

Fake_choice will jump to the text below, so I’d recommend making it a goto and label. It also makes it easier to look through stuff down the line.

so

*fake_choice
 #1
  Text
  *fake_choice (or *choice)
   #A
   text
   *goto blub
 #2
 etc

*label blub
text
*fake_choice

There’s likely more elegant structuring, but this keeps things remotely organized I’d say

I was afraid of that. I guess I shouldn’t avoid labels in code as much as I’d like to.

I’ll leave this open just in case there’s another solution but this is probably the best solution.

Labels can make things a lot easier (and be little easter eggs for code divers).
You’ll get there if no one else has a better solution :slight_smile:
Recommended this before, but looking at other people’s code might be helpful too

In this case I just wouldn’t even know what to look for unfortunately.

I’m perhaps misunderstanding here, but this graph suggests the sequence is linear, in which case why make these choices nested at all?

*fake_choice
    #option_1
        custom reaction/bridge text
    #option_2
        custom reaction/bridge text

*fake_choice
    #option_1
        custom reaction/bridge text
    #option_2
        custom reaction/bridge text

// etc.

i’m thinking the same as fsix. ^^ but i’m also sort of confused by your question as it stands originally.

can you send me the code in question, or post it here if you’re comfortable? i want to make sure i’m not missing anything specific you mean by “nesting” your choices; it sounds like linear choices (as fsix has written an example of) would work fine, but if there is something else you’re wanting to do, it might be easier for me to understand by seeing the actual code you’re wanting to fix.

Flavor text and setting variables related to the conversation

Out of curiosity, why do you want to avoid labels?

Second, have you considered multireplace?

Pretending this is a conversation between two friends catching up with each sub-exchange being a bit of gossip or news, here is an example of what I was thinking.

*temp holiday 1
*temp pet 1
*temp job 1

"How have you been?"

*fake_choice
    # "I actually just got back from holiday."

        "Really? Where did you go?"

        *fake_choice
            # "Japan."
                *set holiday 1
            # "Portland."
                *set holiday 2
            # "Guam."
                *set holiday 3

        "What was it like?"

        @{(holiday) "Very busy. There was so much to do."|"Honestly? I spent most of my time at a bookstore."|"Beautiful. I never wanted to leave."}

        "It must be hard being back."

        "A little. @{(holiday) I think I'm going to take some Japanese lessons. I want to learn more about their culture.|But I've got a suitcase of books to console me.|Scratch that, extremely. I'd love to live there.}"

    # "I just adopted a pet."
        *comment fill in later

    # "I started a new job."
        *comment fill in later

Does that align at all with what you’re trying to do?

I had the same thought earlier actually and ended up just using a label.

In this particular instance, I’m trying to avoid the label only because I think it would help me stay more organized in my code. Rather than having two pieces of one conversation in two places, they could both be in the same place which makes it easier for me to find.

You can use labels inside choices. I frequently have one option jump to another with a goto or gosub.

# A 
    Text 
    *label shared_text

    More text
# B
    Text

    *goto shared_text

Unsupervised is a great case study for that if you want to observe it in the wild!

Dope. I’ll be doijg this in the future