Coding for names


#1

Today I’ve been stuck trying to put the code in for choosing your characters name part of the game. I’ve been looking through the forums at the threads already about this, and while they have helped me somewhat, I’ve now stumbled upon another problem that I haven’t seen mentioned.

I keep getting this error message “Error: startup line 118: label ‘input_name’ already defined on line 99”

The name options come after you choose the gender of the character, and I have figured out that when I take out one of the gender and name options for that gender it goes through fine. But when both are in it does not go through and I get that error.

Can anyone help?

*choice
  #I am a man
   *set gender "male"
   Well that's a start. What is your name?
   *choice
    #bob
      *set name "bob"
    #name
      *set name "name"
    #idunno
      *set name "idunno"
    #something
      *set name "something"
    #None of these
      *label input_name
       My name is
      *input_text name

  #I am a woman
   *set gender "female"
   Well that's a start. What is your name?
   *choice
    #blar
      *set name "blar"
    #narsha
      *set name "narsha"
    #naame
      *set name "naame"
    #name1
      *set name "name1"
    #None of these
      *label input_name
       My name is
      *input_text name

#2

Without seeing the source, it’s hard to say, but could it be an indentation issue? Kind of a wild guess.


#3

Ah sorry! I’ve added the code. I’m really new to coding and such so I’ve probably just done something really stupid or it is really obvious


#4

That error has got nothing to do with the naming itself. It just means that you’ve got two labels called ‘input_name’.
Just changing the name of one of the two identical labels should fix the issue.


#5

You have two *label input_names You can only have one label per scene the same. Did you mean to put a *goto input_name instead of the second?

Aha! Too slow. @Cecilia_Rosewood beat me to it.


#6

:stuck_out_tongue: Ninja’d


#7

Thank you! It’s sorted now.

Now I just need to figure out how to do surnames XD


#8

I keep meaning to update it with stuff like how to ensure names are always capitalised.