I want name "Unknown" but the game like "nah"

K, guys since you helped me fix this i’ll let you have a short ass demo for my game :smiley:
PM me and i’ll send it to ya. :smiley:

Alright, let’s go through this from the start.

Variables (basic)

A variable is a word or a number.
In startup.txt you create each variable once and only once. Creating the same variable again with a different value will either just erase the old value or cause errors.

Example:

*create name "Unknown"
*create age 21

That is good code.

*create name ""
*create name "Unknown"
*create name "Bob"

That is bad code.

At the start, just create the variables that you know you will need. Later on, you can create more by adding to the same list in startup.txt

You should have something like this:

*create name “”
*create age 21
*create strength 100
*create speed 100
*create gender “male”

(Note - the gender has been set to male with no female or non-binary listed. That doesn’t mean only males can play. It is just a default setting and the question of gender, the same as the question of the players name, will be asked later. This is for an example. You could just as easily set it as “unknown”).

Then you can start to customise with your story:

You walk into the castle and see the dragon.  It looks at you.  We all know that dragons love to eat females as they are tastier than males.  Is the dragon interested in eating you?
*choice
  #Yes, I am a female after all.
    *set gender "female"
    *goto name_choice
  #No, I am a male.
    *goto name_choice
  #Perhaps, I am neither female nor male.
    *set gender "nonbinary"
    *goto name_choice

*label name_choice
*if gender = "male"
  What is your name, sir?
  *choice
    #My name is Bob.
      *set name "Bob"
      *finish
    #My name is Robert
      *set name "Robert"
      *finish
*elseif gender = "female"
  What is your name, ma'am?
  *choice
    #My name is Bobetta.
      *set name "Bobetta"
      *finish
    #My name is Roberta
      *set name "Roberta"
      *finish
*else
  What is your name?
  *choice
    #My name is Bobby.
      *set name "Bobby"
      *finish
    #My name is Rober
      *set name "Rober"
      *finish

(Note, I didn’t check if the gender was nonbinary as there were only 3 options and the first two had been checked. Just using *else automatically narrows it down to the remaining choice. You don’t need to do the gender check before the name check, but if you are offering preset names then it makes sense).

In your stats page, do everything as you had previously.

2 Likes

Umm, you see, i already fixed this.

Read it anyway - I think you might learn a lot.

6 Likes