Stubborn code error

Heya guys, so i recently began working on my game again. (80K) words so far. however i came across an error that i have tried SO HARD to fix…but no matter what i do. It just doesn’t seem to work. I shared a little picture below so hopefully everyone is able to see it. does anyone know the reason for this error? and why randomtest seems to detect it no matter how much i change the code? I have been stuck on this for days now…seriously!

I think you need more () there

*if (((var) and (var)) and (var))

if I’m not mistaken

Edit:
Basically:

The first cluster of ('s determines how many various variable are accounted for if the operators throughout the *if are identical. So ‘and’ or ‘or’.
When you want multiple possibilities you pair it differently. so

*if (((var_a is true) AND (var_B >=50)) AND (var_C is true))

is when ALL of these need to apply for the *if to trigger

*if (((var_a is true) OR (var_B >=50)) OR (var_C is true))

is when EITHER needs to match for the *if to trigger

*if ((var_a is true) AND (var_B >=50)) OR (var_C is true)

is (if my mind isn’t fooling me entirely) for when either both for A and B need to apply OR for C to apply for the *if to trigger.

3 Likes

You need to do checks 2 at a time.

*if ((x = x) or ((y = y) or (z = z)))

You can learn it better here:

1 Like

I’ve been at this for days now and was afraid that I wouldn’t be able to finish my game because of it…your solution seems to have worked so far and I can’t express my gratitude enough. Thank you, I hope it’ll be okay to ask again if i somehow run into this particular problem again

1 Like

Of course it’ll be alright. That’s what the forum is for :smiley: Good luck with your game.

1 Like

thank you again! although now that this section is fixed…seems like my randomtest is stuck onto a loop when it comes to choosing one of these choices to practice their skill.

not sure what exactly the problem is here though :face_with_head_bandage:

1 Like

If you are returning to the choice-body after each scene, try adding *hide_reuse before each *if and see how it works then.

For example, this is from my Ashenmaw game:

You shuffle around on the pillow and think about it.
*label morech1question_red
*choice
 *hide_reuse #"You @{(question1ch1) said you're a caretaker, but you seem|seem} oddly important. Who exactly are you?"
  *set question6ch1 true
  *set questions_asked1 +1
  *goto question6ch1_answer_red
 *hide_reuse #"Could you tell me @{(question2ch1) more|something} about Astia and Kassias?"
  *set question7ch1 true
  *set questions_asked1 +1
  *goto question7ch1_answer_red
 *hide_reuse #"I'd like to know @{(question3ch1) more|something} about the Court and the area."
  *set question8ch1 true
  *set questions_asked1 +1
  *goto question8ch1_answer_red
 *hide_reuse #"The other strongholds, @{(question4ch1) is there more to|could you something about} them?"
  *set question9ch1 true
  *set questions_asked1 +1
  *goto question9ch1_answer_red
 *hide_reuse #"Is there something else to Ashenmaw?"
  *set question10ch1 true
  *set questions_asked1 +1
  *goto question10ch1_answer_red
 #"No, I don't actually have @{(questions_asked1 >0) any other|any} questions."
  *if (questions_asked1 =0)
   *set noquestionch1_1 true
   *goto noquestions_ch1_1_red
  *else
   *goto noquestions_ch1_1_red

after each option (except the ‘no i don’t have questions’ option) the game calls the choice body again:
Example:

[...]
"No. Well, Kassias often steps in for her, as her other consorts do occasionally, but it's no good. She still has a lot on her plate, and she can be a bit stubborn about it."

"Oh."

"Maybe one day someone can manage to convince her to get some much needed rest. @{(questions_asked1 <5) "Anyway... anything elso you'd like to ask?|"Also talking about having something on your plate... If my nose doesn't fool me dinner's on the way now.}"
*if (questions_asked1 =5) 
 *page_break You Take A Whiff As Well.
 *goto dinner_red
*else
 *goto morech1question_red

except for when you have used up all questions (that’s what the questions_asked variable is for).

Due to the ‘hide_reuse’ it will hide the options you’ve already picked.

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.