Hi everyone,
(I'm using Twine 2 and Harlowe)
I am trying to work out a way to display a hook, and I am not able to solve the riddle.
I would like a previously named hook to be displayed upon clicking a different hook.
Here is a simple example:
[this is the first hook]<firstHook|
(click-replace: ?firstHook)[[this is the second hook]<secondHook|]
Up to that point, fairly straight forward. Now I want to display the first hook upon clicking the second hook, and for the first hook to be clickable again, but I am not able to do it.
I have tried the following:
This displays the first hook but not as a clickable hook:
(click-replace: ?secondHook)[[this is the first hook]<firstHook|]
The following examples all produce a blank result:
(click-replace: ?secondHook)[(print:"?firstHook")]
(click-replace: ?secondHook)[(print:?firstHook)]
(click-replace: ?secondHook)[?firstHook]
Some questions come to mind:
1. Am I trying to do something that hooks are not intended to do?
2. Is the only option to have a repeating link (as in click on firstHook displays secondHook and viceversa), through using two separate passages?
The reason I ask is that this is a very simple example involving only two hooks, whereas I am envisioning several hooks interacting with each other and cycling in certain circumstances.
Any help is greatly appreciated.
Comments
If that doesn't work, I'll give you DOUBLE your money back.
Perhaps I am not doing it right, but I tried setting it up as a variable. This is what I did:
It only works the first time I click on the first hook. But when I click on ?secondHook, it only displays the TEXT of ?firstHook, not the link.
(I've attached the html so you can see its behaviour)
In your case this is more complex because you have more than one hook/sensor combo. Maybe something like the following for your secondHook sensor.
Thanks for the code, as that does make the first hook appear again, though I would have to set the [something else!] again to the second hook, and repeat the process as many times as I would want the player to click it, whereas I was looking for an infinite option.
Since the (click:), etc. are single use only, I'll have to work around that, possibly connecting two passages together through (display:) or something, similar to the example in the HTML I'm attaching to this post, where I use the (mouseover:) macro.