Is there a command for selectable if combined with hide reuse?

Just use an if statement instead of a selectable if. That way it’ll only appear if the conditions are fulfilled.

I seem to remember there was some way to do this:

*selectable_if (readies >= 60)
	*hide_reuse #"I'll refrain from spoiling the plot of this game in this example!"

But Choicescript just doesn’t like *selectable_if and *hide_reuse in the same choice. Does anyone know if there is some elegant way to do this, or do I have to use an *if here with a *temp variable I use for this purpose?

Well you could still use the *selectable_if command with two vars. One is a global var and the other one is a temp var.

*selectable_if ((globalvar >= 60) and (temp var)) #“I’ll refrain from spoiling the plot of this game in this example!”

Then make the temp var true or not after the choice is selected making the choice unselectable and unuseable but still viewable.

1 Like

I had the problem of the hide_reuse after a checkpoint load, here is how I solved it. I don’t know if this could help but I don’t ever used the hide_reuse anymore unless I know that the scene will not go back because there’s no checkpoint load from there till the next checkpoint save…

*label 200
*choice
  *selectable_if ((flash >= 1) and (use_flash = 0)) #Flash grenade.
    *set use_flash 1
    *set flash_grenade -1
    You use the flash grenade.
    *if (the_grenade_blows >= 50)
      The explosion blind all around.
      *goto xxx
    *else
      The grenade didn't go off. You should choose another way.
      *goto 200
  #Frag grenade.
    *comment if you want to rehabilitate the option to use the flash grenade after you choose another way just put a *set use_flash 0 on the rest of the choices.
    *set use_flash 0
    You use the stun grenade.
    *goto xxx
  #EMP grenade.
    *set use_flash 0
    *goto xxx

I don’t know if there is a cleaner way to do it but it worked for me, and if you don’t use the “use_flash” a lot you can create *temp variables before the choices, if you use them a lot just add them to the startup. Hope it helps.

1 Like

These workarounds make sense–they will help. I wish there were a cleaner way to simply combine *selectable_if and *hide_reuse, but I assume there’s some deep code reason why there can’t be.

2 Likes

I guess in choicescript commands the *selectable_if to work needs a specified var while *hide_reuse does not need the command but the script has a command for it to track when that option is use thus combination of the two commands clash. I’m hoping that makes sense.

But yeah I would also like a ln option to have both commands work or if need I think a new command to accommodate the problem?

Isn’t

*hide_reuse *selectable_if (condition) #Choice

works?

My experience with is it when I use the random test it go wonky thou.

But if that works why not right? :blush:

I have written a scene with probably the most complicated code I’ve ever written, and it runs well so far (aside from misplacing the position of *labels), even in the tests.

But many people know that I hate using quicktest and randomtest. Once I have the whole scene written, I plan to utilize *if choice_randomtest so the randomtest will skip all that choice-hub shenanigans.

1 Like

My go to rule is to use quickest and randomtest. Maybe that’s why my experience with it is buggy. I’m still glad I learned to try switching the commands to make it work. Bonus knowledge!

I have written the most complicated scene code too, and then I wrote one even more complicated with all I’ve learned with the previous fails (it get’s addictive), I recommend you to use the quicktest and the randomtest before going on because otherwise you’ll carry the mistakes or the unpolished code throughout the game instead of improving it, it get’s easier with time, once you begin to get used to it you begin to see different ways to achieve what you want and you will almost not make major code bugs save for a few misspellings or whatever, and the quicktests will go cleaner. At least that’s what happened to me…

1 Like

Oddly enough

*hide_reuse *if

Never caused me trouble so far.
I know *if completely hides the option, though

1 Like