Need help separating items in an array with a comma

Im using Harlowe 3.2.2, and I’m attempting to build an inventory for my rpg game. I want to use the lastest version of harlowe, rather than the previous one. I attempted to use this code -

Your inventory contains a (print: $inv.join(", ")).

In order to display the items in my inventory, separated with a comma after each time. In the previous version, this would have been done with “.join”. However, the system doesn’t recognize this command in the newest version. Does anyone know how to do what i’ve been working on? And as an extra bonus, how would I add, “and” before the final item?

Essentially, this is the final product I’m seeking

“Your inventory contains a sword, phone, book, and key.”

Harlowe has never officially supported calling JavaScript data-type related methods, like the $inv.join(", ") in your example.

You can use the new (joined:) macro to achieve the outcome you want.

1 Like