0 votes
by (160 points)

So, I'm about to pull my hair out fixing this.  I haven't been able to find anything that fixes this problem, though it may just be me being dense.

I'm trying to set up an example story like I had before my PC had to be wiped.  I had a macro example i could reference, but now I forgot how I st it up and need help.

The first passage is:

There's a potato.

[[Slice it->Potato Consequence]](set: $slice to 1)
[[Smash it->Potato Consequence]](set: $smash to 1) 

The second passage I want it pointing to is:

(if: $slice is 1)[Sliced.]
(if: $smashed is 1)[Smashed.]

I'm trying to get just Sliced to display if Slice it is selected, or just Smashed if Smash ti was clicked.

The problem is, they both link to Sliced.  I used to have this figured out, and I have no doubt it's something simple and obvious, but I can't find the guide that I figured it out form last time, so I need to ask for help.

I'm also a novice with programs like this, so a lot of the documentation just doesn't help me.

1 Answer

+1 vote
by (68.6k points)
selected by
Best answer

You cannot simply put macros after the link markup, that doesn't make them part of the link.  The reason you were seeing sliced each time was because both (set:) macros were being executed as part of the normal passage processing, since they weren't part of the links.

Try the following which uses the (link:) and (goto:) macros:

There's a potato.

(link: "Slice it")[(set: $slice to true)(goto: "Potato Consequence")]
(link: "Smash it")[(set: $smash to true)(goto: "Potato Consequence")]

Notice how the (set:) is within the hook of the (link:) macro, which makes it part of the link.

And then in the Potato Consequence passage:

(if: $slice)[Sliced.]
(elseif: $smashed)[Smashed.]

Beyond that.  You don't really need two variables there, since you're forcing a singular choice.  For example:

There's a potato.

(link: "Slice it")[(set: $potatoAction to "slice")(goto: "Potato Consequence")]
(link: "Smash it")[(set: $potatoAction to "smash")(goto: "Potato Consequence")]

And then in Potato Consequence:

(if: $potatoAction is "slice")[Sliced.]


by (160 points)
That's a massive help, thanks!

Gives me an example of a singular choice and multiple variations.
by (160 points)
So, I did everything as shown, and the links work, but every option goes lower on the page.  So Smashed is lower than Sliced in the linked passage.

Is there a way to fix it so the text for each link is shown at the top of the passage, regardless of how far down the code is?
by (2.2k points)

just use the text wrap symbols

This line\ 

and this line 

\and this line, are actually just one line.

Is the example given of the usage on the harlowe documentation help thingy majig

so use it like

code code code1 [and all the stuff in that code thing]\

code of the code thing 2 [and boom this stuff will be on the same line as the previous thingy]

It may be a little more difficult than that, especially if the text in code one is longer than a single line, I'd get around that by using a print macro (that you can find through that link as well) and put all of the text of code one into the print macro so it'll collapse when using it injunction with the line break to make it all on one line. like

code code)[(print:)[all the text from the first option]]\

code code2)[like normal, the extra bracket isn't needed on this one because there's no extra macro involved]

by (160 points)
That was incredibly simple, and I feel like a doofus.  Thanks for the help!
by (2.2k points)
I've been there, don't worry. lol, I've asked questions so dumb I already had the answer in my question.