Howdy, Stranger!

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

Hi! I am new to twine, is there any cool tips or tricks you could give me?

Comments

  • Did you post this to every category?

    Well here's a trick I just discovered. It's possible to make cycling links with (link-repeat:)
    (set: $cycle_list to (array: "Good", "Nuetral", "Evil"))
    (set: $cycle_index to 1)
    Your alignment is (link-repeat: "[(print: $cycle_list's $cycle_index)]<cycle_link|")[(set: $cycle_index to it + 1)(if: $cycle_index > $cycle_list's length)[(set: $cycle_index to 1)](replace: ?cycle_link)[(print: $cycle_list's $cycle_index)]]
    

    No more need for a second passage.
  • Cool thanks!
  • Well here's a trick I just discovered. It's possible to make cycling links with (link-repeat:)
    (set: $cycle_list to (array: "Good", "Nuetral", "Evil"))
    (set: $cycle_index to 1)
    Your alignment is (link-repeat: "[(print: $cycle_list's $cycle_index)]<cycle_link|")[(set: $cycle_index to it + 1)(if: $cycle_index > $cycle_list's length)[(set: $cycle_index to 1)](replace: ?cycle_link)[(print: $cycle_list's $cycle_index)]]
    

    No more need for a second passage.
    Although that works, it is using an undocumented effect that being the ability to embed a Named Hook within the link's Text. That ability may be by design or by accident, and if by accident then it may stop working in a future update of Harlowe.
  • Well if it is removed, hopefully it'll be replaced by either a (click-repeat:) macro (which I've made a feature request for), or by the (cycling-link:) macro (which Leon mentions in a different issue). For now, not having to use a second passage for cycling links is worth the risk.
    https://bitbucket.org/_L_/harlowe/issues/24/add-a-click-repeat-macro
    https://bitbucket.org/_L_/harlowe/issues/6/add-link-keyword-denoting-the-link-that
  • I was trying to do the same thing, and found another way that doesn't use hook hacks. I wrote up a quick post about it here: http://unmercifulfish.ucc.asn.au/2016//01/22/cycling-links-twine/index.html
  • A possible issue with your solution is the that a text replace will affect the whole passage So if the text of one of the links appears in the passage then that will be replaced as well.

    For instance if your example had contained the text "Frederick leads you to the pedestal." then after a couple of clicks that would become "Harry Pottererick leads you to the pedestal". Also since the index gets increased for each replacement, the link would jump straight to Ozymandius.

    Though, as long as you know that the text from the links don't appear in the passage then your method is safer, so I'd like to include it in my Harlowe cookbook.
Sign In or Register to comment.