I have the following in a passage called Sandbox:
<<print "$case1_done = " + $case1_done>> [[Toggle|Sandbox][<<if $case1_done is true>><<set $case1_done = false>><<else>><<set $case1_done = true>><<endif>>]]
The idea is a simple true/false debug/toggle for key milestones in the story.
It doesn't work. It always stays false which is the initial value. What am i doing wrong? Or is there a better way to toggle?
Comments
Pulling the condition out of the link works:
<<print $case1_done>>
<<if $case1_done is "true">>
[[Toggle|Sandbox][$case1_done = "false"]]<<else>>
[[Toggle|Sandbox][$case1_done = "true"]]<<endif>>
(I changed the original "print" line to make it work also)
Create a passage called togglecheck or whatever, and set it's tag to nobr. Put the code for the toggle check in that, and then when you need it simply use
<<display "togglecheck">>
.Have a look at the attachment.
As long as
$case1_done
is an actual boolean (true
orfalse
), then this should work: If you're using a string, for some odd reason, then this should work: