Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Links that change when clicked

I'm using Twine 2, SugarCube 2.

I want to make a set of links that change when clicked. For instance, one link to change between "small" and "big" and another between "cat" and "dog", so that the player can toggle whether they want a small dog / big dog / small cat / big cat.

And then once the player has toggled the links to their desired appearance, and clicks on another link that would take them to a different passage, that new passage would reflect their choice in the previous one (for instance if they settled on "small" and "dog", it would say "The small dog is happy that you bought it.")

How can I do that?

Thank you!

Comments

  • While a native solution is possible, it's probably more involved than you'd want.

    The easiest solution would probably be to use the <<cyclinglink>> macro. You can find it at SugarCube v2 website > Downloads > Add-ons—it can be found elsewhere, however, only that version is guaranteed compatible with SugarCube v2. Make sure you read the included README.

    Usage example:
    Picking a pet is hard, however, you eventually chose the <<cyclinglink "$petSize" "small" "big">> <<cyclinglink "$pet" "dog" "cat">>.
    
    And in a subsequent passage:
    You play with your $petSize $pet.
    
Sign In or Register to comment.