Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Using Twine for collaborative writing - Guidance needed (SC 2, PHP)

Happy new year, everybody!

As a language teacher, I started using Twine for collaborative writing in class and have my students alternately write different threads of interactive fiction.

Until now, I had my students send me their passages by mail, corrected & added them to Twine, exported HTML, etc.
I'd like to improve this workflow and add some features, which could make the writing task more attractive to students and a little less labor-intensive for me. I have some ideas, but am not 100% sure if they can be accomplished the way I imagined. Any suggestions are greatly appreciated.

1. Students should be able to "like" passages written by their fellow students. Each passage holds a button which shows the "likes" the passage received by then and increments upon clicking. The amount of likes is limited, upon the last possible click the new counter-information is stored on the server. I was thinking this could be accomplished with an object, which holds all passage names and counter infos, which is then sent to a php-script which saves the object in a text file on the server. For the loading part, I thought I could display the twine-html within a php file, which reads the above text and hands the object over to Twine / JavaScript. Is that a doable approach? Or could a php file read the object, save it in a cookie and the forward to the twine, where the cookie is read?
For the php-related part I'll need to hire somebody, so it would be good to have an idea of what's possible and what not.

2. Instead of writing me emails with their story continuations, I thought I'd offer a button at the end of each (or selected) passage, which upon clicking opens a textbox, where they can type their text, which is then sent to me by mail. For this, I thought a simple form mail script should do the job. Or maybe use google forms to have their ideas put in a spreadsheet.

3. There should be some form of a rudimentary login system. This way I could reflect who wrote each of the passages (using avatars). The amount of students is limited (<50) and I have real-life-interaction with them, meaning I could give them an ID/Password-combination face-to-face. As there is no personal data nor sensible information involved, I thought I could handle the entire log-in-process from within twine. Or is there maybe a premade & easy-to-use login-system that could do the job?

Thank you in advance for your ideas!


  • You might want to look into online hyperfiction sites that already support this sort of functionality, like Protagonize, especially if the student aren't doing much scripting as part of the story.
  • The story HTML file you create using either Twine 2's Publish to File option or Twine 1's Build > Build Story menu items consists of two parts:

    1. The HTML / CSS / Javascript that makes up the code of the selected story format's built-in engine.

    2. The story's meta-data used by the engine to generate the story's visual output, this meta-data is consists of the different passage types (Normal, CSS, Javascript, Image) you had in your story project.

    One possible solution to your request is as follows.

    a. Create a PHP database application that the students login to which would allow them to both create/store their 'new passages', as well as vote on other people's passages.

    b. Use PHP to dynamically generate a memory only version of a 'story HTML file' assembled using the static content of the story format file as well as the voted on passage data stored in the database.

    note: the technique in point B is similar to how the Twine 2 application creates the memory only output generated by the Test and Play options.

    c. If you also want to be able to see the 'current' story project in one of the Twine applications you could use PHP to assemble the passage data stored in the database into either a Twine 1 TWEE file or a Twine 2 project HTML file.
  • Thank you, both mcd for the suggestion and greyelf for the detailed explanation.

    I guess, what you propose is the ideal solution, which would allow multiple users to use Twine collaboratively, but it is also way out of my budget (as said, I'd need somebody to do the php/DB-part for me).

    So, for the moment, I'll continue looking for a cheapo way to save the like counters someplace and retrieve them from there. I had a look at the new google sheets api, maybe that would be an option.

Sign In or Register to comment.