In Twine 2.0.9, using Harlowe, I am having difficulty toggling a variable back and forth between two values by using the "else" clause. I have also tried "elseif", and I have tried toggling between 0 and 1, "on" and "off", and true and false.
The "else" (or "elseif") clause never seems to trigger. The following script will switch the variable from 0 to 1, but it will then remain at 1. I must be missing something really simple, but I've been stuck on this for hours. The intention was to be able to toggle a light switch between on and off (repeatedly) from within one passage.
Value is set to $test
(if: $test is 0)[(set: $test to 1)]
(else:)[(set: $test to 0)]
Value is set to $test
[[retry]]
Comments
I suggest in the short term that you return to using Twine 2.0.8 until this issue is resolved by Leon.
I actually updated from 2.0.8 to 2.0.9 just a few hours ago, after learning that an update had been released to fix the bug (which I was experiencing a lot) where dragging multiple passages resulted in them jumping to the wrong positions.
I'll just have to make do with one bug or the other in the meantime, though it seems that going back to 2.0.8 as you suggest would be the easiest choice.
Thanks again!
How you actually obtain a copy of the 1.1 format.js file is a totally different problem and I am not sure the best (read easiest) way to do so. You could:
1. Find the relevant commit on the Twine 2 project site and cut-n-paste the contents into your own local file.
2. You could build your own format.js file based on the 1.1 source code on Harlowe project site.
3. Try to extract the relevant format.js file from the Twine 2.0.8 node-js files.
4. Some other option I have not thought about.
The first three of the above options require different degrees of knowledge about programming.