Question about locking/hiding choices behind achievements

Greetings,

I’m currently working on my first choicescript based game. I’m still new and still learning, but i’ve grasped most of the basics already and crave for more advanced features that I’ve yet to discover. My question is if it’s possible to lock/hide a choice until you’ve managed to get a certain achievement which would only be possible later on in the story. This is to encourage multiple playthroughs.

Or maybe there’s a different way to do it? Any help would be appreciated.

Edit: I tried the *check achievements + *selectable if combo. DIdn’t work for me so far. Trying to grasp all the possibilities of Choicescript itself.

You could try *check_achievements and *if? I’m not sure what you mean by

1 Like

You don’t need to use *selectable_if, just *if:

*check_achievements
*if choice_achieved_(name of achievement you’re checking)
       *choice

should work!

2 Likes
*check_achievements
*choice
   *selectable_if (choice_achieved_xxx) #NG+

I was trying to somehow combine this

*choice
*selectable_if (variable >= number) #text
Your text here.

with

*check_achievements
*if ((choice_achieved_code1 and choice_achieved_code2) and choice_achieved_code3)
*achieve code4

and tried

*check_achievements
*selectable_if (choice_achieved_command) #text
your text here

and so far it didn’t work.

Thanks i’m gonna have to try that

well, make it

*selectable_if (choice_achieved_code4) #fads

Thanks, I’ll try that too. If it doesn’t work I’ll just stick to a simple “input_textbox” where you’ll enter letters that you’ll get from different endings.

My apologies. I just noticed that this was exactly what I did the first time with “*check achievements” on top and the whole choice disappeared.

Can I see your whole code?
You probably nested your *choice inside an *if.

It looks something like this. The problem is with *check achievements. Basically, I get “Invalid indent? Expected an #option here, not *check_achievements”, unless i bring it all the way to the left which makes the choice disappear. I’m probably doing something wrong.

*choice
        #Choice A
             Choice body
            *page_break
            *goto label
            
        #Choice B
             Choice body
            *page_break
            *goto label
            
       *check_achievements            
       *selectable_if (choice_achieved_something) #Choice C
             Choice body
            *page_break
            *goto label

Oh, right. *choice only accepts indented #Options, and not other commands.

Try moving the *check_achievements at the top of the choice.

*check_achievements
*choice
1 Like

Wait, this actually worked!!. TYTY.

EDIT: btw how do i put this post on solved or something?

1 Like

Done!

I’ve re-categorised your topic under ‘choicescript help’, and marked @Szaal’s post as the solution :slight_smile:

3 Likes