Absolute beginner, Twine-oriented JavaScript learning

Twine Version: 2.5.1
Story Format: Sugarcube 2.36.1

Hello! I’ve been using Twine for a couple months and trying to study most community resources available, as well as official docs.

I’m completely new to JavaScript and pretty much a rookie on programming overall. I find that I can get the gist of specific commands or small blocks, but can’t follow along the more complex examples geared to specific mechanics, as they pile up functions or take basic JS knowledge for granted. My question is: are there any resources that help you start from scratch with JS in the context of Twine, step by step? I’m thinking of something like what the excellent Twine Grimoire does for CSS styling.

Thanks in advance and I hope this isn’t a repeated topic.


It’s not Twine-oriented, but my “beginner-to-expert” JavaScript resource is Eloquent JavaScript, which is a web-based book with “live” code examples.

(P.S. Full disclosure: I don’t know anything about Twine development, but I do hope this resource is helpful regardless.)

1 Like

As each Story Format defines/controls what level of JavaScript support (if any) it allows, what JavaScript API the story format’s engine has, and what outcomes can be achieved using JavaScript. Then any resources that gave instructions on the usage of JavaScript with “Twine” would likely need to be Story Format specific.

I personally don’t know of any such Story Format specific resources, other than in the case of SugarCube the relevant sections of its own documentation.

I am not very good with Javascript or Jquery, but when I do need to cobble together something I have found the Mozilla guides helpful. It isn’t specific to Twine though.

Other than that my Google searches usually end up on StackExchange like with all tech questions…

Thanks to everyone for their replies. I’ll look into those resources and approach issues on a case-by-case basis. HiEv’s sample codes also seem useful.