Help me please


#1

ugh ive been having alot of error messages :these two happen whene i open my game in the index undeterminated string constant and this one:unable to get the value of the property ‘set starting stats clone’: object is null or undefined

this one is whene i open the stats screen:
unable to get the value of the property ‘scene’ object is null or undefined


#2

Can you post some of the code so we can see.

The second one, it sounds like you didn’t define your variables in mygame.js


#3

// Specify the list of scenes here, separated by commas, with no final comma

nav = new SceneNavigator([
“startup”
,“mother”
,

]);

stats = {
clone:“1”
,name: “?”
,father’s_race: “?”
,mother’s_race: “?”
,leadership: “10%”
,strength: “10%”
,intellect: “10%”
,power: “0%”
,agility: “10%”
,dexterity: “10%”
,evil: “50%”

};

// Specify the stats to use in debug mode

debugStats = {stats};

that the mygame.js for now


#4

This is a stats screen!

*stat_chart
text name
text father’s_race:
text mother’s_race:
percent Leadership:

percent Strength:

percent intellect:

percent power:

percent agility:

percent dexterity:

opposed_pair EVIL:
PURITY:


#5

and this is my startup

*create father’s_race:
*create mother’s_race:
*create percent leadership:
*create percent strength:
*create percent power:
*create percent agility
*create percent dexterity:
*create percent evil:
It was a dark and stormy night, two figures where running under the rain. Running and running, the sound of metal and soldiers could be heard in the distance.
break_line
They hid withing a cave and hid theire till their pursuers left. A fash of lighting revealed that one of them was a…
*choice
#…human male
*set father;s_race human
*finish
#…vampire male
*set father’s_race vampire
*finish
#…wherwolfe male
set father’s_race Wherwolfe
*finish
#…draconian male
*set father’s_race draconian
*finish


#6

I’m guessing in you stats page, you have variables displayed as number? If so you need to get rid of the " and % in mygame.
Just write the variable as a number:

,leadership: 10 ,strength: 10

And so on. Putting the variable in quotation marks turns it into pure text instead of a number/percentage.


#7

ok thx il try that and ee what happens


#8

so all that happned is the first one changed to syntaxe error


#9

Don’t use uppercase letters for variable names, e.g.

percent Leadership:
percent Strength:

should be -

percent leadership:
percent strength:

That might help.


#10

so i did that and nothing changed


#11

Hmm. The apostophes in . . . ?

,father’s_race:
,mother’s_race:

try -

,father_race
,mother_race

I dunno tho - grasping at straws here. :smiley:


#12

didn’t work btw i never heard that expression before :stuck_out_tongue: then do you know about the 2 other errors?


#13

There are only two types of variables - string variables and number variables. Once a variable is given a string value, it is stuck forever being a string variable. Same with number variables. You can put numbers in strings (like “door3” or even pure number strings like “2322”). The percent thing in your stats takes only number variables and uses them to make fancy percent bar things. If you give it a variable holding the value 50, it will show a half-full percent bar thing. Just don’t give it anything above 100 or below 0. If you give it a string variable (even if the string only has numbers) the computer will get mad and yell at you. Not that that’s the only issue.

You also can’t put a ’ in a variable name. Might want to change those variables to fathers_race or father_race.

You do not want to *create a variable that you already mentioned in the mygame.js. Those variables are global variables, meaning the mygame.js already told all your scenes about those variables. You would *create a variable if… actually, I don’t really know when you’d really use that command. It essentially creates a global variable somewhere in the middle of your code. One that will crash the game if you try to access it before it is created. Also, if you do use *create (or its more useful sister, *temp), do not end the statement with a : .

Also, not sure what break_line is. Did you mean *page_break? Without the “*”, the command will be read as text to be displayed as part of the story. Also make sure you change it to *page_break, not *break_line.

Can’t check the indentation on the forum unless you add a “< code>” before the code and “</ code>” after it (no spaces). Remember when I made fancy yellow stuff in my text? That was me using < code> to tell the forum that I wanted to keep my spaces. I don’t think indentation is an issue here though since you didn’t get an error message about that.

…and about the clone thing, that was me being a unnecessarily confusing idiot. Making that variable doesn’t do anything other than make a variable. Unless you have a use for a variable called “clone”, go ahead and get rid of it.

Also, a typo - werewolf was spelled wherwolfe.


#14

ugh the first error changed again to: expected identifier string or number

adn the 2 others are still there


#15

Forgive me if I’m wrong but isn’t *create not used anymore to set up


#16

apparently so and i removed it i put it in in the first place because of the code for choice of dragons that they show you as an example


#17

Also, you put a some more colons in the stats page. It should just be text variable_name, not text variable_name:

And, your opposed_pairs thing needs to be changed. It should use the following format:
*stat_chart opposed_pair rightness leftness rightness

That displays as:

leftness [50] rightness

Where rightness of 100 means very right, and rightness of 0 means very left.


#18

and the first error changes again now its: invalid character

and the 2 others remain ugh


#19

Can you paste your code again?


#20

sure all of it?