Variable not changing


#1

So I have a variable called coat, which stands for coat length. But when I test it, no matter the breed, it doesn’t change. The variable in the startup file says coat, at the breed choice it may say *set coat “Long” but when I check the stats screen is still says Unknown


#2

could you copy the code (from startup and the bit in question? and the stats?) here


#3

There’s other variables too, but they vary with each breed.

*create coat "Unknown"


*choice
  #Breed 1
    (text here)
    *set coat "Long"
    *finish

#4

test

*set coat = “Long”

might work


#5

I believe *set coat “Long” is the proper way, no equals sign.


#6

I think the finish might make it wonky

Hex, Could you post ALL of the relevant code?


#7

If your concern is with the stats screen, we need to see the choicescript_stats file as well.


#8

Here’s what the stats screen looks like.

[b]Breed Info[/b]
*stat_chart
  text Breed
  text Size
  text Pelt
  text Eyes
  text coat
  text texture
  text tail
  text muzzle
  text Legs

The startup scene has:

*create coat "Unknown"

*choice
  #breed 1
    (text here)
    *set coat "Long"
    *goto_scene motherscene

There are numerous choices that look similar.


#9

Here’s an actual snippit from my code, edited the text though

#Bloodhound
            (info text here)
            *set eyes "Brown"
            *set subbreed "Hound"
            *set size "Large"
            *set breed "Bloodhound"
            *set coat "Short"
            *set texture "Smooth"
            *set muzzle "Thick"
            *set legs "Long Thin"
            *set tail "Long Thin"
            *set str +1
            *set smell +7
            *set int +1
            *set rescue +1
            *set listen %+5
            *set like %+5
            *set moral %+25
            *rand coatpat 1 3
            *if (coatpat = "1")
              *set pelt "Liver & Tan"
              *goto_scene puremom
            *if (coatpat = "2")
              *set pelt "Tan"
              *goto_scene puremom
            *if (coatpat = "3")
              *set pelt "Black & Gold"
              *goto_scene puremom

#10

I’m not entirely certain, but there might be several hiccups with the rand and… do the scenes continue via finish or return?


#11

Minor point: You can just do *if coatpat = 1. You don’t need the quotation marks, because it’s not a string, it’s a numerical value. It’s good practice to not treat numbers as strings.


#12

well the coatpat works. there’s nothing wrong with it at all, it’s only the coat that doesn’t work.

The scenes continue onto another scene entirely, which hasn’t been written.

What issues do you see with the rand?


#13

mainly just what gower said.
and to code more efficiently you can just put the *rand coatpat on top of the file. Will work just as well.

As for the coat: The other bits work? can you screenshot the statsscreen?


#14

Every other stat works fine, it’s literally just the coat that’s not working.

Here is the behavior stats screen.

[b]Behavioral Stats[/b]
    *stat_chart
      opposed_pair listen
        Listen
        Rebel
      opposed_pair rank
        Alpha
        Omega
      opposed_pair like
        Love Humans
        Hate Humans
      opposed_pair vocal
        Talkative
        Quiet
      opposed_pair moral
        Friendly
        Mean
      opposed_pair pack
        Pack
        Loner
      opposed_pair fear
        Brave
        Coward
      opposed_pair humview
        Tame
        Feral
      opposed_pair hon
        Honorable
        Dishonorable

#15

Curious.
okay. let’s try this:

  1. change all variable names to lower case (eyes instead of Eyes etc)
  2. change *create coat “unknown” to *create coat “”

#16

Wow. Ok, so I just found the problem. I have temp stats ready to help with making a random dog, one of the stats said

*temp coat 0

instead of

*temp coat1 0

Thanks for all the help though guys (I was about to try @MeltingPenguins thing though)