# Invalid Variable name?

**URL:** <https://forum.choiceofgames.com/t/invalid-variable-name/1714>\
**Category:** ChoiceScript Help\
**Created:** [September 21, 2013, 7:16pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714 "2013-09-21T19:16:08Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 7:16pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/1 "2013-09-21T19:16:08Z")

</div>

I have the code as this:  
\*create fname “??”  
\*create gname “??”  
\*create gender “??”  
\*create money “0”  
\*create NationOrigin “??”  
\*create SocialClass “??”  
\*create ChosenNation “??”  
\*create Job “??”  
\*create opposed\_pair Traditional  
Radical “50”

However, it keeps on saying I have an invalid variable name: 'fname “??”  
Why does it keep saying that?

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 7:22pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/2 "2013-09-21T19:22:00Z")

</div>

Are you creating the variables in the startup file?

Can variables hold questionmarks? Can you try replacing them with xxx or something.

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 7:25pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/3 "2013-09-21T19:25:47Z")

</div>

Yes it is the startup file  
And I’ve also used Unknown, XXX, 0. But it still keeps on saying invalid variable name

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 7:29pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/4 "2013-09-21T19:29:33Z")

</div>

Numbers generally aren’t included in quotes.

Are you using the newest version of choicescript?

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 7:30pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/5 "2013-09-21T19:30:20Z")

</div>

Also is it just fname it’s having issues with. If you delete the fname line does it then have problems with the one below it?

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 7:41pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/6 "2013-09-21T19:41:40Z")

</div>

Okay. Despite the fact I downloaded this in April, apparently I do not have the latest version.

Now I just feel like an idiot.  
Hopefully that will let me fix the problem.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 7:45pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/7 "2013-09-21T19:45:53Z")

</div>

Oh no! You’re not an idiot. That’s an easy mistake to make. The new version should fix the problem.

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 7:50pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/8 "2013-09-21T19:50:55Z")

</div>

… Now it gave me new problems… aiyiyiyiyiya  
This is my first page  
\*title The Lion, The Bear, and the Dragon  
\*scene\_list  
startup

\*create fname “xxx”  
\*create gname “xxx”  
\*create gender “xxx”  
\*create money “0”  
\*create NationOrigin “xxx”  
\*create SocialClass “xxx”  
\*create ChosenNation “xxx”  
\*create Job “xxx”  
\*create opposed\_pair Traditional  
Radical “50”  
\*page\_break

now it says main not defined. What does that even mean?

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 7:56pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/9 "2013-09-21T19:56:03Z")

</div>

Is that all you have on the page?

Your numbers are wrong. I think it should be

\*create money 0

I don’t think that’s how you create an opposed pair. I could be wrong since I never use them myself. I think it’s just \*create traditional 50

Is radical on a separate line?

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 7:58pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/10 "2013-09-21T19:58:29Z")

</div>

Right, I actually fixed those. But it still says main not defined.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 8:00pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/11 "2013-09-21T20:00:41Z")

</div>

That’s all on the page? Is startup tabbed in?

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 8:06pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/12 "2013-09-21T20:06:58Z")

</div>

Yes it is. It actually works now. Just says Main not defined.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [September 21, 2013, 8:10pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/13 "2013-09-21T20:10:07Z")

</div>

Okay that’s not something I can help with. I’m sure one of our more technically adept members can work out what the issue is. Perhaps @CJW since he’s extremely good at that sort of thing.

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 8:11pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/14 "2013-09-21T20:11:46Z")

</div>

Thanks for your help. Hopefully the Main not defined thing isn’t a problem. I mean it lets everything else work.

---

<div class="post-metadata">

**Author:** ![Babisko](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@Babisko](https://forum.choiceofgames.com/u/Babisko)\
**Post date:** [September 21, 2013, 9:19pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/15 "2013-09-21T21:19:43Z")

</div>

is Main a label? Or a goto without a label?

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 9:23pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/16 "2013-09-21T21:23:54Z")

</div>

It just says Main not Defined.

But now I actually have another problem: how do you do \*if with texts?

#White  
(For refrenence this is line 131, not part of the script) \*if NationOrigin “Llewn”  
You are of the majority race of the Llewn Empire.  
\*goto First Day  
\*elseif NationOrigin “Medved”  
You are the plurality race in Medved. Still, a distinctly multi-skinned area does mean you aren’t the majority  
\*goto First Day  
\*else NationOrigin “Longe”  
You are the minority in the Longe Empire. Your skin marks you as an outsider. Your family was lucky enough to be living in the Longe Empire, due to extreme distaste of outsiders, no matter what social class you come from.   
\*goto First Day  
It says Line 131 has a Invalid expression at char 18, expected OPERATOR, was: VAR [Llewn]

---

<div class="post-metadata">

**Author:** ![andymwhy](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/andymwhy/32/34396_2.png) [@andymwhy](https://forum.choiceofgames.com/u/andymwhy)\
**Post date:** [September 21, 2013, 9:28pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/17 "2013-09-21T21:28:29Z")

</div>

If you haven’t already, change:

\*create opposed\_pair Traditional  
Radical “50”

to

\*create Traditional 50

Define it as an opposed pair in your choicescrip\_stats page.

Otherwise, I can’t see anything else that would be wrong…

For your \*if question, you need an = sign in there:

\*if NationOrigin = “Llewn”

---

<div class="post-metadata">

**Author:** ![Madwolf023](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/madwolf023/32/198642_2.png) [@Madwolf023](https://forum.choiceofgames.com/u/Madwolf023)\
**Post date:** [September 21, 2013, 9:29pm UTC](https://forum.choiceofgames.com/t/invalid-variable-name/1714/18 "2013-09-21T21:29:33Z")

</div>

Already have it fixed. Thanks.
