Hello Twine people!
I'm in the process of making my first game in Twine. I'm a pretty advanced dev and I teach creative coding. I'd really love to use p5js to visually illustrate my story and I'm just looking around to get my head around how Twine works. Just from a cursory read it looks like it's maybe (?) using require js and a few other scripts. (Just saw the require keyword in the docs - might be a false assumption. I've not torn it open yet under the hood)
1. Is there somewhere online where you explain how this tool is built and what the architecture is?
2. Is a not minified version out there on git? I'm going to look here in a second but that would be helpful. The way all of this gets slammed into one HTML file hurts my mind a bit. Is there a reason or can we break it into the logical structure with a folder for css and scripts so we can manage it with a bit more sanity?
3. Has anyone here integrated p5js? I'd love feedback.
best,
Phoenix
Comments
1. Story Formats - (Harlowe, SugarCube, Snowman 2)
Each story format file contains a Javascript engine which defines a story's default look and feel, the default feature set of the story, and the macro language (syntax and default list of macros) used by the Author
2. The Twine editor
This application allows the Author to edit the Passages (text, CSS, Javascript) that make up the Story, which they then combine with a Story Format to build a story HTML file.
Which of these are you asking for more details about and which are you thinking about using p5js with?
Would it just be easier for me to pull it out as a json object and link everything together myself? Maybe this is just bad planing but I really like the way Twine lets me rapidly write and linking it to p5js would be fun because I'm already really good at Processing.
Thoughts?
Furthermore, if you are including p5js by placing it within the Story JavaScript, then you'll probably have to wrap it within a function so you can ensure that this is a reference to window, which is easily enough done. For example, place this in the Story JavaScript and follow the sole instruction therein: Alternatively, you could edit the published HTML to add a <script> tag which would load it from an external source. For example: