Skip to content

"Deleting Variables": SugarCube (v2.18)#


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.



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.

Twee Download

See Also#

Conditional Statements, Setting and Showing