If/else within a choice parameter

I’m trying to make it so that when interacting with a character it looks like this

*choice
"text
*if not selected previously then response 1
*else response 2

help please it’s about 11:30 pm and I have coding and writer’s block

So, you’re trying to do if checks which will lead to either response 1 or response 2? Like this?
*choice
#You decide to go along with {Name}.
*goto response1
#You decide to go along with {Name}.
*goto response2

If not, I am sorry, I did not understand correctly.

Elaborate and explain more please.

What do you mean with “selected previously”?

It’s probably a good idea to get a rest, first. Forcing yourself in an un-fit condition is a bad idea.

But eitherway, I assume you want a different response based on a choice the reader previously make?

*choice
   #Opt A
      *set hmm true
   #Opt B
      *set hmm false


*if hmm
   Hmm... it's true...
3 Likes

I think you need to create a variable that tracks the if the option has been chosen

*temp met false 
*label hi
*fake_choice
    *if (met = false) # This option appears first time
        *set met true
        *goto hi
    *if (met =true ) #This option appears second time
        *goto bye 

*label bye
2 Likes

You want a boolean to check that for you. The coding should look something like this:

*temp choice_selected false

Narrative things happen here.

*choice
    #I want to do this.
        *if choice_selected
            You already did the thing!
            *goto top
        *else
            You do the thing and it is exceptional fun!
            *set choice_selected true
            *goto top
    #I want to leave.
         You've done all that you possibly could. You sit down and end your game.
        *finish

[Edited to add]
I find this is a very useful tool in my CS games. In particular, when questioning one of the characters, she’ll answer you earnestly the first time, and refuse to repeat herself when you ask her the same question, opting rather to make a snide remark about your intelligence.

Sounds like a perfect opportunity for multireplace: New features in ChoiceScript: change text size/color, hyphen spacing, @{} variable replacement

3 Likes