Please help with continuity/stat error

Okay, so I’m like really dumb when it comes to coding. I haven’t had any problems until now, so it really surprised me.

When I get to the point where I ask for your gender it tells me “non existent variable ‘male’.”, but I did create a stat and variable list:

*create Name ""
*create Gender ""
*create Sexuality ""
*create Strength 50
*create Stealth 50
*create Compassion 50
*create Intelligence 50 

*create heavy_armor false
*create light_armor false
*create lute false
*create spouse_dead false

and then when prompted later on:

*choice
  #She looks at you and replies, "No I don't, Sir."
    *set Gender "Male"
    *goto Naming

  #She looks at you and replies, "No I don't, Ma'am."
    *set Gender "Female"
    *goto Naming

What have I done wrong? I can’t figure it out. Lol. I’m not much of a coder…

Capitalization can mess things up, though not sure if that’s your problem here. Ideal practice is apparently to capitalize nothing and use the $!{stat} format if you need it to display in caps in the text.

To get your code to display here with indents, type < pre > and < /pre > without spaces on either side of the code. It’ll display with yellow highlighting as you may have seen in other threads.

@Havenstone Thanks. I did that with the names, but I figured that I could just do it the other way too. Anyway, you did fix the problem for me… I ended up having a few more errors following that one that I eventually corrected too and now I have none. Other than my Stat Screen seems to have forgotten I am a guy… God I think I might possibly be the worst coder ever and should just stick to pen and paper.
lol.

I had another issue posted, but I fixed it just now.

We’ve all been there. :slight_smile:

@Sid
I was like a monkey when it came to CS :stuck_out_tongue: I only started to become decent at it after TotDH was published.

Another useful tip is that you can capitalize things in the stat screen by giving them another name, like this:

*percent cunning Cunning
*text name Name
*text gender Gender

Basically, anything after the variable will be what shows up on the stat screen.

Should have gone with a boolean, *MC_is_male false/true. Then just create an additional var for text if you need display male/female. I’ve got a ton of em just for he/she, him/her, his/her etc.

Speaking of capitalization, you can also capitalize text variables when displaying, like so; !{var}, and if you need it being shouted, just write !!{var}.

@Samuel_H_Young

You can also do this

text Name

the follow up word is used if you want the variable to be shorter for coding reasons I.e

percent sword Swordmanship

Or

text dhr Demon Hunter Rank

@Nocturnal_Stillness
Awesome!

Okay Thanks to all your help I managed to get it to work with a check.

*create Name ""
*create Gender ""
*create Sexuality ""
*create Strength 50
*create Stealth 50
*create Compassion 50
*create Intelligence 50

*create MC_male false
*create heavy_armor false
*create light_armor false
*create lute false
*create spouse_dead false
*choice
  #The barkeeper smiles, looking at you, and replies, "No I don't, Sir."
  
    *set MC_male true
    *set Gender "Male"
    *goto Naming

  #The barkeeper smiles, looking at you, and replies, "No I don't, Ma'am."
  
    *set MC_male false
    *set Gender "Female"
    *goto Naming

I tested both options and you Gender does not show up until you choose one, afterwards it gives you the corresponding gender to which you’ve selected. I legit feel so happy I finally got this to work.

Now all that’s left is to figure out how you get the correct pronouns to fit each gender. Ill try it on my own and see if I can get it; otherwise, I’ll be back to the forums for more answers. lol.

Thanks again for the help, @Havenstone, @MutonElite, and everyone else.

EDIT: I have another question, but more along the lines of comprehension of what I’m asking for you to answer during this dialogue. Is it easily understood that you are replying for her in order to select your gender? Or should I choose another way to go about this?

Dialogue as you would read it (if you selected to be a bard earlier in the game):

“It’ll be ready for you in just a moment.”

The barkeeper gives you what you’ve asked for and you hand her some gold to pay for it.

“So what brings you here so early in the morning?”, she asks.

“Nothing important. I just have some gold to spend, and I’d like to use it before I end up lossing it.”

She answers, “I know exactly what you mean.”

“Well, you don’t have to worry about singing the wrong song to a noble and end up lossing gold because of it,” you joke.

