Howdy, Stranger!

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

For use in Twine 1, Is there an equivalent of the (click:) macro that is in Twine 2?

Looking for a macro similar to the (click:) macro from Twine 2, to use in the first Twine engine (with the Sugarcube story format). I want to have it so the player clicks a link to reveal more text, all on the same passage. I've tried the <<replace>> macro, but it is not working well for me, and I keep getting errors for it. Is there a better solution?

Comments

  • SugarCube's <<replace>> macro's documentation shows how to use a span element with an ID as the target of the replace. You can combine that with a <<click>> macro to achieve what you want.
    <<click "click here">>
    	<<replace "#output">>This text will be shown where the output span was/is.<</replace>>
    <</click>>
    
    <span id="output"></span>
    

    note: It is not the version of the Twine application that defines what macros are available or their syntax, it is the Story Format you select that does that.
    The (click:) macro you mentioned is part of the Harlowe story format, which is only available in Twine 2, some of the other story formats support both versions of Twine.
  • @greyelf Thank you so much! This works perfectly! :)
  • And what about <<button>>?
  • As noted in its documentation, the <<button>> and <<click>> macros are functionally equivalent. The sole difference between them is the HTML element used—<<button>> creates a <button>, while <<click>> creates an <a>.
Sign In or Register to comment.