Having 2+ string data variables in one if: macro?

Twine Version: 2.3.14
Story Format: Harlowe 3.2.2

Okay so I'm sure this has been asked before, but I'm currently beta-writing a VN 
using Twine, and several moments in character creation have currently resulted 
in a problem-- 
There are several races to select from when first starting, 
with a few having 'special' skintones or hair colors that only they have, 
or that only they and one other/two others have, 
and I'm trying to make them accessible to ONLY those races. 
I can't currently figure that macro or AND line out, though,
so for example my current lines look something like:

(if: ($race is “elf”) and ($race is “lightning”)) [[Shiny gold]]


but obviously, the if: macro can only have one string data variable in it.
1 Like

Welcome Achilles!

First thing, you should place code (and mostly code) between preformatted text (</>). If you look at your (non-preformatted) code, you can see the regular quotes have become curled. Curled quotes are not recognized by Harlowe as quotes.

About your problem, I think your problem is the $race variable can’t be “elf” and “lightning” at the same time, so whatever you want your game to show it will never show. Either you test two different variables, or you mean an or operator rather than an and.
Also, you don’t need parentheses around one condition.

The following should work

(if: $race is "elf" or $race is "lightning") [[Shiny gold]]
1 Like

oh my god. i don’t know if it’s because i’m sleep deprived atm or just completely stupid but i tried using ‘or’ at one point and clearly did it wrong so it didn’t work and just figured ‘or’ wasn’t the right term- thank you so much for your help!

1 Like