The error I’m getting is, I have create in startup a female true / male true and on the next page a choice to be male or female. This is working and sets female true or male true
I can’t see why this code is not working then, I get an expected operator was string
My code looks like this:
*if (male = true) "I told you I would get you here on time Sir."
*else "I told you I would get you here on time Ma'am."
I have tried *if (male)
I have tried *if (male = true) , If (female = true)
and so on
Thanks for your help, I simply needed a line after the *if statement (doh!)
It’s quite messy coding this actually!
I have to write if male true, then the correct text, then a goto because you cannot fall out of an if statement, then the whole rigmarole again for female
I have seen alternative coding using ${xxxx} but that is way above my pay grade lol
That does sound way complicated, if all that varies is how the character is addressed then ${address} is more concise and easier for you to read. Here’s a page explaining the topic on the ChoiceScript Wiki. https://choicescriptdev.fandom.com/wiki/Displaying_variables
Nevertheless, I’m with @shario that if all you want to do is write “sir” or “madam”, a variable storing the character’s form of address is the way to go. Save the conditional structures for when there are significant differences to the text.
Also… best piece of advice I got? make it a numeric value whilst adding options for he, him, his, So you can reference the numeric value (set 2 for female, set 1 for male, set 0 for non binary ) for easy if references, So starter should look like this.
*create gender 0
*create he “”
*create him “”
*create his “”
and the choice tends to be
*choice #I’m male.
*set gender 1
*set he “he”
*set him “him”
*set his “his”
referenced by {he} in normal chat.
E.g.
{he}'s awake will come up either he’s awake, she’s awake, or (im currently fiddling around with non binary )
You can do a quick boolean run through if you need to be a male,
*if gender < 2
for a male, running this script, (w/out binary options)
*if gender > 1
for female (w/out binary options)
But i’ve found that this is only with choices that are gender specific, i’m sure there’s other uses for it.