Multiple *statements for each #option

Just a quick question…I’m sure the first comment will answer my question…

So, there are some extra *statements that can come before #options and stuff, like *hide_reuse and *selectable_if, and I think just normal *if

So, how can I use more than one for a single #option? What would that look like?

(For example, if I wanted to use a *selectable_if to detect if the age-range is acceptable for the option, and also normal *if to hide the option if it had already been done)

After some simple testing in both CSIDE and a ChoiceScript installation that was up-to-date in July of this year, it seems entirely possible to do what you’re asking. For example:

*fake_choice
    *hide_reuse *selectable_if ((age >= 25) and (age <= 34)) #I say I'm in the 25–34 age bracket.

Or even:

*fake_choice
    *if ((age >= 25) and (age <=34))
        *hide_reuse *selectable_if (silent = false) #I say I'm in the 25–34 age bracket.

However… It completely fails if the *hide_reuse and *selectable_if statements reverse position. It’ll throw an error message about “Couldn’t parse the line after…” and crash to a halt. The *hide_reuse must come first.

1 Like

I took your answer and tweaked it (because I’m not looping the scene, I’m coming back to it from other scenes), so now it works.

       *if (visitrelative = "false") 
            *selectable_if (v620liable = "true") #1. A Familial Experience
            *comment Relatives Visit (6-20)
            *gosub add8months
            *goto_scene visitrelative
        *else

Thanks for the help!

1 Like

I think the *gosub and *goto_scene may require one more level of indentation, to ensure they’re triggered by the option instead of the *if statement? Something like this, maybe:

       *if (visitrelative = "false") 
            *selectable_if (v620liable = "true") #1. A Familial Experience
                 *comment Relatives Visit (6-20)
                 *gosub add8months
                 *goto_scene visitrelative
        *else

I mean, whatever works.

I tried it without extra indentation and it was fine.

1 Like

The best way to deal with it, really.

Now this is new.
A pickable blank option?