Twine Version: 2.5.1
Story Format: Harlowe 3.3.3
I want to display two or more options for a user to select between, using (click:) or (link:) macros. After the user clicks one of these options, I’d like for the other one to no longer be clickable. In other words, the user should pick one choice, but not both. I want this to happen within the same page.
This is a basic example of what I am working with. A simple two-option choice that modifies a variable. The user should only get to pick one.
Which do you like more? Cats or Dogs? [(click: "Cats") [(set: $cat to it + 1)]] [(click: "Dogs") [(set: $dog to it + 1)]] (set: $cat to 0) (set: $dog to 0)
I know this can be accomplished by changing the targeted text inside the (click:) macro, such as the example below, but if possible I would like the text to stay the same and just not be clickable anymore.
<!--Possible, but not what I want.--> Which do you like more? Cats or Dogs? [(click: "Cats") [(set: $cat to it + 1)(replace: "Dogs")[Woof]]] [(click: "Dogs") [(set: $dog to it + 1)(replace: "Cats")[Meow]]] (set: $cat to 0) (set: $dog to 0) <!--Another variation, but causes issues when using style changers.--> Which do you like more? |bird>[Eagles or Owls?] [(click: "Eagles") [(set: $eagle to it + 1)(replace: ?bird)[Eagles.]]] [(click: "Owls") [(set: $owl to it + 1)(replace: ?bird)[Owls.]]] (set: $eagle to 0) (set: $owl to 0)
This issue was brought up in a post called “Disabling (click:) links, without reloading page, without replacing original text (Harlowe)” on the old Twinery forum back in 2017, but never solved. This site won’t let me post links, but if you can find it, maybe their code can help with discovering a potential solution.
Any ideas are appreciated! I don’t know if this is even possible, but there are several instances where I’d like to perform this kind of “one or the other” type choice for the user in my games. It would be a huge help to me if we could find a solution. Thank you!