I’ve been trying to create a series of questions to ask someone in my game and I’ve been in a huge wrestling match against ChoiceScript to get it right. Now it’s telling me that “selectable_if” isn’t a valid command.
May I get some help?
I’m unsure of how to write so that indentation shows up, so I’ll use this: to indicate a tab.
*choice
*disable_reuse #“What do you mean Danger?”
*if questionasked = false
*set questionasked true
*set question +1
Kiara bites her lip. “I can’t explain. All I can say is you’re in danger. I will do my best to protect you so you don’t…” She stops. When you press her for more, she refuses to tell you. You decide to leave it alone and ask another question.
*goto questions
*disable_reuse #“What is this place?”
*if questionasked = false
*set questionasked true
*set question +1
“It’s called the Red Candle Mansion. The owner, you’ve had the pleasure of meeting. Her children…I only hope you don’t.” Kiara looks to the floor before smiling at you once again.
*goto questions
*disable_reuse #“Who are you really?”
*if questionasked = false
*set questionasked true
*set question +1
Kiara grins. “I’m Kiara, of course, just as I told you.” You get the impression she’s avoiding your question, but she won’t let you press for more no matter how hard you try. The best you get out of her is finding out her favourite food is beef noodles.
*goto questions
*selectable_if(questionasked= true) # I have no more questions for Kiara.
*goto explore
Well “*selectable_if(questionasked= true) # I have no more questions for Kiara.”
I think should have a space before the var. “*selectable_if (questionasked= true) # I have no more questions for Kiara.”
@Vendetta It is written correctly (I checked at least 20 times, and even copy-pasted it from the wikipage at one point) and I checked every conceivable way to correct my code; it doesn’t want to correct.
@Aera The variable is there; I left it out of the thing since it was at the top of the document. Also, I’ve edited the ting so it reads:
*selectable_if (questionasked = true) # I have no more questions for Kiara.
Although I’m not sure I follow you; I thought *goto explore was already below the choice?
@DSeg I did both of those but it didn’t seem to help. It’s something to do with the command itself, methinks. Changing it to an *if command didn’t do anything to help.
Sorry @Aquos_Boost erm try it on IDE it will tell you the space problems faster and posting code type this without the space and your code in the middle. < p r e > < / p r e >
I’ve tried just about everything and nothing’s working; It’s bad to blame the program but in this case, I think it’s appropriate; selectable_if is written properly according to both the tutorial and the wiki.
Then again, it is 9:30pm where I live and my brain could be dead.
IDE says it’s valid, so I have no idea why it’s not correct for ChoiceScript when they’re essentially the same program sort-of. My coding in the file looks like this:
*label questions
Next, you ask...
*choice
*disable_reuse #"What do you mean Danger?"
*if questionasked = false
*set questionasked true
*set question +1
Kiara bites her lip. "I can't explain. All I can say is you're in danger. I will do my best to protect you so you don't..." She stops. When you press her for more, she refuses to tell you. You decide to leave it alone and ask another question.
*goto questions
*disable_reuse #"What is this place?"
*if questionasked = false
*set questionasked true
*set question +1
"It's called the Red Candle Mansion. The owner, you've had the [i]pleasure[/i] of meeting. Her children...I only hope you don't." Kiara looks to the floor before smiling at you once again.
*goto questions
*disable_reuse #"Who are you really?"
*if questionasked = false
*set questionasked true
*set question +1
Kiara grins. "I'm Kiara, of course, just as I told you." You get the impression she's avoiding your question, but she won't let you press for more no matter how hard you try. The best you get out of her is finding out her favourite food is beef noodles.
*goto questions
*selectable_if (questionasked = true) #I have no more questions for Kiara.
*goto explore
@Aquos_Boost It looks like your problem may be more to do with incorrect indentation than *selectable_if itself. That whole *choice statement should look more like this (when word-wrap toggled on, which I’ve done here to show proper indentation levels):
*label questions
Next, you ask...
*choice
*disable_reuse #"What do you mean Danger?"
*if questionasked = false
*set questionasked true
*set question +1
Kiara bites her lip. "I can't explain. All I can say is you're in danger. I will do my best
to protect you so you don't..." She stops. When you press her for more, she refuses
to tell you. You decide to leave it alone and ask another question.
*goto questions
*disable_reuse #"What is this place?"
*if questionasked = false
*set questionasked true
*set question +1
"It's called the Red Candle Mansion. The owner, you've had the [i]pleasure[/i] of
meeting. Her children...I only hope you don't." Kiara looks to the floor before
smiling at you once again.
*goto questions
*disable_reuse #"Who are you really?"
*if questionasked = false
*set questionasked true
*set question +1
Kiara grins. "I'm Kiara, of course, just as I told you." You get the impression she's
avoiding your question, but she won't let you press for more no matter how hard
you try. The best you get out of her is finding out her favourite food is beef
noodles.
*goto questions
*selectable_if (questionasked) #I have no more questions for Kiara.
*goto explore
Don’t copy-paste the above verbatim though, as I’ve used spaces for display purposes. Just edit your own file to suit.
@Aquos_Boost True enough. That’s one of the reasons why it’s useful to post a substantial chunk of code when trying to resolve a tricky error - a fresh set of eyes often spot these things much easier.
The error messages system isn’t always perfect though; indentation is usually the real cause when the error message doesn’t seem to make sense - as in this case, and sometimes also being the real culprit behind the ‘Cannot fall out of a [choice/if/else] statement’ type of error.
There is a simple ‘Golden Rule’ to help get your indentation right:
And some of the basic techniques described in the first half of this article can also make things easier as your scripting hierarchy grows:
But the best thing to do, especially when still learning, is to use the IDE for your game scripting, as that has a cool “smart indentation” auto-indent feature which you can toggle on under “Settings”: