Can someone tell me why this isn't working?

I am useing the stats machanic to set the players gender I am trying to use
*create she true/false
to create the stat but it wont work, it is saying it is an invaid create instruction, why?

There are three types of variables: number, boolean, and string. So there are multiple ways to do pronouns and gender. This is what I do in my games.

*choice
  #"Man."
    *set gender "m"
    *set princex "Prince"
    *set mx "Mr."
    *set person "man"
    *set child "son"
    *set they "he"
    *set them "him"
    *set themselves "himself"
    *set their "his"
    *set theirs "his"
    *set they_are "he is"
    *set theyre "he's"
    *set they_were "he was"
    *set they_have "he has"
    *set theyve "he has"
    *goto ch1_first_name
  #"Woman."
    *set gender "f"
    *set princex "Princess"
    *set mx "Ms."
    *set person "woman"
    *set child "daughter"
    *set they "she"
    *set them "her"
    *set themselves "herself"
    *set their "her"
    *set theirs "hers"
    *set they_are "she is"
    *set theyre "she's"
    *set they_were "she was"
    *set they_have "she has"
    *set theyve "she's"
    *goto ch1_first_name
  #"Person."
    *set gender "nb"
    *set princex "Princex"
    *set mx "Mx."
    *set person "person"
    *set child "child"
    *set they "they"
    *set them "them"
    *set themselves "themselves"
    *set their "their"
    *set theirs "theirs"
    *set they_are "they are"
    *set theyre "they're"
    *set they_were "they were"
    *set they_have "they have"
    *set theyve "they've"
    *goto ch1_first_name

There are other ways to do this of course, but first you have decide how you want to proceed. Some people prefer to use *multireplace and denote gender with numbers. I don’t think I’ve seen many people use boolean variables for gender, but there’s no reason why you couldn’t

Edit: the reason you were having trouble with

*create She/Her

Is because you didn’t give it a value

You need to do one of the following things:

*create gender ""
*create gender 0
*create gender false

That’s just example code of course. You have to change it to cater to your needs (gender = false doesn’t make much sense after all)

3 Likes

Additionally, ChoiceScript will reject She/Her as a variable name because of the capital letters and the slash. This boolean name would work, however:

*create she_her true

I suggest poking around on the ChoiceScript wiki for more beginners’ tips! You can start here with data types, if you like:

1 Like

Since you deleted your last post, I don’t know if that means you’re still having trouble or not, but to reiterate, as hgbird said:

If you rename your variable to she_her and give it an assigned value (either a string “xyz,” a number, or true/false), then the error should go away.

2 Likes