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

(Harlowe) After changing a datamap's value, I can no longer remove it from an array

$
0
0
Here's an example of what's going on:
(set: $inventory to (a: ))
(set: $item_sword to (datamap: "name", "sword"))

(set: $inventory to it + (a: $item_sword))
(set: $item_sword's name to "broadsword")
(set: $inventory to it - (a: $item_sword))

(if: $inventory contains $item_sword)[sword in inventory]
(else:)[sword not in inventory]

As you can see I've added the sword to the inventory array, changed its name, and then tried to remove it from the inventory. But the final if-statement always tells me that the sword is still in the inventory.

The same thing does not happen when adding an item to the inventory, if I change the item's name and then add it to inventory that works fine. The issue happens specifically when you add the item to the array, then change its name, then try to remove it.

Anyone have any idea what's going on??

Viewing all articles
Browse latest Browse all 1844

Trending Articles