Non-existant command "selectable_if" ....what?


#1

So, I’m random testing Trial of the Demon Hunter and this is the only error that comes up. I know for a fact it’s a valid code, so I have no idea to fix the problem. Can anyone help me with this?


#2

Have you tried splitting the choices up like this…


<i>Stupid, stupid, stupid!</i> you think as you finally realize the vampire had been tailing you for the past five minutes and you'd only just this second noticed.
*choice
  *selectable_if (badass) #Nail the vampire with a 360 spinning unicorn kick.
    *goto unicornkick

  *selectable_if (smartass) #Tell the vampire you know he is there.
    *goto stupidvamp

*label unicornkick
[put here cool text about what should happen if you chose this option]
*goto deadvamp

*label stupidvamp
[put here funny text about what should happen if you chose this option]
*goto deadvamp

*label deadvamp
the story continues.

it might help narrow the actual error down.


#3

I have. I’ve tried rearranging the blocks and it sometimes fixes the issue, but it takes a long time and more of the same errors keep popping up.


#4

Can you copy/paste that section? Although it may be valid, seeing it in context might give us some ideas to help fix it for the randomtest.


#5

@Lucid


*choice
    *selectable_if (transformations_toad) #Transform into a poisonous toad - utilizing his poison, you could turn simple darts into lethal flying weapons. Requires 1 mana.
        *set Cunning %+ 10
        *set Mana -1
        *set Darts +3
        *set Relationship %+ 10
        You reach back, activating the buckles on your backpack and ${boggart} leaps out, landing gently onto your shoulder, subsequent of which you tell him,

        "In order to prepare for the endeavor ahead, I'll need to use your poison to enhance my darts."

        ${boggart} nods his consent, and in a minuscule puff of ashen smoke, he changes into a minute opalescent poisonous toad. Careful to put on your gloves beforehand, you offer your hand and he leaps onto the center of your palm. You then take out a small beaker and adjust it so that it lies just beneath ${boggart}'s stomach, where he begins to secrete the deadly venom. The venom causes ones voluntary movement to completely shut down, simulating death. Finished, ${boggart} reverts back to his original form as you dip three darts into the poison and insert them into one end of your reed funnel. ${boggart} reverts to his original form with a puff of ashen smoke and settles onto your shoulder. You exchange smiles before heading down the same route as you had previously.
        *goto toad


#6

That’s the *selectable_if that shows up as an error?

Easy test. Put the option:
#Do this thing.
…*goto Toad

if a sure option is enough to clear the error on that line for that *selectable_if, then you know it’s a lack of options error.


#7

@Lucid
I have an option for him to stay in his original form which is available to everyone no matter what.


#8

Is it a plain # option with nothing else on it?


#9

@Lucid
Yepp! Jason said the error would be “no selectable options” if that were the case, so I’m just gonna try downloading the newest version of CS and see if that works.


#10

So I downloaded the new version of choicescript and I’m still getting the same

non-existant command “selectable_if”

error, even when this


#Stay in your backpack as his original form - you would rather keep your ally a secret from your potential enemies.

is in the same block as the choice I posted initially. And it’s not just this choice…almost every *selectable_if is being called out as an error, even though I have at least one non-conditional choice in each block


#11

Does transformations_toad ever accidentally get set to a number?

eg
*set transformations_toad 0

Even if it’s boolean everywhere else, if it gets assigned a number even once, strange things happen. You may need to search for transformations_toad to see if it happens accidentally…any where.


#12

@Lucid
No, but it takes away 1 Mana. However, it’s impossible in this first book to use enough Mana to make it unavailable for your boggart to transform into the toad. Even if you could, that’s why it’s *selectable_if


#13

I mean the variable transformations_toad. If it’s TRUE, it can be selected, if FALSE, it shows as grey and unselectable. It’s boolean. But, if you ever treat it as an integer and accidentally store a number into it, odd things can happen.

I’m grasping at straws, but if that’s what’s happening, it may mess up many of your *selectable_ifs.


#14

@Lucid
This one is just a boolean. A lot of the others are integers though


#15

I understand, but that could be the error. A single typo where it gets treated like a number could cause strange errors. Just one time where you might have been thinking mana and typed transformations_toad instead. That type of error is hard to find and causes oddities all over the place. Just a thought. :slight_smile:


#16

@Lucid
The quicktest would have caught it:P I’ve already passed the quick test so I don’t think that’s it. I’ll keep that in mind for the future, though


#17

If that option gets an error use this

*choice
__#Get Beckham to transform.
____*goto transform
__#Keep him in my backpack.
____*goto notransform

Then have the transformations code under transform it really helps to narrow the error down.


#18

My experience was that a misuse of a boolean wasn’t caught by quicktest, which was why i suggested it. Probably not the problem, but it caused a lot of weird and undetectable errors in my code until it was found.


#19

Thanks, guys. I’ll try see these out later today and see if it works.


#20

Could a moderator please close this discussion? Jason helped me find the errors that I needed to fix.