Help with coding please

Hey guys! So, I can’t figure out how to track choices in choicescript… I downloaded the the beginners guide, and that helped a ton, but I still don’t know how to make the game track the choices. The first speed bump came when I realized I didn’t know how to code the story to track whether someone decides to be male, female or NB, and how to ensure the proper pronouns are used from then on in the game.

For example, after someone makes a choice, how do I code that choice into the game from that point on? Will I need to write one story with the female option, then the same story but with the male option? If is there a way I can code the game to keep track on the choice made??

Sorry if I’m not making any sense, I don’t understand this myself, so I’m rambling a bit… Anywho, does anyone have any tips, or is there maybe another guide I can look to? I have absolutely no experience coding, so this is all very new and confusing to. Any advise would be greatly appreciated! Thank you :two_hearts:

Choices are tracked via variables, variables are declared in startup.txt (except for the ones declared in scenes which are temp variables, but you don’t need to worry about that for now)
For example,

startup.txt
....
*create male false

now say a choice is there for gender and choice is between male and female, you can set variable to true or false

*choice
  #male
    *set male true
  #female
    *set male false

now how to check variables, you can use *if to add conditions based on variables

*if (male = true)
  You are male
*if (male = false)
  You are female

Since you are a complete beginner I recommend reading through the whole tutorial on the wikia and carefully reading all the examples given in it.

2 Likes

Thank you very much, this is super helpful! I’m checking that link now :blush::sparkling_heart:

1 Like

I don’t know if you’ve seen these, but some useful guides for pronouns/getting started:

2 Likes

I have not, thank you so much!! This is a big help :heartbeat:

I also recommend looking at the documentation on multireplace; it can be useful to make your gender variables numeric so that you can write code like:

You’re wearing a T-shirt that reads @{(gender) “Skater Boy”|“Skater Girl”|“Skater Kid”}.

Rather than:

You’re wearing a T-shirt that reads
*if (male)
“Skater Boy”
*elseif (female)
“Skater Girl”
*else
“Skater Kid”

1 Like

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