Can you pre-test if options are selectable?


#1

Is there anyway to check if there are options available on the following screen/label and place that in an *if statement?

I’m trying to create a scenario in which you can talk to a few different people before making a choice as to what you’ll do. You’re only allowed to speak to the people with whom you’ve already formed a relationship, so the number of selectable choices are variable.

The problem is that if you keep going back to talk to someone else, eventually you run out of choices. (the options are not reusable, because there is some urgency to making a choice).

What I’d like to do is make the “go talk to X instead” option selectable_if other choices are still available. Something like “selectable_if options=selectable”. (LOL)

Failing that, I’ll just have to have a permanent option available, but it would be nice to parse the selectable options in an if statement, if that code is available.

TIA

Here’s the code in question:
*choice

*disable_reuse *selectable_if (rel_E >= 20) #Ethan’s door
	*set room "ethan"
	*goto Ethan
*disable_reuse *selectable_if (rel_S >= 20) #Rochelle’s door
	*set room "rochelle"
	*goto Rochelle
*disable_reuse *selectable_if (rel_U >= 20) #Uriel’s door
	*set room "uriel"
	*goto Uriel
*disable_reuse *selectable_if (rel_M >= 20) #Maggie’s door
	*set room "maggie"
	*goto Maggie
*if ((((rel_E < 20) and (rel_S < 20)) and (rel_U < 20)) and (rel_M < 20)) #No doors. I should just leave.
	*set room "exit"
	*goto Exit

And one of the choices I would make selectable_if options = “selectable”:

*selectable_if (((rel_E >= 20) or (rel_S >= 20)) or (rel_M >= 20)) #Tell Uriel you’ll take her later and talk to someone else.
*set rel_U -10
*set day “park”
*goto Rooms


#2

You can use a *temp variable and add one for each person with enough relationship and then subtract one for each room the player visits so you exactly know how much rooms there are left. Is this what you wanted to do?

*temp doors_left 0

*if (rel_E >= 20)
	*set doors_left +1
*if (rel_S >= 20)
	*set doors_left +1
*if (rel_U >= 20)
	*set doors_left +1
*if (rel_M >= 20)
	*set doors_left +1

*label Rooms
*choice
	*disable_reuse *selectable_if (rel_E >= 20) #Ethan’s door
		*set room "ethan"
		*set doors_left -1
		*goto Ethan
	*disable_reuse *selectable_if (rel_S >= 20) #Rochelle’s door
		*set room "rochelle"
		*set doors_left -1
		*goto Rochelle
	*disable_reuse *selectable_if (rel_U >= 20) #Uriel’s door
		*set room "uriel"
		*set doors_left -1
		*goto Uriel
	*disable_reuse *selectable_if (rel_M >= 20) #Maggie’s door
		*set room "maggie"
		*set doors_left -1
		*goto Maggie

And then add (doors_left > 0) at the end here:

	*selectable_if ((((rel_E >= 20) or (rel_S >= 20)) or (rel_M >= 20)) and (doors_left > 0)) #Tell Uriel you’ll take her later and talk to someone else.
		*set rel_U -10
                *set day “park”
		*goto Rooms

Hope this helps!

Edit: Oh whoops, this is my first post and I accidentally entered it. :stuck_out_tongue:


#3

So, you want to make a “must pick” option if certain conditions are met (which in this case, the other options are available)?

Well, I see that you’re already able to set up a “conditional choice”

so I don’t see why you couldn’t do the same with this “selectable if others are available” choice…
unless I’m missing something :sweat_smile:


#4

Awesome! With a little modification, that did the trick.

I hadn’t thought of setting the temp variable based on the same relationship statuses.

Thank you!

(Though I do think a ‘selectable_options’ query in the script would be very useful, if any of the devs see this. :smile: )