Dialogue based on certain choice

I’m hoping this will make sense: Is there a way to make the text say something different based on if you selected a certain choice earlier for example this is what i’m kind of trying to do:

*choice
#Spy on her
*goto spyliv1
#Just go home
*goto gotohome2

*label scarletherring1
*if spyliv1 selected = true
*set dialogue2 “you realize it’s the same man you saw talking to Liv earlier”
“${dialogue2}”

yes, I do have the dialogue2 variable set

You can try with multireplace…

Otherwise, you can create a variable and check if it was activated or not and use it with an *if *else to show different texts.

1 Like

So, it depends on how exactly you want to do it. Also I’m not exactly understanding the intention of your code.

Assuming this is everything, this is probably how I would do it. There may be better ways, but this is what comes to mind rn. As mentioned by someone else, multireplace is a good option if it works for your situation.

If you only need to take into account choosing to spy on her:

*choice
    #Spy on her.
        *set spyliv1 true
        *goto scarletherring
    #Just go Home
        *set choice 2
        *goto scarletherring
*label scarletherring
*if spyliv1
    "Whatever text here"

With multireplace:

*choice
    #Spy on her.
        *set spyliv1 true
        *goto scarletherring
    #Just go Home
        *set choice 2
        *goto scarletherring
*label scarletherring
@{spyliv1 “you realize it’s the same man you saw talking to Liv earlier”|}

If you want to consider every single choice there, I’d do something like:

*choice
    #Spy on her.
        *set var1 1
        *goto scarletherring
    #Just go Home
        *set var1 2
        *goto scarletherring
*label scarletherring
*if var1 = 1
    "Whatever text here"
*if var1 = 2
    "Alternative text here"

With multireplace:

*choice
    #Spy on her.
        *set var1 1
        *goto scarletherring
    #Just go Home
        *set var1 2
        *goto scarletherring
*label scarletherring
@{var1 "“you realize it’s the same man you saw talking to Liv earlier”"|"Text if you went home"}

Alternative ways of doing it, if you want to set the dialogue variable

*choice
    #Spy on her.
        *set dialogue2 “you realize it’s the same man you saw talking to Liv earlier”
        *goto scarletherring
    #Just go Home
        *goto scarletherring
*label scarletherring
"${dialogue2}"
1 Like

Yes, it is possible to make the text say something different based on the choices selected earlier However, there are a few adjustments you need to make to your code to achieve the desired result. Here’s an updated version of your example

*choice
  #Spy on her
    *set spyliv1 true
    *goto scarletherring1
  #Just go home
    *goto gotohome2

*label scarletherring1
*if (spyliv1)
  *set dialogue2 "You realize it's the same man you saw talking to Liv earlier."
  ${dialogue2}

In the above code, the variable spyliv1 is set to true when the choice “Spy on her” is selected. Then, when the player reaches the scarletherring1 label, the *if statement checks if spyliv1 is true. If it is, the variable dialogue2 is set to the desired text. Finally, ${dialogue2} is used to display the contents of the dialogue2 variable.

Make sure you have defined and initialized the spyliv1 variable before the choice block for it to work

note that the code provided assumes you have set up the other sections of your game correctly. Adjust the labels and variable names as needed based on your specific implementation, I hope that helps!

3 Likes

Thank you!

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.