Howdy, Stranger!

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

(Harlowe) Cycling Links which lead to different passages?

Newbie coder here. Using Twine 2 and Harlowe. I've successfully made a cycling link, and I'm now trying to get the subsequent internal link to lead to a different passage depending on which item in the cycling link is chosen. I tried to follow the instructions given in this thread:
https://twinery.org/forum/discussion/4937/cycling-link
However, I seem to be running into problem after problem as I try to tweak it. I'm sure there's at least one glaringly obvious error in here, but it's beyond me!

I'm just going to post the entire passage in case the problems stem from something I've done with the cycling link too.
you stand still. so very still. it is possible you are no longer able to move, in this space. and there is something different about you. at least, you're pretty sure you never used to have (set: $myVar to "vibrating membranes at the sides of your neck")<tw-link class='cyclingLink' data-cycling-texts='["vibrating membranes at the sides of your neck", "skin as soft and white as maggots, and just as cold", "curled teeth of such size that they cannot be contained by your lips", "a second pair of arms, these ones of immaterial golden haze", "black blood that prickles like thorns beneath your transparent skin", "pleochroic wings, which shiver with strange energy"]' onclick='clickCyclingLink(this, "$myVar");'>$myVar</tw-link>.

<center>

(link: "what else has changed?")[{|
(if: $"what else has changed?" is "vibrating membranes at the sides of your neck")[(goto: "membrane-hall")]
(elseif: $"what else has changed?" is "skin as soft and white as maggots, and just as cold")[(goto: "maggot-hall")]
(elseif: $"what else has changed?" is "curled teeth of such size that they cannot be contained by your lips")[(goto: "teeth-hall")]
(elseif: $"what else has changed?" is "a second pair of arms, these ones of immaterial golden haze")[(goto: "arm-hall")]
(elseif: $"what else has changed?" is "black blood that prickles like thorns beneath your transparent skin")[(goto: "blood-hall")]
(else:) $"what else has changed?" is "pleochroic wings, which shiver with strange energy")[(goto: "wing-hall")}]

</center>
As per the instructions (or at least my understanding of them) in the aforementioned link, I copied and pasted the second chunk of that code (from "[{|(if: $"what else has changed?"" onward) into all the possible linked passages. Was I wrong to do that? There arent any arrows connecting these passage boxes to the one with the cycling link in my editing view...

In any event, there are multiple problems that are resulting from this. One is that no matter what the cycling link is on, the internal link always leads to the passage "wing-hall", which is only supposed to be associated with the last item in the list. Also, I've gotten multiple error messages, which always look something to this effect:

tumblr_o7p467KxoN1sr3o60o1_1280.png

I just started learning how to do some basic coding yesterday. It hasn't even been twenty-four hours yet, so I'm a tad out of my depth with...well, everything, at this point. I appreciate your answers!!

Comments

  • There are a number of errors in your (link:) macro:

    a. You have replaced the left side variable reference in each of your (if:)/(else-if:) macros with an invalid $"what else has changed?" value, they all need to be changed to be $myVar instead.

    b. Your (else:) macro has an invalid $"what else has changed?" is "pleochroic wings, which shiver with strange energy") value between the macro and the start of it's associated hook [ ... ]

    c. Your (else:) macro's associated hook is missing it's end square bracket ]

    d. You have a useless pipe character | directly after the collapse markup's open curly brace {

    notes:
    . Sometimes using indentation can help you see coding errors, you can safely remove it from the following example.
    . Generally it is better to not embed code directly into your text if you don't need to, so I moved your (set:) macro to the start of the passage.
    {(set: $myVar to "vibrating membranes at the sides of your neck")
    
    }you stand still. so very still. it is possible you are no longer able to move, in this space. and there is something different about you. at least, you're pretty sure you never used to have  <tw-link class='cyclingLink' data-cycling-texts='["vibrating membranes at the sides of your neck", "skin as soft and white as maggots, and just as cold", "curled teeth of such size that they cannot be contained by your lips", "a second pair of arms, these ones of immaterial golden haze", "black blood that prickles like thorns beneath your transparent skin", "pleochroic wings, which shiver with strange energy"]' onclick='clickCyclingLink(this, "$myVar");'>$myVar</tw-link>.
    
    <center>
    (link: "what else has changed?")[{
    	(if: $myVar is "vibrating membranes at the sides of your neck")[
    		(goto: "membrane-hall")
    	]
    	(elseif: $myVar is "skin as soft and white as maggots, and just as cold")[
    		(goto: "maggot-hall")
    	]
    	(elseif: $myVar is "curled teeth of such size that they cannot be contained by your lips")[
    		(goto: "teeth-hall")
    	]
    	(elseif: $myVar is "a second pair of arms, these ones of immaterial golden haze")[
    		(goto: "arm-hall")
    	]
    	(elseif: $myVar is "black blood that prickles like thorns beneath your transparent skin")[
    		(goto: "blood-hall")
    	]
    	(else:)[
    		(goto: "wing-hall")
    	]
    }]
    </center>
    
  • Thank you so much!! It works now. You're incredibly patient, I really appreciate your help!
Sign In or Register to comment.