Compile.html - Has anyone used it?

So a while ago now, after a chat with Dan and Jason, I created this file.
It should be included in all the latest versions of choicescript downloaded from github. It’s pretty simple and does exactly as you’d expect, it just takes all your game’s script and scene files and compiles them into one “complete” .html file.

The obvious primary advantage of this being that it’s much easier to share, distribute and “publish”.

I was just wondering if anyone had actually noticed it and/or had the chance to use it and if they had, what were their thoughts on it? Does it work ok? How useful is it? Are there any ways it could be improved? Does it bug out at all? Etc.

Any feedback at all would be greatly appreciated! :slight_smile:

TY

I did not even notice it, but I will definitely give it a whirl. This is a good ideal.

We’re sorry, Google Chrome has blocked ChoiceScript from functioning. (“file:” URLs cannot load files in Chrome.) ChoiceScript works just fine in Chrome, but only on a published website like choiceofgames.com. For the time being, please try another browser like Mozilla Firefox.
EXPORT FAILED
Error: Could not open web/mygame/index.html
Your browser may not be supported. We recommend using Mozilla Firefox with compile.html.

Damn…

Yeah sadly - at this stage - making it work locally with Chrome or IE seems like a big no, no :frowning:

EDIT: That’s a lie, on closer inspection I think I can get it working for the later versions of IE… But it’s going to be difficult in Chrome for the same reason CS games won’t run in it.

Although, saying that - another advantage of the complete html file is that your games will actually run in chrome because you’re not sourcing external files.

EDIT: Or perhaps it IS doable…
@Aquila challenge accepted! :stuck_out_tongue_winking_eye:

I can make IE10 work, but Chrome will only work with a security bypass, which isn’t ideal…

Is that what that does? I’ve been wondering. :slight_smile:

Thanks for letting us know, @CJW. I’ll definitely poke around at it a bit for a few days and report back.

It doesn’t work with IE 9 at all?

I’ve had no problem putting stuff on Dropbox and just connecting to the index.html, so I’ll probably not use it due to lacking Firefox. But it definitely will be useful for a lot of people who like to share demos through Dropbox, though I wonder if it would make updating demos more difficult.

I only have android but I download a firefox app today and seem work fine so I could take a look but until now I never have any problem with drop box

@CS_Closet Thank you!

@Rhodes No sorry about that, IE9 and below don’t seem to support any form of blob construction (how the file is generated) - it can be made to work in IE10 and 11 though, and I’m working on that.

@MaraJade It’s not meant to replace dropbox, I’m actually trying to incorporate something to help you automatically upload it to dropbox or google drive once it’s been compiled.

At this stage it’s not really meant to do anything specific or revolutionize the way you distribute your WIPS, arguably the game’s are more efficient in this format, as the scenes are in JSON to begin with, they can be read straight away - in the standard text file format they have to be converted to JSON beforehand. You also load everything at once so there’d be no file retrieval load between scenes.

It also makes the games very easy to download, whilst playing you can just *right-click -> save as*, though I’m sure some of you will see that as a bad thing.

@CJW
Quick question - Do all of the scenes need to be listed under *scene_list in order for the mygame_complete.htm file to be generated properly? The game I’m testing uses unlisted scenes for game overs and a save system, and an error pops up every time the game tries to jump to either one of them.

Yes they need to be listed under *scene_list or in mygame.js
This is an annoying requirement, caused by browsers being unable to read files/folders on local directories. :confused:

Alright. Scene issue now fixed, I’ve successfully managed to get a working game compiled, and I’ve been able to play without any problems on Firefox and Safari (uploaded to dropbox, the game plays fine on Chrome and IE as well).

The only issue I’ve actually encountered is in getting anything compiled in the first place. I tried locally with Firefox and Safari; Firefox stops the process at “Combining scene files…”, Safari stops at “Assembling new html file…”. Tried it on a different computer with the same results. Couldn’t really figure out what was stopping it.

I had to resort to uploading everything to Dropbox (which still wouldn’t compile in Firefox or Safari) and managed to get both IE and Chrome to finish the process.

Despite those troubles, I do like the results. The lack of loading time, especially, is fairly awesome. It’s a much easier way to send the game to someone as well, and testers don’t have to sift through files that don’t need to be touched to find the game. Very nifty feature @CJW. Thanks for making it!

Pretty much every browser except Firefox will break at this stage, as it relies on features and setups not native to most browsers. There’s actually a command line version which works a lot better but it requires node.js, which most users won’t have and (presumably) won’t want to download.
So I’m not sure why you had problems with Firefox locally, that’s where it *should* work best.
Thank you very much for the feedback! I’ll continue to work on it, and hopefully iron out all these inconsistencies :slight_smile:

I’ve managed to compile Unnatural for my beta testers. I’ll let you know if they have any issues. (Only issue I have so far is a dropbox issue so no worries there)

edit:

the compiled file works when I try it on the version I download but it doesn’t work when i copy and paste the public link from dropbox (instead it opens up a text file with all the files together) it may be something I’m doing wrong but I thought I’d let you know anyway.

edit: wrong button sorry.

@Nocturnal_Stillness Thanks for the feedback!
Could you please PM me a link to the hosted file you’re having issues with?

Sure I will do.

@Nocturnal_Stillness how was this solved for you? because when i try to compile it does the same thing…

To be honest I can’t remember. Sorry :frowning:

Oh lol all good then dude :joy:

Compile.html is very handy. Everything is in one file and easier to share / copy / host.

@CJW do you know if there is a way to launch the compiling process from Terminal so it can be automated? I can see some code in compile.js referring to “process”, so it looks like most of the stuff is already in place.