Hey all. I'm trying to allow players to choose a gender. Basically, what I've got is something to the effect of:
You're a dude.(click-replace: "dude")[(set: $gender to 'woman')lady]
What I'd like to do, and what I can't figure out how to do, is allow players to click on "lady," and thereby set the gender to 'man.' Any ideas?
Comments
This might not be the best way but you could do something like this:
-set up two passages one for MALE and one for FEMALE and make MALE the starting passage.
- in the MALE passage try this:
and in the FEMALE passage, this:
This allows you to keep cycling between the two options. Hope that helps
The following solution uses a child passage to handle the logic required to display the correct option to the Reader, to update the $gender variable and to (re-)attach the click event.
1. Add the following to the passage you want the choice to appear in: ... the Result markup link is only needed to check the value of the variable.
2. Create a Choose Gender passage and add the following to it, this is the child logic passage:
3. Add the following to the auto-created Result passage: