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.
Comments
That said. As noted by its documentation, the Story.lookup() static method yields an array of Passage objects, not passage titles, which is what you seem to want. You should probably be doing something like the following:
If that doesn't work, please post a copy of a project compiled with entwine, so I can look at what it's doing to tags.
Also tried to import the file into Twine2 but it got stuck on "working" screen. Not sure that should have loaded though.
I'm sorry for the mess in the project, I'm testing some stuff there
Tags are being stored within the passage data separated by commas, rather than the correct spaces. For example:
That seems to indicate that Entwine is broken. A brief check of its source code confirms that assessment—I think that all space separated values stored in arrays are broken, actually, not just tags.
Anyway. I'd say that you'd probably want to report that, but the project doesn't seem to have an issue tracker. I suppose you could send CK a PM here or an e-mail instead. *shrug*
Thank you for you help!
I've recently found your TweeGo project, why wouldn't you advise me to try it? Looks like it's doing everything I need out of the box. Are there any special differencies or lacking functionality I should know about? Other than the need to include ::StoryTitle passage, usage of js/css by tagged passages instead of files and the default targets/sugarcube-2 directory for the format files
Also is there an easy way to compile all the files in folder and subfolders not listing all the files by
The current TweeGo release only supports Twine 1 style story formats. The next release should support Twine 2 story formats as well.
Off the top of my head, not built in, no. Though, that's something I could add to the next release.
Depending on your shell/binutils, there are likely ways to accomplish that goal independent of TweeGo.