Howdy, Stranger!

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

Restricting access after number of plays

edited February 2017 in Help! with 2.0
I would like to be able to put a restriction or limit the number of times someone accesses one of my games. It may be this needs to be done on the actual website rather than within the game, but is there any way you can use code on certain paragraphs that would someone restrict access once a person has played say, five times?

There may be a number of ways to do this, but I am very new to this so any ideas or suggestions are welcome.

It may be that they need to enter an email address at the beginning (another answer required on how to do that!) or that it someone registers the local machine IP.

Any suggestions gratefully received. Twine 2.1 Mac OS.

Many thanks


  • edited February 2017
    It would help to know 'why' you are trying to restrict access, as that could influence the answers people give.

    In my opinion the simple answer is No, at least not without seriously changing the story (engine) to rely on information continually supplied from a (web) server.

    A story HTML file is a self contained web-application (excluding any hosted media files), this means that the end-user has total access to the code of your story as well as the media files it uses, which in turn means they can by pass any non-advance method used to restrict access.

    The following are two of the possible advance techniques you can use to try to get around this issue:

    1. Change the story (engine) to require ongoing information for a server to work.

    On possible example of this would would be to store the passage meta data on the server and modify the story to request that meta data on an as needed bases, although this option is not trivial to implement.

    2. Convert your story HTML file into an Executable based application and modify it to require information obtain from a server to work, again this in not a trivial process.
  • Thanks that's really useful. It's mainly so users can't go back and access the story and learn how to 'win' and pass on info to others (looking at using it as a learning tool for a group of people), but then once they've done that I imagine the challenge is no longer there anyhow!
Sign In or Register to comment.