i’m new to choice script and there is a problem i’m having right now and it doesn’t look like i will be be able to solve it on my own, so i decided to ask help here.
the coding looks like this:
“excuse me sir would please be so kind to spare a coin to a poor old dwarve?”
*if race = “Demon”
"Excuse me sir would ple-… the dwarve stopped his words his words and had his eyes fixated on me for a moment before his face turned into one of complete fear and terror.
what is the problem? well, only the bottom text is supposed to show in case you are using the specific “Demon” race but it is showing the top text as well which is supposed to be shown only for races beside “Demon”. but nothing i do works to fix this problem.
Hey there, I’m not sure if I understand your question, but everything below *if is what should show if “Demon” is your race. Try indenting it like this?
“excuse me sir would please be so kind to spare a coin to a poor old dwarve?”
*if race = "Demon"
"Excuse me sir would ple-… the dwarve stopped his words his words and had his eyes fixated on me for a moment before his face turned into one of complete fear and terror.
And if you keep having trouble, you can run quickest and see what errors come up. It’s easier to fix issues that way.
You need to add a condition to prevent the first text from showing up if the second one is triggered. I think what you want is something like:
*if race = “Demon”
"Excuse me sir would ple-… the dwarve stopped his words his words and had his eyes fixated on me for a moment before his face turned into one of complete fear and terror.
*else
“excuse me sir would please be so kind to spare a coin to a poor old dwarve?”
So it will first check to see if the player is a Demon and show the Demon specific text if so, and if not it will show the other text instead.
You can keep Identation by using these ```. It would look like this:
*if race = "Demon"
"Excuse me sir would ple-… the dwarve stopped his words his words and had his eyes fixated on me for a moment before his face turned into one of complete fear and terror.
*else
“excuse me sir would please be so kind to spare a coin to a poor old dwarve?”
Hi @SilentOne, thanks for reaching out about this issue! If a specific post solved your problem, please mark it with the green Solution checkbox (tap/click the ellipsis on the bottom of the post and select the checkbox from there) so other users with similar problems can find the solution easier.
(!= means “inequal to” in coding language) Instead of *else, if you don’t want to have to create a label to get back to the next part of the text.
(IIRC. It’s been a while since I last played around with ChoiceScript)
This method a little more sensitive to errors.
Edit: forgot how to format things on the forum. Anyone who can point me in the right direction?
Its just *else, not *if else. The other error is expected, ChoiceScript has a requirement that you must add a *goto at the end of every *else for some reason, even if it’s to go to a label right underneath it.
*if race = "Demon"
"Excuse me sir would you ple-...
*goto afterif
*else
"Excuse me sir would you please be so kind...
*goto afterif
*label afterif
Continue here...
Either you need to do that, or activate implicit control flow to disable this requirement: