Invalid Variable name?


#1

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?


#2

Are you creating the variables in the startup file?

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


#3

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


#4

Numbers generally aren’t included in quotes.

Are you using the newest version of choicescript?


#5

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?


#6

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.


#7

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


#8

… 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?


#9

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?


#10

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


#11

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


#12

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


#13

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.


#14

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


#15

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


#16

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]


#17

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”


#18

Already have it fixed. Thanks.