Make an option unavailable after choosing it?


#1

Hello everybody! I’m rather new to Choicescript coding, but I’m having fun with it and these forums have been super helpful so far, so thank you for that haha! There’s one thing I can’t seem to find though so I was hoping you guys could help.

There is a scene where you are exploring different rooms in a house. Only one of them actually progresses the story so technically you only need to choose that one. However, if players choose the other choices/rooms, I want it to give them the opportunity to gain stats (in this case, money) and then take them back to the main page with all the choices again.

I can get it to go back to the other choices fine, but is there a way for me to make an answer unavailble after you choose it once? I don’t want the player to keep going back into the same room over and over once they’ve gone in already.

Right now, this is basically what my code is like:

*label House
Character goes inside house.
  *choice
   #Look at room A
    Description of room A, character finds some money and pockets it
    *set money +10
    *page_break
    *goto House
   #Look at room B
    Description of room B
    *page_break 
    *goto House
   #Room C
    This one actually progresses the story and moves on 

So yeah, if they go into Room A once, I don’t want them to be able to do that again and keep getting more money. How can I keep this from happening? Thank you so much in advance! :slight_smile:


#2

You can use either *hide_reuse (to hide the option) or *disable_reuse (to grey it out), like so:

  *choice
   *disable_reuse #Look at room A
    Description of room A, character finds some money and pockets it
    *set money +10
    *page_break
    *goto House
   *disable_reuse #Look at room B
    Description of room B
    *page_break 
    *goto House
   #Room C
    This one actually progresses the story and moves on.

Also, not sure if it’s just the copy-paste or if your original is the same, but probably best to make sure to keep the spacing for indentation even? In this case, it seems like the first *choice is indented by two spaces, and then everything following that is indented by one space per level? Perhaps best to stick with two spaces per level throughout, to make it consistent and also simpler to follow.


#3

So what’s the difference between
*hide_reuse vs *hide_reuse globally

Is it basically the same thing?

I use the latter


#4

Do you mean the difference between putting *hide_reuse before a specific choice and putting it at the top of a text file? :thinking:

Putting it before a choice will only apply to that choice, while putting it at the top of a text file applies to the entire text file.

If you’re saying actually putting the word “globally” there, then I’m not familiar with that, so never mind :sweat_smile:


#5

“Globally” would mean over an entire file or program, while “locally” would mean only in one single place.

The command *allow_reuse would allow you to disable the global *hide_reuse for a single option.

e.g.

*hide_reuse

*choice
    #Option 1
        Single use choice.
    *allow_reuse #Option 2
        Multiple use choice.

#6

Ah yeah, I think it copy and pasted the format weird, thanks for pointing that out.

Anyway this is exactly what I needed to know! Thank you so much for your help!!


#7

Can you do that in choicescript? :astonished: Or does choicescript not recognize this? :confused:


#8

Not using the word “globally”, no… :sweat_smile: It’s just the term used.