"Deleting Variables": SugarCube (v2.18)

Summary

In SugarCube, <<unset>> works as a "reverse" to <<set>>. Instead of setting a value, it deletes it. <<unset>> works on both temporary and story variables.

Live Example

Download: Live Example

Twee Code

:: StoryTitle
SugarCube: Unsetting Variables

:: Start
<<set $proof to "hand-written letter">>

[[Accidentally drop the letter]]

:: Accidentally drop the letter
<<unset $proof>>

[[Present the letter to the sheriff]]

:: Present the letter to the sheriff
You present the $proof to the sheriff, not realizing the rain has washed away the ink from the hand-written letter.

Download: Twee Code

See Also

Conditional Statements, Setting and Showing

results matching ""

    No results matching ""