Mygame.js file won't open


#1

So, I want to edit the variables, and to do that I have to open the mygame.js file. But this message keeps on coming up:
Line: 23
Char: 1
Error: ‘SceneNavigator’ is undefined
Code: 800A1391
Source: Microsoft JScript runtime error

Has anyone come across this and been able to fix it? And if so, please tell me how.


#2

Yah I had it before, what you do is download notepad ++

http://notepad-plus-plus.org/

then after its installed edit it the document with notepad


#3

Now here’s another problem: after opening it in Notepad++, I can’t figure out how to add variables. I know I sound really new at this, but that’s because I am ^^;


#4

First, you’ll probably want to start with the tutorial on the wiki: I believe this is probably the page you want to look at though.



#5

Just follow the format that is already given to you as examples. Go to a new line underneath the last variable (or get rid of the example variables) and put four spaces, a comma, the name of the variable you want to make, a colon, another space, and either a number or a word to set the starting value for the stat. When that is finished, go to the next line and repeat for your next variable. I hope that answers your question!


#6

Just follow the format that is already given to you as examples. Go to a new line underneath the last variable (or get rid of the example variables) and put four spaces, a comma, the name of the variable you want to make, a colon, another space, and either a number or a word to set the starting value for the stat. When that is finished, go to the next line and repeat for your next variable. I hope that answers your question!


#7

Oh, np no worries, I was in your shoes once, and I did the exact same thing. this is like deja vu its just im in the shoes of the other guy.

Well okay here your gonna see something like this


stats = {
    leadership: 50
    ,strength: 50
   
};

debugStats = {

};

You just go below strength and put a comma then put in the stat then you could put a number, true or false, or a name here ill give you examples of each


stats = {
    leadership: 50
    ,strength: 50
    ,name: "2Ton"
    ,sleeping: false
    ,money: 0
   
};

debugStats = {

};

the debug stats you dont need to touch, its just there to be debug copy over your stats so putting anything inside of it would be useless but dont take it out its needed


#8

Thanks for trying to help, but it’s still not working :frowning: I don’t know what I’m doing wrong, each time I open ‘index’ after editing the variables it says ‘invalid character’. This is what my formatting looks like (just as a test):

stats = {
cats: 50
,shoes: 50
};

It still refuses to work :’(


#9

And sorry if it doesn’t look like there are any spaces indenting “cats” and “shoes” up there ^. There are, but my iPad doesn’t want to show them.


#10

That looks right… but there may be something in the file that is screwing it up, Can you send the file to me?


#11

Okay, now I’ve got another problem ^^; But don’t worry, I think I’m getting closer. Now as long as I add the strength and leadership variables, I’m not getting any errors. But when I add other variables on to it, they don’t show up in the index.


#12

Oh yah dont capitalize stats, thats for future references.

Anyway, I think I see your problem… I misunderstood it at first… this is what you wanna do…

You can erase the strength and leadership and put it the way you had it, THEN you go to your scenes folder and clock on choicescript_stats

then erase the leadership and strength from that and ass the stats you put in


#13

“invalid character” could be a result of copy and paste. I realized that sometimes word converts your symbols like ",-;._: into something that looks similar but is not the same (just for style, I guess). If you copy and paste those symbols into mygame.js it can’t interprete them as code but as some kind of strange unknown symbols.

Make sure your : are really :, your " are " and so on…


#14

Thanks, I finally got it to work!


#15

Glad to hear, if you need anything else dont be afraid to ask