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

Does Story.lookup() accept wildcard characters in JavaScript?

$
0
0
I'm using Sugarcube 2.8 and Twine 2!

I'm making myself a macro which indexes all the passages in my story and says whether they are tagged or not. Since my titles all have a space in them except for the Special Name'd ones, I figured searching for all titles with one would be the easiest solution. I'm currently trying to use the JavaScript "*" asterisk wildcard character like so:
new Wikifier(place, Story.lookup("title", "* *" )[0].title);

Which, to my understanding, should bring back any passage title with a space in it. Instead, it throws me this error:
TypeError: Cannot read property 'title' of undefined

I am aware that Story.lookup brings me an array of objects and that it comes out as undefined if nothing matches. However, there should be PLENTY of matches looking over my story map over 30 passages strong. Is there any way to get the method to cooperate and accept wildcards? If not, is there any better way to do what I'm doing?

Viewing all articles
Browse latest Browse all 1844

Trending Articles