((Choice)):

The barkeeper smiles, looking at you, and replies, “No I don’t, Sir.”

The barkeeper smiles, looking at you, and replies, “No I don’t, Ma’am.”

@Sid I’d say that’s pretty clear.

Here’s what I’ve done in terms of pronouns (it might be a bit overkill);


*create MC_malefemale ""
*create MC_sondaughter ""
*create MC_fathermother ""
*create MC_brothersister ""
*create MC_boyfriendgirlfriend ""
*create MC_husbandwife ""
*create MC_lovermistress ""
*create MC_loversmistresses ""
*create MC_fiancefiancee ""
*create MC_manwoman ""
*create MC_menwomen ""
*create MC_hisher ""
*create MC_heshe ""
*create MC_himher ""

PS. Did you mean to spell it lossing?

@MutonElite Thank you very much for the pronoun list, and no I didn’t. I’m glad you caught that. lol. That is slightly embarrassing.

There’s no spell check in Notebook…

Okay since I thin there was already a thread answering this question, I won’t start a new one for it.

I’m attempting to make an *if statement with three variables that are all true/false. I saw that there was an answer for such statements if all were true, but some of mine are false as well.

This is what I have:

*if (((MC_male = true) and (Drunkard = true)) ((and dead_spouse_male = false)))
  *set Sexuality "Heterosexual"
  *goto Naming

*if (((MC_male = true) and (Drunkard = true)) and ((dead_spouse_male = true)))
  *set Sexuality "Homosexual"
  *goto Naming

*if (((MC_male = false) and (Drunkard = true)) and ((dead_spouse_male = true)))
  *Set Sexuality "Heterosexual"
  *goto Naming

*if (((MC_male = false) and (Drunkard = true)) and ((dead_spouse_male = false)))
  *set Sexuality "Homosexual"
  *goto Naming

Okay yeah, I fixed it, sorry for the bother. I accidentally had the parenthesis in the wrong place on the first *if.

@Sid
It’s still good practice to make all your variables lower case :stuck_out_tongue: Jason’s gonna make you go back and fix it if and when you submit your gamebook xD

Do only drunkards get a sexuality? :slight_smile:

@Samuel_H_Young Man, I don’t know if I’ll finish it. I have been working on it for less than 24 hours, just finished the first scene, and my word count is only at 2337. I’m not getting my hopes up that I publish it. lol.

However, if I do, I guess its best t go back and fix all that before I have to spend weeks doing it. This is going to kill my ODC. :((

@Havenstone At this point in the story yes, because they were already married once. Other backgrounds won’t have a sexuality until later on.

Alright, sadly I have yet another question… How do I go about writing/coding different MC genders and pronouns? Do I just write one passage, then copy/paste it, rewrite all of the pronouns, and add:

*if MC_male = true
  *goto male passage
*if MC_male = false
  *goto female passage

Or is there a better way to go about this? Because I really don’t want to have to make separate labels for each gender for every passage. I understand coding can be redundant, but that seems a bit much.

I created the pronoun list, but I don’t know exactly how to use something like that to actually make my life any easier. lmao.

After this, I think I should be free of any problems, as I made the first scene with a lot of (what I’d consider) complex coding. Since I now know how to do all of that, I think I can breeze through the rest.

Have a look here for ideas:

And for pronoun switching, make variables for each pronoun. Create the variable his in startup, for example. Set it to “his” for a male character, “her” for a female. Then write ${his} in your text, and it’ll display as the appropriate pronoun.

As an example of what this can look like in Choice of Rebels:

"Don't call ${him} '${milady}'," Chirex retorts at once.  "$!{He} has forfeited all right to the title.  Call ${him} Shame-Veined, for ${his} treachery brings disrepute on all who share ${his} blood."

@Havenstone, and once again I thank you. I think I now understand CS enough to finish up a game. After I put the final touches on the first scene I’ll post it and see if anyone likes it. If it’s not good or too boring, then I’m not going to waste a ton of time doing this. lol. It should be up in an hour or two.

@Sid
Well if it’s not great, you could always edit it according to feedback :stuck_out_tongue: that’s the point of beta testing, my friend :slight_smile: