How to replace passage link with a substitute link after a sequence of events

If you are requesting technical assistance with Twine, please specify:
Twine Version: 2
Story Format: Sugarcube 2.34.1


I am learning the basics of Twine, I feel that I’m making some improvements. I ran into a problem that I haven’t been able to find a solution for.

I want to be able to replace a link with another link without clicking on it. How do I remove the link and replace it with a completely different one?

What is the trigger for changing the link? And do you want to change the link text, the passage it goes to, or both? Do you want any visible indicator of this change? Such as fading from one to the other?

More information is necessary to answer this question, but I’ll say it’s quite possible. Take a look at the <<replace>> macro, and if you still have questions, just provide the information requested above so we have a better idea what you’re looking to accomplish.

Hope that helps! :slight_smile:

Further to HiEi’s advice regarding the <<replace>> macro, and their request for further information…

A link replacing example would look something like the following, except I’m using a <<button>> macro to simulate your ‘event’ handling system, so I can delay the execution of the <<replace>> macro call. I’m also using Custom Styling markup to define the #link identified area the original link is being shown in.

@@#link;[[Option 1|Target Passage 1]]@@

<<button "Event occurs">>
	<<replace "#link">>[[Option 2|Target Passage 2]]<</replace>>