"bad label" I can't figure this one out (SOLVED)

The error I’m getting is: Bad Label, for ‘Name’, line 6 in the choicescript_stats.

I’ve been trying to fix it on my own but …It just won’t work. :disappointed:

I also looked at the similar topics, but they don’t help me, sadly.

My code looks like this:

[b]GENDERAL[/b]

*temp name_text
*if name = 0
 *set name_text "Unknown"
 *goto name
*elseif name = 1
 *set name_text "Titan"
 *goto name
*elseif name = 2
 *set name_text "Titania"
 *goto name
*elseif name = 3
 *set name_text "Uross"
 *goto name
*elseif name = 4
 *set name_text "Ursa"
 *goto name

*temp gender_text
*if gender = 0
 *set gender_text "Unknown"
 *goto gender
*elseif gender = 1
 *set gender_text "Male"
 *goto gender
*elseif gender = 2
 *set gender_text "Female"
 *goto gender

*temp race_text
*if race = 0
  *set race_text "Unknown"
  *goto chart
*elseif race = 1
  *set race_text "Human"
  *goto chart
*elseif race = 2
  *set race_text "Elf"
  *goto chart
*elseif race = 3
  *set race_text "Half-elf"
  *goto chart
*elseif race = 4
  *set race_text "Dwarf"
  *goto chart
*elseif race = 5
  *set race_text "Half-giant"
  *goto chart

*temp class_text
*if class = 0
 *set class_text "Unknown"
 *goto class
*elseif class = 1
 *set class_text "Warrior"
 *goto class
*elseif class = 2
 *set class_text "Rouge"
 *goto class   

*label chart

*stat_chart
 text name_text Name 

*stat_chart
 text gender_text Gender

*stat_chart
 text race_text Race

*stat_chart
 text class_text Class 

[b]Alignment[/b]

*stat_chart
  opposed_pair Good
    Evil

*stat_chart
  opposed_pair Lawful
    Chaotic

*line_break 

[b] STATS[/b]
*stat_chart
  text Intelligence
  text Charisma
  text Strength
  text Dexterity

*line_break

[b]ROUGE SKILLS[/b]

*stat_chart
 percent PickLock
 percent PickPocket
 percent Archery 
 percent TwoWeaponStyle

*line_break

[b]WARRIOR SKILLS[/b]

*stat_chart
 percent CreateWeapon
 percent RepairWeapon
 percent SwordandShield
 percent TwoHandedStyle
 
*line_break

[b]INVENTORY[/b]

*stat_chart
  text Gold

*line_break

There’s no *label name on that. You need to make sure that’s somewhere in the scene to *goto name.

I tried labeling it like that actually. It froze up my stat screen.

I thought since I have *label chart I don’t need it? If I do then…is placing it on the top before temp the right way to go about it?

*goto tells the code to go to somewhere. That somewhere is the *label with the same name. So *goto foo tells the code to go to the the line labeled foo. If you have no *label foo, it pulls up an error because it has no where to go.

Example of *goto and *label being used:

Hello.
*goto foo

This line is not shown, because the *goto above skips it.

*label foo
This line is shown right after "Hello."
*finish

If you put the *label right above the *goto you have a loop. Code doesn’t know you didn’t want to go in a circle forever, so if you tell it to go in a circle forever, it’s going to go in a circle forever. It obeys what you do very strictly and won’t deviate.

Example of an infinite loop:

*label foo
This line will be looped infinite times.
*goto foo
This line will never be reached, because the *goto above returns the code to the top.
4 Likes

Basically what this helpful human being said above me.

You need to place the *label wherever you want the code to jump to. Since there’s no label to go to, then the *goto has nowhere to go and it breaks.

What you should probably do is something like this:

[b]GENDERAL[/b]

*temp name_text
*if name = 0
 *set name_text "Unknown"
 *goto name
*elseif name = 1
 *set name_text "Titan"
 *goto name
*elseif name = 2
 *set name_text "Titania"
 *goto name
*elseif name = 3
 *set name_text "Uross"
 *goto name
*elseif name = 4
 *set name_text "Ursa"
 *goto name

*label name
*temp gender_text
*if gender = 0
 *set gender_text "Unknown"
 *goto gender
*elseif gender = 1
 *set gender_text "Male"
 *goto gender
*elseif gender = 2
 *set gender_text "Female"
 *goto gender

*label gender
*temp race_text
*if race = 0
  *set race_text "Unknown"
  *goto chart
*elseif race = 1
  *set race_text "Human"
  *goto chart
*elseif race = 2
  *set race_text "Elf"
  *goto chart
*elseif race = 3
  *set race_text "Half-elf"
  *goto chart
*elseif race = 4
  *set race_text "Dwarf"
  *goto chart
*elseif race = 5
  *set race_text "Half-giant"
  *goto chart

*temp class_text
*if class = 0
 *set class_text "Unknown"
 *goto class
*elseif class = 1
 *set class_text "Warrior"
 *goto class
*elseif class = 2
 *set class_text "Rouge"
 *goto class   

*label chart

*stat_chart
 text name_text Name 

*stat_chart
 text gender_text Gender

*stat_chart
 text race_text Race

*stat_chart
 text class_text Class 

[b]Alignment[/b]

*stat_chart
  opposed_pair Good
    Evil

*stat_chart
  opposed_pair Lawful
    Chaotic

*line_break 

[b] STATS[/b]
*stat_chart
  text Intelligence
  text Charisma
  text Strength
  text Dexterity

*line_break

[b]ROUGE SKILLS[/b]

*stat_chart
 percent PickLock
 percent PickPocket
 percent Archery 
 percent TwoWeaponStyle

*line_break

[b]WARRIOR SKILLS[/b]

*stat_chart
 percent CreateWeapon
 percent RepairWeapon
 percent SwordandShield
 percent TwoHandedStyle
 
*line_break

[b]INVENTORY[/b]

*stat_chart
  text Gold

*line_break

I added labels for the code to jump to, which should theoretically make it work. (I’d have to test it, which I can’t do right now, so sorry if it doesn’t help.)

2 Likes

Fixed it! Thanks! :smiley:

1 Like

wtf, Night :laughing:

:thinking:
:man_shrugging: