Hi,
I'm using Twine as part of a project I'm working on for university but I'm fairly new to Twine 2.0 so I don't know if this is possible in Harlowe or not.
In one of my passages I've got a sentence with the 'click-append' macro linked to one of the words to provide some extra information. Is there a way for Twine to remember that the extra information has been displayed and I can use it as a variable later? i.e if click-append macro is activated $somevariable is set to 'true' and then in a later passage I can call $somevariable to do something.
Any help greatly appreciated. Thanks
Comments
1. Initialise the Boolean variable.
Ideally this should be done in your story's startup tagged passage, but any time before the (click:) macro link is clicked is OK.
2. Create the (click:) macro link that appends the information text and updates the Boolean variable.
note: I'm using the hook version of the (click:) macro because the String version searchers the content of the passage looking for every occurrence of the String.
3. Do something based on the current value of the Boolean variable.
Generally this needs to be done in proceeding passages because by default (if:) macros are only processed at the time the passage is displayed.
You can have multiple named hooks within a passage, and you can use the same name for multiple named hooks which will result in all of the same named hooks being effected by the related hook based macros.
What you cant do is have more that one (click:) (type) macro target the same named hook, if you do then the later defined macro targeting the named hook will over ride the earlier one.