User Tools

Site Tools


twine1:endif

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

twine1:endif [2017/10/09 20:39] (current)
Line 1: Line 1:
 +====== <<​endif>>​ ======
 +
 +<<​endif>>​ closes the usage of the <<​[[twine1:​if]]>>​ macro.
 +
 +====Usage====
 +
 +The <<​if>>​ macro can be used in formats like these:
 +
 +>​%%<<​%%if //​expression//​%%>>​%% //Text// %%<<​%%endif%%>>​%%
 +
 +>​%%<<​%%if //​expression//​%%>>​%% //Text// %%<<​%%else%%>>​%% //Text// %%<<​%%endif%%>>​%%
 +
 +>​%%<<​%%if //​expression//​%%>>​%% //Text// %%<<​%%else if //​expression//​%%>>​%% //Text// ... %%<<​%%endif%%>>​%%
 +
 +//​expression//​ is an [[expression]] that can evaluate to true or false. //Text// is any amount of passage text that you wish to display only if the condition is //true//. <<​endif>>​ is a macro tag indicating the end of the <<​if>>​ macro invocation.
 +
 +Note that the //Text// can contain any Twine code, including an inner <<​if>>​ invocation:
 +
 +<<if $body is "​wounded">>​You are <<if $blood <= 5>>​about to die<<​else>>​bleeding<<​endif>>​. Seek help <<​endif>>​
  
twine1/endif.txt ยท Last modified: 2017/10/09 20:39 (external edit)