I’ve got a problem with this.
I generate the .html file which should contain my game, but it doesn’t work.
The file opens, but it shows only the basic windows and loading bar. After this the bar is moving but the game itself doesn’t load.
Any ideas what am I doing wrong?
Do you know how to activate the browser’s console? Hit F12 when you’re trying to run the compiled game and you’ll get a window pop up at the bottom of your browser.
If you go to the ‘console’ tab and make sure “errors” are shown, there should be more information there. If you could check that and report back, I’ll have more chance of being able to help.
Apart from that, I can only suggest you just try a recompile, and double check that all your scenes are listed correctly under *scene_list.
Apologies for the bump, but since this thread is mentioned in the wiki (for game publication) I thought I’d best post this here.
I’m pretty sure I found out what was causing your problem @sokol07, in the current version of Choicescript the ui.js file is encoded differently to the other files.
I tried compiling my own game and got the exact same error you had (for the exact same reason). Changing the encoding of ui.js to ANSI (same as other .js files) seemed to fix it.
You do this via opening the file in Notepad++ and selecting the appropriate menu option before re-saving it and rerunning compile.html.
Better yet, just highlight, delete and retype the first couple of characters in the file, the asterisk and the slash: “/*”.
I’ll update this post as/if/when this is no longer an issue.
There’s still no word on an official fix for either of the bugs affecting the compilation process, but after some tweaking I seem to have managed to circumvent both of them through automatic edits in the compile process itself. This isn’t ideal, but it’s better than nothing.
EDIT: The compile code that ships with the Choicescript-master zip seems to work now. Though I’ll leave this link/version up for anyone who likes the scene list GUI and IE support(?).
In English: Basically try replacing your version of compile.html with this one:
If you do that you *shouldn’t* need to implement any of the fixes mentioned on this page, it should work straight out of the box (please let me know if it doesn’t!).
It also features a sort of experimental GUI thing I wanted to try which lists the scenes that compile can find automatically and then gives you a chance to add any more before clicking compile.
Yes, sorry as the second message implies compile.html will only work with Firefox at present, the other browsers don’t give quite so much control over local file loading (It’s not a bias reasoning, the method used simply doesn’t work in other browsers).
You actually reminded about a method I stumbled across to make compile.html work for new versions of Internet Explorer as well as Firefox. I just implemented it now, so it may be worth your time to re-download it and try again (if you’re not wanting to download Firefox).
I’m still only “officially” stating that it’ll only work in Firefox at this point in time though, as strictly speaking the method I’ve used for IE *shouldn’t* work (on paper), it just does.
If anyone wants an ftp account, I can set one up for them on my server, no problem. This way, you can upload your files (no need to compile) and run the game in your browser just like dropbox with a public folder. Just log in with an ftp client.
I just downloaded choicescript-master.zip from github today, and compile.html produced a file that didn’t work. The modified compile.html in this thread worked. I also did the above ui.js fix, but I don’t know if that has any bearing on this problem anymore. Anyway, in short, there still seems to be a problem with the compile.html in the official choicescript distro.
I have a question about compile.html. If I were to update the compile.html file hosted on dropbox, would the save files from the previous compile.html still be there? Because I know some people have already played a playtest of my game and have save files, and it would suck if their save was erased every time I needed to update the file.
It’s probably a stupid question, but I still want to know.