Twine 2.0 as a desktop app

Some people, including me, may not like using Twine 2.0 in a browser.

So, I made a thing.

twinejs-app uses the twinejs source as a submodule, and packages it as a node-webkit app. So far it doesn't really take any advantage of the medium (for example, there are no custom menus), but it does allow running Twine as a self-contained app with its own storage separate from your browser's cache.

To-do items for the future include making a custom menubar that reflects the current screen (node-webkit allows dynamic menu changes, custom right-click menus, and actions that trigger events in the self-contained browser), text injection to change the introductory text to better reflect the non-browser package, and code injection to add native open/save dialogs for saving stories rather than the somewhat roundabout export process.

Comments

  • Code has been updated to 1.1.0, adding generation of a Help menu with license information and links to the twinejs and twinejs-app repos. There's also a Twine -> About item on OS X with the same license info.

    Next up is something to generate app icons from the logo.svg file bundled with twinejs, rather than separately committed pregenerated icons.
  • This is great! I think a desktop version of 2.0 will fill in some holes in functionality that a browser-based version has, especially with regards to limitations in local storage. I also think node-webkit is probably the right way to approach the problem of including external multimedia files.
  • This looks like it'll be super handy. But I currently can't get the .exe to run properly. It gives me the following error:

    Uncaught node.js Error

    TypeError: undefined is not a function
        at app://host/app.js:9:9
  • [quote author=Aleks_S link=topic=1968.msg5422#msg5422 date=1413962152]
    This looks like it'll be super handy. But I currently can't get the .exe to run properly. It gives me the following error:

    Uncaught node.js Error

    TypeError: undefined is not a function
        at app://host/app.js:9:9

    The code is trying to create a MAC OSX type menu item, which won't work on a non-OSX operating system.

    I have posted an Issue on the projects github site.
  • greyelf wrote:

    [quote author=Aleks_S link=topic=1968.msg5422#msg5422 date=1413962152]
    This looks like it'll be super handy. But I currently can't get the .exe to run properly. It gives me the following error:

    Uncaught node.js Error

    TypeError: undefined is not a function
        at app://host/app.js:9:9

    The code is trying to create a MAC OSX type menu item, which won't work on a non-OSX operating system.

    I have posted an Issue on the projects github site.


    Thanks.
  • New Windows build available here. Please try it and let me know if it works.
  • This happen when i click permanent passage link while on test mode. I click it by accident and need to restart Twine desktop to continue working.

    [quote]Uncaught node.js Error

    Error: Could not find template: '#templates .storyListView'
        at e (app://host/twinejs/dist/rsrc/js/twine.js:2:20126)
        at c.extend.loadTemplate (app://host/twinejs/dist/rsrc/js/twine.js:2:25907)
        at c.extend.load (app://host/twinejs/dist/rsrc/js/twine.js:2:25732)
        at Function.c.extend.get (app://host/twinejs/dist/rsrc/js/twine.js:2:25471)
        at Object.f.Renderer.render (app://host/twinejs/dist/rsrc/js/twine.js:2:26234)
        at f.CompositeView.f.CollectionView.extend.renderModel (app://host/twinejs/dist/rsrc/js/twine.js:3:2156)
        at f.CompositeView.f.CollectionView.extend.render (app://host/twinejs/dist/rsrc/js/twine.js:3:1674)
        at c.extend.show (app://host/twinejs/dist/rsrc/js/twine.js:2:23181)
        at Backbone.Router.extend.routes.stories (app://host/twinejs/dist/rsrc/js/twine.js:9:14853)
        at c.extend.execute (app://host/twinejs/dist/rsrc/js/twine.js:2:8918)
  • originalbluesin wrote:

    This happen when i click permanent passage link while on test mode. I click it by accident and need to restart Twine desktop to continue working.

    [quote]Uncaught node.js Error

    Error: Could not find template: '#templates .storyListView'
        at e (app://host/twinejs/dist/rsrc/js/twine.js:2:20126)
        at c.extend.loadTemplate (app://host/twinejs/dist/rsrc/js/twine.js:2:25907)
        at c.extend.load (app://host/twinejs/dist/rsrc/js/twine.js:2:25732)
        at Function.c.extend.get (app://host/twinejs/dist/rsrc/js/twine.js:2:25471)
        at Object.f.Renderer.render (app://host/twinejs/dist/rsrc/js/twine.js:2:26234)
        at f.CompositeView.f.CollectionView.extend.renderModel (app://host/twinejs/dist/rsrc/js/twine.js:3:2156)
        at f.CompositeView.f.CollectionView.extend.render (app://host/twinejs/dist/rsrc/js/twine.js:3:1674)
        at c.extend.show (app://host/twinejs/dist/rsrc/js/twine.js:2:23181)
        at Backbone.Router.extend.routes.stories (app://host/twinejs/dist/rsrc/js/twine.js:9:14853)
        at c.extend.execute (app://host/twinejs/dist/rsrc/js/twine.js:2:8918)



    Thanks. I'll have to dig into it for this one, but my first guess is that twinejs is using require() somewhere and I'll have to figure a good way to override it.
  • That sounds like this bug.
  • Sorry about this falling off my radar for so long - real life stuff has had me awfully distracted for a while.

    That said, I've updated my code, and the previous bug should be fixed in this release, and it should be working properly. Please download and try it out.
  • Actually, it looks like my project became irrelevant at some point, as now the twinejs repo includes a build process for NW.js apps by itself.

    I'll probably shut down my project, since it looks like the twinejs devs have already put a lot of thought into integrating NW.js functionality directly into Twine.

    So that it's not all time wasted, though, I'll see about taking what I've put together and putting together a template build wrapper for exported Twine stories for others to use.
  • I have that wrapper generator here. Please check it out if you feel like it.
  • Neat, I definitely will! I added a link to it here: http://twinery.org/wiki/tools
  • I decided to make my own version of this, with a little more native into it.
    http://twinenative.weebly.com
    This is based off the latest Twine 2 code, and it's distributed under GPL.
    I've already talked with Chris about this and he said that it's okay to distribute, as long is it is in GPL.