Howdy, Stranger!

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

Code that runs during every passage

Hello! I am new to Twine, so this is probably a bit of a stupid question. I am keeping track of time in my game using a variable that goes from 0 to 239. The ones place keeps track of each tenth of an hour while the tens and hundreds place keeps track of hours. I want to have a script that sets time to 0 every time it's greater than 239. I don't want to have to use an if statement for this in every single passage, so I'd like some script that runs every time you move onto a new passage. If there's a better way for me to keep track of time please let me know!

Thanks!

Comments

  • You need to state which story format you are using as answers can be different for each one.

    You can use the built in prerender and postrender events to do what you want.

    Information for the built-in story formats can be found here, and SugarCube's documentation is here. SugarCube also has special PassageDone & PassageReady passages which can also be used.
Sign In or Register to comment.