Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

[Sugarcube 2.16.0] Pluck a tagged passage from an array

$
0
0
I have several passages with several tags like this:
:: Event1 [event suburbs]

My sidebar uses tags().includes("event") check to show some special info, and that works fine.
However when I try to get all the passages with "suburbs" tag, I don't get any. The code I'm using:
<<set $suburbs to Story.lookup("tags", "suburbs")>>

To get that particular passage into the array I need to change it to:
<<set $suburbs to Story.lookup("tags", "event,suburbs")>>

But the set of tags might be different per passage, so I need a way to get all the passages, one of which tags is "suburbs". Is there a way to do this?

After I get the list of these passages I need to create a link, which would pluck one passage and <<goto>> it. But I get an error with different variations of this code:
<<link "To the Suburbs">>
    <<set _e to $suburbs.pluck()>>
    <<goto _e>>
<</link>>

Could you help me, please?

P.S. using sugarcube 2.16 with entwine, if that matters.

Viewing all articles
Browse latest Browse all 1844

Trending Articles