Hi everybody. How can I put a macro, or anything useful, inside a link? I mean, a basic link is [[Text|Passage]]. But I also want a macro executed when that link is clicked. For example, a variable set. How do I do that?
This story format supports setter-links as can be seen in it's links documentation, it also has a <<click>> macro which can be used to do other things besides assigning values to variables:
<<click "click here if you choose blue">> <<set $colour = "blue">> <<cacheaudio "bgm_space" "space_quest.mp3">> <<audio "bgm_space" play>> <<goto "Next Passage">> <</click>>
Right. I'm using the default format, Sugarcane. Now I see what I've been doing wrong with these links - I don't need to put "set" inside that extra pair of brackets. Thanks.
Comments
a. built-in story formats: (Sugarcane, Jonah, Responsive)
The link documentation includes a setter-links which is a link that assigns a value to one or more variables when the link is clicked:
b. SugarCube
This story format supports setter-links as can be seen in it's links documentation, it also has a <<click>> macro which can be used to do other things besides assigning values to variables: