I’ve read the Twine Cookbook and the Harlowe 3.3.8 Manual and based on what I’ve read, the following code should work:
(set: $items to + (a: 'jacket', 'waterbottle', 'flashlight', 'med kit'))
(set: $parray to + (a: 'dimensional storage'))
But when I run it, I get the error:
I can only multiply numbers, not an array (with the string “jacket”, the string “waterbottle”, and 2 other items).
I can only multiply numbers, not an array (with the string “dimensional storage”).
What am I missing? Any suggestions?
Much appreciated!
It sounds like you’re initializing $items as a number wherever you first set it (which is not in the code you’ve posted here). Try setting it to a blank array initially.
If that’s an accurate copy of what’s in your project, then the issue is that you’re intializing the variable as $item (without an s) and then calling the nonexistent variable $items (with an s) when you want to add stuff to it.