User Tools

Site Tools


This is an old revision of the document!

Add Stats, RPG Battles, or Just Plain Random Events

All of these things will involve some measure of scripting, depending on your needs. If you'd like to add a detailed RPG system to your story, that's completely feasible– but you (or a friend or two you recruit) will need to write the underpinnings of it yourself.

That's not to say this is impossible, though! Try here (which uses Harlowe), here (Snowman), or here (SugarCube) for examples you could adapt for your own needs.

If you just would like to add a little randomness to your story, that's pretty simple. Here's an example of how you could write a passage that, every time it's visited, simulates a coin flip.


The referee reveals that the coin is (either:"heads","tails").


The referee reveals that the coin is
<%= (Math.random() > 0.5) ? 'heads' : 'tails' %>.


The referee reveals that the coin is <<print either("heads","tails")>>.

External Resources

  • Dan Cox is publishing a video series that shows how to build a dungeon crawler with Twine.
twine2/add_stats_rpg_battles_or_just_plain_random_events.1507595985.txt.gz · Last modified: 2017/10/09 20:39 by