JoshuaGrams / tiny-qbn

A storylets library for Twine2/Sugarcube.
https://joshuagrams.github.io/tiny-qbn/
Other
47 stars 2 forks source link

TinyQBN "tags" in comments #4

Closed destrugter closed 3 years ago

destrugter commented 3 years ago

I'm trying to use the new TinyQBN "tags" in comments and I'm running into an issue when it comes to printing the card's requirements out. I followed your youtube tutorial and I have the following code. I will be willing to admit, I may be doing this wrong.

ExchangeNumbers.twee

:: ExchangeNumbers
/*QBN
    sticky-card
    req: $location eq "Home"
    also: $jobs.ConvenienceStore.Counter eq 1
    also: $partners["Relationship"] gte 75
*/

<<if _qbn_cover>>
<<linkcontents "Exchange Numbers">> (requires <<requirements>>)
<<else>>
Placeholder text, please replace
<<return>>
<</if>>

Home.twee

:: Home
<<set $jobs.ConvenienceStore.Counter to 1>>
<<set $location to "Home">>
<<set _qbn_cover to true>><<includecard "ExchangeNumbers">><<unset _qbn_cover>>

The result winds up looking like this: image

I'm not sure if this is helpful at all, but this is what the console says:

index.html:569 Error: cannot execute macro <<requirements>>: n.description is not a function
    <<requirements>>
a @ index.html:569
handler @ index.html:572
value @ index.html:572
t @ index.html:572
handler @ index.html:573
handler @ index.html:572
value @ index.html:572
t @ index.html:572
(anonymous) @ index.html:570
wikiWithOptions @ index.html:570
wiki @ index.html:570
handler @ VM8460:2
handler @ index.html:572
value @ index.html:572
t @ index.html:572
value @ index.html:575
p @ index.html:575
(anonymous) @ index.html:574
(anonymous) @ index.html:573
(anonymous) @ index.html:570
(anonymous) @ index.html:570
dispatch @ index.html:59
v.handle @ index.html:59
JoshuaGrams commented 3 years ago

Gah. No, that's my fault. I didn't bother trying to describe the twinescript requirements because you can put arbitrary code in there. But I can at least print the code so you can see something and it won't crash: that's just a line or two of code. I pushed a fix to the story javascript.

Sorry I didn't get to that right away, given how easy it was. It's spring on the farm and we've had a crazy couple of days...

I'm going to close this but please do re-open it if that doesn't fix it for you.