New trick on clearing variables I just fell over

Say you have a variable that you set to control paths available for the game, but you want to clear it once you use it (I have this exact situation). Rather than having to remember to clear it in some later section, you can do it on the selection itself, like this...

[[start]]:

@set x=1

[[next]]

[[next]]:

time for a choice

{if x=1: [[first choice]]{@x=0}}
{else: [[second choice]]}

[[first choice]]:

x={x}

[[second choice]]:

x={x}

If X=1, only first choice is available. But once you select first choice because it toggled the choice, the actual selection clears that value.

Figured this out while in the shower and had to dry off before trying it out... :)


Log in to post a reply.

Support

Forums