Howdy, Stranger!

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

Saving twine data to a user database? (Possible?)

Hello. So i'm gonna preface this by saying I'm pretty new to the site and in coding in general.

I have a couple questions. Right now Im working on creating a browser based interactive novel with twine. The goal would be to release the project chapter at a time and allow the player to continue the story from where they last left off. INCLUDING the variables that changed in the last chapter.

For example: If they are given the choice between the sword or the axe in chapter 1 and they choose sword, that choice should be shown in chapter 2 as well as chapter 1.

So essentially I'm looking for a way for users to save their data and allow further twine files to access these saved variables.

I would just like to know if anyone has any ideas if this would be possible and how it could be done. Ive talked to a couple of people that are more versed in coding than me and they have given some okay advice. The only programing languages I'm very familiar with are Python and HTML.

One friend advised creating a user database with Python that allows you to save the variables as a text file that the program would then try and read when it needed to access that specific information. But I'm not even sure if twine and python can be used with eachother.

Im not sure exactly, I hope this makes sense. Please, if anyone has any ideas, I would really appreciate some help.

Comments

  • Users of Twine games/stories interact with whichever story format was used to compile the project.  Twine (1 or 2) story formats are JavaScript/HTML/CSS applications, so your ability to interoperate directly with Python is essentially non-existent.  Whatever you do, it's likely going to have to be done within the constraints of browser-based JavaScript.

    You might want to look into the SugarCube story format, as it includes a built-in save system.  Specifically, if you follow certain constraints, its saves are capable of being loaded by successive chapters, thus allowing multi-chapter/episode projects (this particular scenario was, in fact, an early part of the save system's design).
  • Alright, thanks! Ill work with this then. Seems to be pretty cool. :)
Sign In or Register to comment.