Problem with *Set variable fxn

Hi all

I’m doing something wrong and I’m not sure what. I am trying to create an honorific variable, which I’m setting up like this, initially.

When your hair is as situated as you can make it, you head to your closet. A bit later, you emerge, dressed and ready to set out to face another day as a:
*create honorific
*create gender
*choice
#Man
*Set gender “man”
*Set honorific “Mr.”
*Finish
#Woman
*Set gender “woman”
*Set honorific “Ms.”
*Finish
#Non-binary Person
*Set gender “non-binary person”
*Set honorific “Mx.”
*Finish
*page_break

This runs fine, per the quicktest.

However, the choice script page is encountering an error where is says “non-existent variable ‘honorific’”

The code for that page is

Know Thyself
Player: ${honorific} ${First_name} ${last_Name}

How do I fix this?

Thanks so much in advance!

John

Does the *create look like the above or like this

*create honorific ""

? With the “”

Like @MeltingPenguins asks you need to make sure you declare what type of variable it is.

For example;

*create name ""
*create age 25
*create armed false

*set name "Matthew"
*set age 42
*set armed true

${name} is a ${age} year old writer. 
*if (armed)
    He is armed with a pen, which of course is mighter than a sword.

Also I’m pretty sure the location where the *create is matters.

Yeah create should only be used startup.txt

Thanks!

I added the quotation marks, and it is in the startup.txt file, but is still isn’t recognizing it? Any other suggestions?

make sure that *set is in lowercase as well in your example you use *Set

Put the *create straight after the scene list instead of having it in the middle of the text

Thanks!

Changing the capitalization on set didn’t seem to matter much, FYI, but moving the create line worked great!

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.