Plan for increasing item limit
From OHRRPGCE-Wiki
There is currently a maximum of 254 available items (32000 in the WIP versions). Your inventory consists of 200 slots that can each contain up to 99 copies of an item. There is no code for gracefully handling the situation where you gain an item that you do not have room for.
The inventory data is just a single 16 bit integer for each slot. The low 8 bits is the item ID + 1 (0 for blank) and the high 8 bits is the number of items (which can only be 1 to 99 so actually only 7 bits are ever used) The item data is stored in the player's inventory in this same format.
Phase one (increasing limits)[edit]
-
Write a Type to store inventory slots. It should have at the very least a member for item ID and a member for item count(done) -
Make the SAV file support convert from the old format and store as this new type(done) -
Convert all item inventory related code in game to use this new Type.(done) -
Test the heck out of it(done) -
Write new SAV support for the inventory data(done) -
Re-write equip menu, which still uses 8-bit item IDs(done) -
Allow more than 254 items(done) -
Allow the game author to set the max size of the inventory - Write a trade/drop screen where a player can handle inventory overflows by making room.
- Test the heck out of it again
Phase two (possible new features)[edit]
- Add optional per-hero inventories
- Optionally allow the shared inventory to be disabled.
- Update battles to support hero-specific inventories, and disabling of shared inventory
- Make the size of inventories changeable in-game (so you can buy a larger "bag" or upgrade your hero's carrying capabilities)
- Make the max number of items in an inventory slot customizable.