Need Help w Setting Variables for Harlowe

Twine Version: Twine 2
Story Format: Harlowe
I need somewhat of an asap reply because I’m doing a story for grades ;3;

I currently have 2 problems:

  1. I have various cyclinglinks for some dialogue/thoughts, and depending which one you choose, you will accumulate $Madness which would affect the endings and responses.

This is kind of what I have currently, but there seems to be some bugs:
(cyclinglink: bind $Madness, “You don’t want to end up alone.”,“It’s not safe out there.”,“You don’t want her to get hurt.”)

[set:$Madness to 0]
(if: “You don’t want to end up alone”)(set:$Madness to 1)
(else:)(set: $Madness to 0)

  1. Because we have a limited number of nodes for the assignment, I have two options that go to the same node. However, the node will start differently depending on which option is chosen. I couldn’t find a term for all of this, so I tried coding based on what I know. It doesn’t work. ;3;

I also kind of have one of the choices that reoccur throughout the story, and if you use it once, the option is cancelled out. I will have to code that as well.

This is what I’ve tried so far:
Passage -
You could possibly go out there and [[search->Meeting Astralia]] for them, but you don’t know what lies out there. You could also [[call->Meeting Astralia]] for them by sending out a cosmic signal, but considering that you don’t know where they are, it would take a lot of your cosmic energy.

[set: $search to 0]
(if: link:“search”)(set: $search to 1)
[set: $call to 1]
(if: link:“call”)(set: $call to $call-1)

Next node -
(if: $search is 0)[You hesitantly start your search, leaving the side of the blue star, the landmark of your home. You venture slightly away, [softly]<a5| calling out the name of your twin.(mouseover:?a5)[You don’t want any touble. You just want to find your twin.]]

(else: $call is 0)[You gather the cosmic energy into the gem. Concentrating hard, you form a signal [‘?vv< +=\z’]<a6|(mouseover:?a6)[(replace:?a6)[Come back]]. Within seconds, a shockwave emerges from your gem like a wave, crashing away from you towards the abyss. Now all you have to do is wait, in the safe confines of your home. The blue star which serves as your home’s landmark shines comfortingly.]

Help would be greatly appreciated! It’s a bit hard to ask my friends as some are dying from assignments in generally and others are not very familiar with coding.

Oh, and if anyone knows how to click in text (so when you click the text fades in), that’ll be great!

Please use the Preformatted Text option in the toolbar when including code examples in your posts.

The (cyclinglink:) macro stores the current shown textual option within the binded variable. So in the case of your example…

(cyclinglink: bind $Madness, "You don't want to end up alone.", "It's not safe out there.","You don't want her to get hurt.")

…when the link shows “It’s not safe out there.” the $Madness variable will contain the same String value.

The conditional expression of the (if:) family of macros within a Passage only gets evaluated once, and that is during the Passage Transition process. Conditional expressions that reference variables are not automatically re-evaluated if the value of that variable changes after the Passage has been initially processed. So any conditions that reference the $Madness bind variable later within the same Passage as your (cyclinglink:) will only be true if they test for the initial “You don’t want to end up alone.” String value.

The (if:) family of macros need to be associated with Hook that contains the code to execute if the related conditional expression evaluates to true.
eg. The following checks if the $Madness variable equals “You don’t want to end up alone.”, and assigns a value to a variable if it is.

(if: $Madness is "You don't want to end up alone.")[
	(set: $variable to "a value")
]

When you say ‘node’ I will assume you actually meant Passage.

You can use a variable to control what Passage content is shown, like so.

(if: $variable is "this")[...Show the first set of content...]
(else-if: $variable is "that")[...Show the second set of content...]

You can use what is commonly known as a Link with Setter (or a Setter Link) to assign a value to that variable depending on what link is selected to visit a Passage.

(link-reveal-goto: "Option 1", "Result")[(set: $variable to "this")]
(link-reveal-goto: "Option 2", "Result")[(set: $variable to "that")]