How To Turn Your Twine Games Into Windows ExecutablesSome people are unhappy with the current .html format of Twine games. This tutorial is meant to show you how to turn .html Twine games into .exe Windows files.RequirementsYou will need:
NW.JS: https://github.com/nwjs/nw.js
Your Twine game's .HTML file
Extract NW.JS with a ZIP extractor.
Now, let's continue!
Configuring package.jsonWe will need a proper package.json to do this.
Download the attached.json, open it in Notepad,
and change "gameName" and "gameAuthor" to the name of the game, and your name respectively.
Rename your HTML to index.html
For "license", put any 3 or 4 letter license, like GPL, MIT, LGPL and other licenses.
Save the file as 'package.json' in the directory where the HTML file is.
Compiling The ExecutableMake sure you extract the NW.JS archive.
Now, in the directory the HTML file is in, put all the required files for your game, and then put everything in that directory
into a zip file.
Rename the zip file to blablabla.
nwMAKE SURE THE EXTENSION IS
.NWIf you cannot see the extension, press Windows+R and type 'cmd', then hit enter.
Then, in CMD: type:
cd "*directory where HTML file is*"After that:
ren *name_of_ZIP*.zip *name_of_ZIP*.nwTake the .nw file and put it in the same directory you extracted the NW.JS in.
It's the right directory if there is a 'nw.exe' file.
Now, go back to CMD and type this in:
cd "*NW.JS directory*"After that:
copy /b nw.exe+*nameofnw*.nw *nameofgame*.exeAnd you are done!
DO NOT DELETE THESE FILES: *nameofgame*.exe, nw.pak, libGLESv2.dll, libEGL.dll, icudtl.dat, ffmpegsumo.dll, d3dcompiler_47.dllDelete all the other files.
Finally, put your game's license in.
And that's it.
Comments
Thanks for the tutorial btw
Generally what the accepted method for ensuring operability for all is to make 2 versions, one compiled for 32 bit and one for 64 bit. From there you can have the user pick a version or have a script detect the user environment and supply the correct installer.
There MAY be options to Compile a 32 bit executable in a 64 bit environment, but you'd have to check the compiler's documentation.
The way I imagine 32- vs 64-bit architectures is like this. Imagine that you have two rooms, and one is one story tall (a 32-bit architecture) and one is two stories tall (a 64-bit architecture).
Now you have a two-story-tall lamp (bear with me) and a one-story one. Your two-story one lights things up better, since it's higher up, but you can't fit it into a 1-story room because there's a ceiling in the way. You could, however, fit a 1-story lamp into a 2-story room, but it's not optimal, since you can just get the 2-story one and it lights better, provided it fits in the room.
However, if you have a lamp that you know is going to be switching around from a one-story to a two-story room, you would get the one-story, because non-optimal beats impossible. Following the analogy, you'd get a 32-bit compilation (if that's the word) if you knew that you'd have it running on 32- and 64-bit machines. Best is providing download options for both, though.
Oh and when you open it, remember to click File and then Open Project to import your stuff. It's not immediately obvious and you can sit wondering why the boxes are all greyed out.