ChapelR / custom-macros-for-sugarcube-2

A collection of systems and macros for Twine.
https://macros.twinelab.net/
The Unlicense
166 stars 44 forks source link

I'm using Simple Inventory for sugarcube 2.30.0 and need to count an inventory #30

Closed Jaydax1729 closed 4 years ago

Jaydax1729 commented 4 years ago

I need to count the number of items in an inventory and expected to do something like: <<set $valuables to $Safevaluables.count()>> <<print "You have " + $valuables + " valuables.">> <<set $score += $valuables >> This fails at the first line giving the error <>: bad evaluation. unexpected identifier Typing <<=$Safevaluables.count()>> will produce the required number but I've been unable to add that number to a different variable as in the third line. Any ideas?

ChapelR commented 4 years ago

Is that the exact code, copy and pasted directly, that's causing the error?

ChapelR commented 4 years ago

Closing due to lack of activity. Comment and I'll reopen if necessary. The code as you've posted it appears to work for me, so I can't reproduce your issue without additional information.