Hi all, I'm using Harlowe
I have a quiz on one passage. If a user selects the correct choice, they are brought to another passage where the variable $mom is set to true. (It hasn't been initiated anywhere, this is the first appearance of the variable)
Then, on returning to the quiz page, an if statement at the top checks for the value of $mom.
As you can see, the variable is set to true, but then is still displayed as "0" upon return.
Where's my oversight?
Thank you
Comments
If you are using the Undo button then that is the reason, because it winds back history which undoes changes to variables.
I suggest you use a startup tagged passage to initialize your variables, which would allow $mom to equal false at the start instead of zero.
If so, I should like to have a function to bring the user back to the previous passage without undoing the variable history. Any ideas?
The (history:) macro returns a list containing the names of all the passages previously visited by the Reader, the last entry is the previous passage. You can combine it with a (link:) and (goto:) macro like so:
EDIT 2: Ok, I think this is magic. I've removed the undo/redo buttons entirely using your modified code in a header passage. Thank you!
ORIGINAL:
I actually may have found the answer in one of your other posts. However it seems to be only changing the tooltips for undo/redo and not the actual button functions so I could try using a variant of this to maybe remove the charaters used to display the undo/redo buttons.
I couldn't find out what exactly header tagged passage is, so I've placed the following code in my "Story javascript" : And added the tag "Header" to a passage to see if the button tooltip is changed, it still reads undo and actually I get a story error so I'm overlooking something huge I'm sure.