Howdy, Stranger!

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

s2tephens' cyclinglink Harlowe problem

Hello there!

I searched for a solution for this but couldn't find any.

I'm new to Twine or any kind of game design for that matter. I'm trying to use this cyclinglink macro in Twine 2 following the instructions provided by s2tephen

(set: $cyclinglink to (array: "off", "low", "high"))
(set: $cl_index to 0)

The power is currently set to [(print: $cyclinglink[$cl_index])]<cl|.

[]<cl_macro|
(replace: ?cl_macro)[(display: "cyclinglink")]



But I just keep getting this message when I try to run it:

I can't display the passage 'cyclinglink' because it doesn't exist.

On top of that the link stays unclickable in the "off" postition.

I don't know what's wrong, I put the code above mentioned in a passage and then I put this on in another passage called cl_macro as advised:

{
(click: ?cl)
[
(if: $cl_index is $cyclinglink.length - 1)[(set: $cl_index = 0)]
(else:)[(set: $cl_index += 1)]
(replace: ?cl)[(print: $cyclinglink[$cl_index])]
(replace: ?cl_macro)[(display: "cyclinglink")]
]
}


I'm kind of lost and desperate, do any of know what's wrong??

Thanks for your time...


link to s2tephens' cyclinglink https://gist.github.com/s2tephen/459de15106f66ce67e53

Comments

  • There are a number of things in s2tephens' cyclinglink code example that are syntactically incorrect, and the header of the "in a separate passage" example implies that the second Passage should be called cl_macro when it is really called cyclinglink:

    Try the following, it is based on s2tephens example.
    The first part goes in a Passage named cyclinglink:
    {
    (click: ?cl_link)[
    	(if: $cl_index is $cl_list's length)[(set: $cl_index to 1)]
    	(else:)[(set: $cl_index += 1)]
        (replace: ?cl_link)[(print: $cl_list's $cl_index)]
        (replace: ?cl_macro)[(display: "cyclinglink")]
    ]
    }
    
    ... and the second part goes in whichever Passage you want the text and link to appear in:
    (set: $cl_list to (array: "off", "low", "high"))
    (set: $cl_index to 1)
    
    The power is currently set to [(print: $cl_list's $cl_index)]<cl_link|
    
    [(display: "cyclinglink")]<cl_macro|
    

    note: I renamed one of the variables and the first hook in s2tephens example.
  • Hey thanks, it works! I was also able to contact him some days before I saw your reply and he acknowledged the mistake.

    Thanks!
Sign In or Register to comment.