overextended/ox_inventory

Notice: Limited feature/enhancement updates (v3 info)

thelindat opened this issue ยท 21 comments

No major enhancements or features will be implemented or merged from requests.

Ideally any bugs or minor nuisances can be patched, or other small changes can be implemented infrequently - the idea is to be able to provide long-term support and ensuring a stable release is always available.

I want to be able to work on ox_inventory v3 at some point which will guarantee many breaking changes and will require a great deal of effort to help users transition towards it.


Some expected changes for v3

  • Improved third-party support, with externally registered items, crafting recipes, etc.
  • Improved separation of data and code (no functions in data files); using json and the database
  • Improved database structure
    • register at least some generic item, stash, and shop data in the database
    • store inventory slots per-row to improve indexing and saving, especially reducing the amount of needless data being sent to the database

Some suggestions for the v3

  • Be able to use / interact with items directly in containers
    Ex:
    • Cigarette pack = container with 20 cigarettes, be able to use one of them instead of swipe it to the main inv)
    • Wallet = container with money, be able to pay in shops etc with the money inside wallet
    • Steal someone = be able to search inside containers of robbed player and take items
  • Select payment methods in shops
  • Check degrade for ingredients in craft benchs
  • Add containers with predefined items in shop (Ex: Cigarette pack)

Be able to use / interact with items directly in containers

This would definitely need to be a case-by-case basis.

Wallet = container with money, be able to pay in shops etc with the money inside wallet

Containers definitely need a rework and I need an improve "search" function that takes some different options, including going through containers. Would get a bit shitty if we have nested containers, however.

Steal someone = be able to search inside containers of robbed player and take items

Pretty much comes down to needing to return to the previous inventory, or otherwise making containers open a new inventory window.

Select payment methods in shops

Already something I've wanted to do for a long time.

Check degrade for ingredients in craft benchs

Crafting system needs a complete overhaul.

Add containers with predefined items in shop (Ex: Cigarette pack)

I feel like hooks are good enough for this; also need to consider - does this need a full inventory or just some metadata (x cigarettes remaining). On the matter of hooks, the new inventory will be built around them to allow far more actions; a lot of hardcoded behaviour will moved to hooks.

Be able to use / interact with items directly in containers

This would definitely need to be a case-by-case basis.

Could be done by adding something similar to stack & close in data/items.lua (or whatever it becomes) ๐Ÿค”

Also would it be possible to have tabs for the inventories?
Would make for a better experience when dealing with containers / other player's inventories

(could have all the player's containers as tabs* on the left side & the ground/drop/ [insert other opened inventory (trunk etc)] on the right side)
*+ (ideally configurable) extra inventory tabs (allows having a whole inventory reserved for x or y item type i.e clothes, keys, food etc)

  • does this need a full inventory or just some metadata (x cigarettes remaining).

There is ton of ideas to implement if container was ez to use

  • buy a menu at a fastfood -> bag with all item inside
  • buy a fishing kit -> box with fishing rod / bait etc...
  • cigarette box
  • shopping bag with all your clothes items purchaseds

Hooks are good, but container need to be registered once before to be able to add item inside, this is a little tricky

Metadata can do the trick for cigarettes but you miss the concept of container, ex : i smoke 1 cigarette then i have a free slot inside and can hide my weed inside

I like the @TonybynMp4 idea of tabs
This way, you can have many inventories opened at the same time and just switch between them

There is ton of ideas to implement if container was ez to use

I'm specifically talking about your example of cigarettes in a container which seems overkill.

Hooks are good, but container need to be registered once before to be able to add item inside, this is a little tricky

https://overextended.dev/ox_inventory/Functions/Server#getcontainerfromslot


Sidenote, containers need to be properly linked to items in the database so that I can remove "dead" containers that have been deleted. Having thousands of containers like cigarette boxes and fast food bags isn't ideal.

Hooks are good, but container need to be registered once before to be able to add item inside, this is a little tricky

It's easy enough ๐Ÿค”
https://github.com/TonybynMp4/y_burgershot/blob/main/server%2Fmain.lua#L33-L44

I like the @TonybynMp4 idea of tabs
This way, you can have many inventories opened at the same time and just switch between them

Keep in mind we need to keep track of the opened inventories and the players they were opened by so that we we can update all clients that have these inventories opened when the state changes, which sounds like it could be a bit tricky/annoying.

Though I also like the idea having tabs for stuff like containers.

Keep in mind we need to keep track of the opened inventories and the players they were opened by so that we we can update all clients that have these inventories opened when the state changes, which sounds like it could be a bit tricky/annoying.

This is actually something I'm already doing ever since the "inventory sync" update and wouldn't be difficult to adapt for multiple open inventories.

This is actually something I'm already doing ever since the "inventory sync" update and wouldn't be difficult to adapt for multiple open inventories.

Noice, UI would definitely need a whole lot of adjustments for something like that since it's currently hardcoded for left and right inventory only. Something to keep in mind for the rewrite.

bag support would be neat.

bag support would be neat.

wdym by bag?

think he means backpack

think he means backpack

Yeah i'm wondering cauz that's already a thing you can do lol

statebag i guess

solidjs

dont punch me, but ox_inventory in Sveltekit would be so incredibly cool

bag support would be neat.

wdym by bag?

Backpacks, so we can potentially have a second (or third, depends on how you look at it) inventory. So when i open my inventory and I have a backpack on, it'll show another inventory below my main inventory with stuff in it from the bag.

Not sure how to word that better, but it's probably pretty obvious what I'm talking about.

bag support would be neat.

wdym by bag?

Backpacks, so we can potentially have a second (or third, depends on how you look at it) inventory. So when i open my inventory and I have a backpack on, it'll show another inventory below my main inventory with stuff in it from the bag.

Not sure how to word that better, but it's probably pretty obvious what I'm talking about.

This has already been implemented for quite a while. https://overextended.dev/ox_inventory/Guides/creatingItems#creating-container-items

May i suggest adding a "multi stash", some kind of UI to show and allow interaction with multiple stashes at once, with optional pins for each stash, kind of like a locker, potentially making it "customizable", if you have the right permissions you could change the name of the stashes, the pin.. ๐Ÿค”

I think it would be better to integrate such a thing directly in the inventory's UI instead of using a ox_lib menu (like the inventory's evidence does) or an external UI.

i was thinking of some way to classify items as illegal or drugs this could be stored in a statebag and identified as a config variable. a use of this would be for a things like drug dogs etc to quickly see if a player had an illegal/drug item on them. i have a custom adaptation that incorporates this already but it would be a cool feature for v3.

i was thinking of some way to classify items as illegal or drugs this could be stored in a statebag and identified as a config variable. a use of this would be for a things like drug dogs etc to quickly see if a player had an illegal/drug item on them. i have a custom adaptation that incorporates this already but it would be a cool feature for v3.

You can do that 100% without touching the inventory nor statebags with a simple item check, it would be pointless to add it to the inventory