My Questions With ChoiceScript

So I wanted to know if there is an easier way to code this? It works perfectly fine for now, but if there is an easier way please let me know!

*title Project 01
*author Evan Nicolas
*create name "Unknown"
*create surname "Unknown"
*create Crown "Crown"
*create Smith "Smith"
*create Raven "Raven"
*create Blood "Blood"
*create Wraith "Wraith"
*create gender "Unknown"
*create Male "Male"
*create Female "Female"
*create race "Unknown"
*create Werewolf "Werewolf"
*create Vampire "Vampire"
*create Shadow "Shadow"
*create Demon "Demon"
*create Ghost "Ghost"
*create male1 false
*create female1 false
*create nice false
*create rude false
*create badass false
*create werewolf1 false
*create vampire1 false
*create shadow1 false
*create demon1 false
*create ghost1 false
*goto_scene intro

It can be really confusing to have all these labels for things, but like i said, as of now it works.

When you are creating gender, you’re going to want to do something like

*create gender ""

Because later you will give the player a choice like

What is your gender?
    *set gender "m"
    *set gender "f"
    *set gender "nb"

You can also do true false variables like

*create m false
*create f false
*create nb false

And then do this

What is your gender?
  *set m true
  *set f true
  *set nb true

You’ll want to do one of these for your race variables as well because otherwise your code thinks that the player is all of these things, and you can’t use *if statements

One more thing, what you’ve shown us here is variables, not labels. Just want to clear that up so that you have the vocabulary to ask more questions later if you need to

Here are some resources to help you learn how to code using choicescript:
The wiki is here
The tutorial is here
And there are lots of resources on the forum too


Okay, Thank you!

1 Like

In terms on gender, on my own work, I use

*create gender 0

Your gender?
      *set gender 1
      *set gender 2
      *set gender 3 

This is the simplified version, of course. And since I’m the kind who see things through the practical lense, instead of [gender], I actually used [sex] and [nb].


Thank you!

If you need to remember what the numbers correspond to, you can set “dumb” variables in your startup that just remind you what the options mean.

For example from a side project I’m doing, the type of clouds are important and often change, so I have a numbered “cloud” variable that I use to modify what happens in different cloud conditions.

To help me remember what the numbers correspond to, I wrote this:

*create cloud_1 "stratus"
*create cloud_2 "cumulus"
*create cloud_3 "stratocumulus"
*create cloud_4 "nimbostratus"
*create cloud_5 "cumulonimbus"
*create cloud_6 "altostratus"
*create cloud_7 "altocumulus"
*create cloud_8 "cirrus"
*create cloud_9 "cirrostratus"
*create cloud_10 "cirrocumulus"

Wow… that came out of nowhere…

This seems to be solved, and we don’t need this thread moving even further into immaturity.