irmen / Tale

Interactive fiction (text adventure) and Mud framework
http://tale.readthedocs.io/
GNU Lesser General Public License v3.0
145 stars 35 forks source link

Incorrect behavior when picking up identical objects #34

Closed itsbirdseed closed 5 years ago

itsbirdseed commented 6 years ago

Trying to "take" an item while an identical item is in your inventory will give the response "You’ve already got it." instead of picking up the item.

Steps to reproduce:

irmen commented 6 years ago

What was your expected outcome?

(essentially, the response is correct as it is, no?)

itsbirdseed commented 6 years ago

Ah, sorry for the ambiguity, I had a bit of trouble with the wording of the title. The action is technically valid, but it seems like if there are two identical objects, one on the ground and one in your inventory, the parser tries to "take" the inventory item rather than what you'd contextually assume, picking up the item on the ground. Because of this, you can't pick up the item at all unless you move the inventory item to another location or hoover up everything in the location with "take all".

irmen commented 6 years ago

"hoover up" :-)

I'll have a look at the priority issue. Seems right that you want to 'take' stuff looking in your environment first (does it even make sense to look in the inventory at all? odd)

Still: even if the parser finds the item in the environment, what do you expect to happen? Have two identical objects in your possession? I think this will cause other problems to address them properly . THe parser has no concept of ordinality if I remember correctly

itsbirdseed commented 6 years ago

Thanks for looking! I was assuming there was some functionality for it since the on-ground description had support for multiple items. I was planning on trying something RPG-like where having multiple similar items (ex. healing potions) would be fairly common, but I understand that's not exactly what the framework is built around.

irmen commented 5 years ago

You're right, the MUD mode of Tale should perhaps 100% support carrying multiple similar items. I'm not going to add/check that now, but it is something to consider for a future version.

For now, it looks like carrying multiple clones of an item does work and you can drop one and keep the rest, etc, so perhaps it's already good enough?

irmen commented 5 years ago

@itsbirdseed can you check to see if the change works for you? It should be possible to have multiple items in your inventory now.

itsbirdseed commented 5 years ago

Yep, seems to work just fine now, thanks!