How would I do a check for three if variables please?

Okay so I can do double variables just fine, like this:

*if ((race = "dragon") and (gender = "b"))
  You stretch on four legs, flexing your wings and swishing your tail.

But what I don’t know how to do is to expand past that into mixing and matching three!

Like, what I want to do with it is something like this:

*if ((race = "dragon") and (gender = "b")) OR ((gender = "g"))
  You stretch on four legs, flexing your wings and swishing your tail.

So this way it’ll work for one race choice, but ALSO either gender choice. Does this make sense and is it achievable at all please? I want to be able to have one variable, like race, and then be able to mix and match two OTHER subset variables or whatever with it. Like the above idea.

What your code is doing now is saying, “if you’re a boy dragon OR a girl of any race.” Is that what you want? (Also, I think you might need to use lowercase “or”.)

From what you’re saying after, it sounds more like you want:

*if (race = "dragon") and ((color = "red") or (gender = "b"))
  You stretch on four legs, flexing your wings and swishing your tail.

Which would mean you’d get the if statement text if you’re a red dragon or a boy dragon.

No I want like it to do it for either of them. Like both. Like, if you’re a dragon, AND if you’re a boy or a girl, you’ll get this thing to show up.

I currently have this:

*if ((race = "dragon") and (gender = "b"))
  You stretch on four legs, flexing your wings and swishing your tail.
*if ((race = "dragon") and (gender = "g"))
  You stretch on four legs, flexing your wings and swishing your tail.

I want to like merge them so it’ll be just ONE statement to cover both, like, *if (race dragon) and (boy) or (girl): text here.

So it’s just one thing that covers both of them.

But my problem is I don’t know how to make three variables in one line like that. Like how do you arrange all the (( and ))'s?

Then you’re overcomplicating it – you just need *if (race = "dragon").
If what you mean is, e.g. “dragons who are not nonbinary,” then you could just do
*if (race = "dragon") and (gender != "nb")

1 Like

Oh…okay! :frowning: I seem to overthink this stuff a lot…Thanks I guess, I’ll just do that?

It’s a little convoluted, but you could probably get away with having the species check *goto-ing to a gender check.

*if dragon
    *goto gendercheck
*label gendercheck
*if girl
    *goto blahblah
*elseif boy
    *goto blahblahblah
*else
    *goto youshouldntbeabletogethere

Something like that.

I mean, I’m just guessing at what you’re looking for! I had assumed that you were just using binary genders, but if you’re using more than three, what you want is:

*if (race = "dragon") and ((gender = "g") or (gender = "b"))

This will check “are you a dragon” and “are you a girl or a boy.”

Whereas:

*if ((race = "dragon") and (gender = "g")) or (gender = "b")

would be “are you a girl dragon” or “are you a boy (any race)”

Does that help with the double parentheses?

1 Like

Okay yessy I want the first one! Jeez though, a (( ) versus a (( )) ) really makes that difference? That’s another thing to save to my notepad file of choicescript tips then!

So um, there’s no actual difference between putting this:

*if (race = "dragon") and ((gender = "g") or (gender = "b"))
  You stretch on four legs, flexing your wings and swishing your tail.

versus this:

*if (race = "dragon")
  You stretch on four legs, flexing your wings and swishing your tail.

At least for my setup, there isn’t? So should I just use the way shorter one, until I NEED to check for gender later on during choices?

1 Like

If your only gender choices are “b” and “g”, then yep, those two things are the same :slight_smile: That’s why I was confused at first.

2 Likes

Sure, no need to check a variable unless there’s a need for it. Check it later when you need it.

1 Like

Alright! :slight_smile:

Okay thanks! :slight_smile: Sorry to confuse!

No worries! Glad it worked out :slight_smile:

1 Like

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