ChoiceScript Help!

Hi! So I’m coding a conversation and it goes like this:

*label choice
#Question 1
*goto question1

#Question 2
*goto question2

#You remain silent.
*goto silent

*label middle
Generic character waits patiently for your next question.
*goto choice

*label question1
Blah blah blah.
*goto middle

My question is: how do you make it so that once you click on one of the dialogue options, the last choice is no longer “You remain silent” but instead “You have no more questions”.

I’m pretty sure I’ve read games that did this.

Thank you!

Edit: I’ve accidentally clicked to post the topic while I was still writing it. I apologize if I caused any confusion.

Make the two variant choices conditional on a variable and set it in all the other choices, so you meet the “remain silent” condition initially and the “no more questions” condition after making a choice.

If you want to vary things more based on the order in which choices are selected you may wish to do something fancier, but it’s probably unneccessary here


^ James got it, but here’s a bit of code for that one since I had it typed. You can do a true/false as well, but the number means you can do fancier things if you want (just change how the choiceflag variable is set, or have different numbers. If you *set choiceflag + 1 for instance, you could add more ways the choices will display)

*temp choiceflag 0

Then, have within the choice body:

        *set choiceflag 1
        *goto choice1
        *set choiceflag 1
        *goto choice2
    *if (choiceflag = 0) #You remain silent
        *goto silent
    *if (choiceflag = 1) #You have no more questions
        *goto nextphase
1 Like

Thank you for the quick help! It works. :slight_smile:

1 Like

I recommend always using true/false when you’re definitely only planning on two states; it’s not a problem here but it’s a good habit to be in for when you use and set it in a lot of places. It means that you won’t accidentally set it to a third value by adding 1 in two places.