Using "or" and "and" together in if statement

I’m having trouble with: I need a sexuality check for a “school romance” scene, so MC can attempt to date both (male and female) options. This sets their “sexuality” value “both”. Problem is, both characters desire exlcusive relationships so I want them to see “They both wanted an exclusive relationship, which I wasn’t interested.” option (“greed” value is for choosing “I wanna date both” option, it is a modifier that can unlock one of endings if it’s high enough). However, due to “sexuality” value being set as “both”, if you choose “I wanna date both” you can still see Amy and Chris options.

The error I’m getting is: I’m using CSIDE, it says it expected nothing after

"if (sexuality = "Women") or (sexuality = "Both")"

. The thing I tried was (poly being a temp value I created just for this, I don’t think I have patience or desire to write a polyamorous relationship)

"if (sexuality = "Women") or (sexuality = "Both") and (poly = true)"

My current code looks like this:

    *if (sexuality = "Women") or (sexuality = "Both")
        #Yes, I can't believe Amy said yes!
            *set romance "Amy"
            *goto incident
    *if (sexuality = "Women") or (sexuality = "Both")
        #No, she said she was dating someone else.
            *goto incident
    *if (sexuality = "Men") or (sexuality = "Both") and
        #Yes, Chris said he had a crush on me too!
            *set romance "Chris"
            *goto incident
    *if (sexuality = "Men") or (sexuality = "Both") and
        #No, he wanted to be friends.
            *goto incident
    *if (sexuality = "Both") and (greed = 1)
        #They both wanted an exclusive relationship, which I wasn't interested.
            *goto incident
    *if (sexuality = "Both") and (greed = 0)
        #I tried my chance with both, but they said no.
            *goto incident
    #I didn't try
        *goto incident

TL:DR I’m trying to make it so if you choose “I’m bi and I’ll try my chances with both” then you can see “Amy” and “Chris” options, if you choose “I wanna date both at the same time” then you see “Nah they’re not interested”.

You need another set of parentheses that surrounds the two!

((sexuality = "Women") or (sexuality = "Both"))

Thank you! I should’ve read “if” page on wiki more throughly…

Just glad this one was easy to solve :slight_smile:

1 Like

I dont think you do, actually? CS can deal with two things at a time: Is it possible... (making or/and statements with 3+ variables) - #8 by Havenstone

What it can’t deal with is

  • three things at a time, e.g. (sexuality = "Women") or (sexuality = "Both") or (sexuality = "Poly") – in that case you’d need to chuck a couple of them inside a parenthesis
  • orphan bits of code – for example the stray “and” at the end of *if (sexuality = "Men") or (sexuality = "Both") and

I think in the code shared here, it’s the second one that’s the problem.

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