How do I test variables greater than or less than?

Hi, i have an error, that is very, very weird.

My choices:

*choice
 #Shoot.
  *if Gunshooting = 55
   You jump sideways, suprising them, with your aim you take out three, you're behind a pillar now. What will you do now?
   *page_break
   *goto shuto
  *else
   You jump sideways, suprising them, but they quickly shoot you down. (55 gunshooting needed.)
   *page_break
   *goto amnesia

So that’s what i have, but even if a player has 55 Gunshooting, the *else message shows up.
I tried *if Gunshooting >= and => but that doesn’t seem to work.

Try shifting the *else statement over to line up with the rest of the * commands

Or replace the *else with *if Gunshooting < 55

Try putting “Gunshooting = 55” in brackets:
*if (Gunshooting = 55)

BTW, indenting by just one space makes it really hard to see what’s going on,.

Also: you dont need the page_break there

Doesn’t work. :frowning: Sad

copied/pasted the code, tested it and it worked as intended, check if the “Gunshooting” variable really has a value of 55 any other value will go to the *else statement and try some of the suggestions above, by the way you want to use “Gunshooting >= 55” instead of “Gunshooting = 55”

But i have other choices with *if Gunshooting = 55 and it worked. It just doesn’t work here

1 Like

Hmm that’s weird, like i said i tested and it worked just fine, try creating a *temp like this:

*temp Gunshooting2 55

and change your code to:

*if Gunshooting2 = 55

and check if you still get the bug

If it works maybe some event or choice prior to the one you posted is reducing/increasing Gunshooting

As said in the other thread (you dont need to open multiple threads btw)
Use
*if (gunshooting >=55)
AND
*if (gunshooting <55)

No ‘else’

It works now. But nothing prior to that choice reduced Gunshooting.

Try changing the code to

*if Gunshooting <= 55

and see what happens

Nothing. So weird. :

You can put bits of temporary code in to print variables to help you determine what’s happening when you get hard to track down errors like this. I do it all the time. I put them in square brackets so I can tell them apart from other text. Just add something like…

[Gunshooting is ${Gunshooting}]

before your choice statement and it’ll tell you exactly what the value is when it gets there. That can save you a lot of time.

before *choice or before #?

You’d have to put it before *choice.

I have 65 Gunshooting, and 55 is needed, but i still get f/cked.

Then you need

*if (Gunshooting >= 55)

That’s testing for gunshooting being equal to or greater than 55.

1 Like

Finally. Thank you. But it’s still weird, since quictest told me it was a mistake.