To prevent any confusion and provide a consistent interface, it’s strongly recommended that links should only be used for passage navigation.
In this case I’d recommend using the <<radiobutton>>
macro instead. For example:
''Choose your character:''
<label><<radiobutton "$char" "char 1" checked>>Character 1</label>
<label><<radiobutton "$char" "char 2">>Character 2</label>
''Choose the scenario:''
<label><<radiobutton "$scene" "scene 1" checked>>Scenario 1</label>
<label><<radiobutton "$scene" "scene 2">>Character 2</label>
That will give people a clickable “radio button” option (which only allows one of each radio button group to be selected) which will set the value of the variable name that’s in quotes in the first parameter to the value in the second parameter if that radio button is checked. The “checked” parameter in the first option of each radio button group gives it a default option, in order to make sure that at least one option is picked.
Wrapping the macro in a <label>
element like that makes sure that the label is clickable as well, though you might want to add the following code to your Stylesheet section to make that fact more obvious by changing the cursor appropriately when it hovers over the label’s text:
label {
cursor: pointer;
}
After that you could use the <<link>>
macro to send you to the appropriate passage based on those variables. For example, if the passage name was simply “scenario name - character name” you could do this:
<<link "Begin">>
<<goto `$scene + " - " + $char`>>
<</link>>
The “backquotes” (the accent mark found on the ~
key on the upper-left of most keyboards) around the parameter within the <<goto>>
macro causes that code to be evaluated and passed as a single parameter value.
Thus if, for example, the radio buttons were set to the first option in both cases, then if the user clicked the “Begin” link, that code would try to send them to the “scene 1 - char 1” passage.
There are lots of other ways to do that, but that’s one of the simplest in most cases.
Enjoy!