Sugarcube Macros for Twine 2.0

«if» macro: This one has a lot of applications, I'll show you three.

  1. «if visited(“PassageTitle” is 2» The text here. «/if»

Twine auto-tracks how many times you have visited a page, so by using this macro, you can set a certain portion of text to only appear if you have visited a certain passage a certain number of times. For example, to set up a page to respond differently every time you visit it, you can write

«if visited(“Town1”) is 1» Initial description of town. «/if» «if visited(“Town1”) is 2»Secondary description. «/if»

  1. «if $liarliar is true» Text here. «/if»

This is a true/false test. Useful for checking if the player has done something. If you ever use one of these, you need to set it on your first passage with «set $liarliar to false». This way, if the player discovers info or talks to a person, you can change the status with «set $liarliar to BLANK» and check that status with «if $liarliar is true/false» Text. «/if».

If you want to check for BOTH true and false (have an outcome for both in a passage) you have to write it differently. «if $liarliar is true» Text. «/if» Then. «elseif $liarliar is false» Secondary text. «/if».

  1. «linkreplace “Text that is clickable”» Text that will replace it. «/linkreplace»

Pretty simple macro. What is in the quotations is clickable, what is between the carroted boxes is the text that replaces it. You can put these inside of each other, so multiple text replaces are hidden. That would look like this: