Querying inventory content

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Querying inventory content

Post by Tomi »

An inventory system has been on RnD's feature request lists for a long time. Although RnD has an "inventory" which can contain various CEs and objects (dynamites/disks), it's only LIFO, and the player can't choose what to drop (or throw) next. Over the time, various improvements have been made, in particular the game.panel.inventory_* settings, but the LIFO stack stayed.

When I found out has a new change action, "set inventory", it looked very promising. Although it is useful in many cases, I must admit I'm a bit disappointed: more advanced inventory manipulation still isn't possible.

With the help of "set inventory" action, you wouldn't even need fancy "choose item" dialogues, inventory pop-ups or such: just a key combination that rotates inventory items, putting the last one in front. This simple action would allow various complex inventory manipulations. (And I don't think this should be added at engine level. Ever since adding CEs, RnD tries to provide building blocks which level authors can use and customize for their own purpose.) But "set inventory" can't do this yet. You can remove the bottom object from the inventory, you can add a new one at top, but you can't find out which object to add - which object was at the bottom. If there was a method to query that, the rest would be simple to do with existing change actions.

I'm not sure how to implement this. Several methods are possible. For example, provide a new set of reference meta-elements, "top of inventory" and "bottom of inventory", with corresponding "CE score of {top,bottom} of inventory", just like "element triggering change" works now. ("CE value of {top,bottom} of inventory" isn't needed, because AFAIK, CE value isn't stored for inventory objects. By the way, isn't that a bug? But I may be wrong.)
Post Reply