Variable not changing


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


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


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

*create coat "Unknown"

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



*set coat = “Long”

might work


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


I think the finish might make it wonky

Hex, Could you post ALL of the relevant code?


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


Here’s what the stats screen looks like.

[b]Breed Info[/b]
  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"

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

There are numerous choices that look similar.


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

            (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


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


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.


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?


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?


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]
      opposed_pair listen
      opposed_pair rank
      opposed_pair like
        Love Humans
        Hate Humans
      opposed_pair vocal
      opposed_pair moral
      opposed_pair pack
      opposed_pair fear
      opposed_pair humview
      opposed_pair hon


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 “”


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)