Vague, game-breaking Script Error

Hi, I’m like 95% done with a very large project. I have done alpha-style bug testing as I write each chapter. I am suddenly getting a vague “script error” when trying to open my index.html file. I’ve never seen this before and it’s happening so close to the end of my development it’s kind of making me panic. I’ve not recently made changes to mygame.js or the contents of the startup chapter so I have no clue what’s going on here.

Is there any chance that you included the *script command somewhere?

Never used this command before. I made a copy of my CS directory and got rid of all scenes and the script error still occurs when index.html is opening in Firefox- this would tell me the problem is either in the index file itself, the startup chapter, or mygame.js

Can you post a screenshot?

Ok that’s weird. Never seen that. Have you tried downloading a fresh copy of ChoiceScript?
http://github.com/dfabulich/choicescript/zipball/master

so I should just copy my scene files over and paste all variables and scene names back into mygame.js with new version?

You shouldn’t paste anything into mygame.js

Just copy and paste your scene files (your text files) into the appropriate folder.
In this case, it would be something like…

dfabulich-choicescript-7c0a4a6 > web > mygame > scenes

but all of my permanent variables and scene navigation are populated in mygame.js, like this:

Ok yeah, there’s the problem.
All variables and whatnot should be declared in startup.txt
You shouldn’t have to touch mygame.js at all.

someone should tell that to the CS wiki. I’ve been developing this project since 5/16 in this manner and this problem just started today, pretty weird

Never trust a wiki! :smiley:
No, but seriously, it’s not hard, it’s just tedious.

*set fname "fname"
*set rank ""
*set lname "lname"

etc.

So just in case anyone else suddenly runs into this problem-

I was following your suggestion by moving all permanent variables to the startup chapter using the *set command. Near the end I found a variable that I had set to “falses”, this was causing the script error. Once fixed to “false” everything began to work again. Thanks to Carlos for the startup suggestion and thanks to everyone else who read my question.

1 Like

Welp, I think that’s a matter of mis-wording and misunderstanding.

So, frankly speaking, when you’re writing your game/story, you only fiddle around the .txt files inside the /web/mygame/scenes/ directory. Never touch any other files, unless you know what you’re doing.

@CJW, mind to check out the wiki page?
Or maybe I can do the edit myself if I have the power to do that :sweat_smile:

Btw, isn’t the command for var declaration is *create?

1 Like

True. If you’re declaring, you use *create
Then you can change variables with *set

Also the scene list is not formatted with set or create.
It would be something like:

*scene_list
 ch1
 ch2
 ch3
 ch4

with one space before the name of the chapter.

But, you know, if you’re using Notepad++, you can just find and replace all the *set with *create on your startup.txt (Ok, I’m tired, I should stop typing now. @Szaal can handle it.) :+1:

1 Like

Yea. I was like “I’ll check the youtube for 5 mins” and then there’re 3 new notifications coming from your post alone :v

1 Like

LOL yeah I must have somehow misunderstood the entire section on default starting stats and how to populate them. My bad!

Seems like there is already a glaring great big ‘do not use this file’ notice right at the top, I think that’s sufficient.