Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Consumable Logic #53

Closed
wants to merge 4 commits into from
Closed

New Consumable Logic #53

wants to merge 4 commits into from

Conversation

SOH69
Copy link

@SOH69 SOH69 commented Dec 6, 2023

This PR changes on how the consumable works, its a very messy thing to work and people ingenerally make a mess within code while doing it.
This wrapper will improve the efficiency of consumables, remove all possible glitches and help devs to add item easily to consumables
The consumables.md potrays how to add items and all the feautures

@mafewtm
Copy link
Member

mafewtm commented Dec 6, 2023

image

@SOH69
Copy link
Author

SOH69 commented Dec 6, 2023

Maybe we should have a dedicated script for consumables? Or with core?

@Manason
Copy link
Member

Manason commented Dec 7, 2023

Maybe we should have a dedicated script for consumables? Or with core?

It seems to me the proper place for items is in ox_inventory data/items.lua
We could maintain a snippets repo maybe for people to copy and paste items in? I'm not sure what if any logic is needed that ox_inventory wouldn't support requiring a separate resource

@SOH69
Copy link
Author

SOH69 commented Dec 8, 2023

But you still the required event that you manage consumables, in my pr you can remove the createuseable loop, in items.lua you declare the event name, and with few changes with my commit that can be used as a handler

@Manason
Copy link
Member

Manason commented Dec 8, 2023

But you still the required event that you manage consumables, in my pr you can remove the createuseable loop, in items.lua you declare the event name, and with few changes with my commit that can be used as a handler

I'm not sure that I'm following you. What handling is needed for these items that ox_inventory doesn't have? Thirst/Hunger/Stress can be set via the status field https://github.com/overextended/ox_inventory/blob/main/modules/bridge/qb/client.lua#L38

@SOH69
Copy link
Author

SOH69 commented Dec 8, 2023

But you still the required event that you manage consumables, in my pr you can remove the createuseable loop, in items.lua you declare the event name, and with few changes with my commit that can be used as a handler

I'm not sure that I'm following you. What handling is needed for these items that ox_inventory doesn't have? Thirst/Hunger/Stress can be set via the status field https://github.com/overextended/ox_inventory/blob/main/modules/bridge/qb/client.lua#L38

ISSUES

  • Ok so let me explain myself here, as you refered to the ox snippet here uses same event to handle consumables as smallresources/server/consumable. Accoding to me the latest version of consumable handling is not good best and reliable (as of qbcore, but with ox_inventory integration fixes many issues that i know). ox need to redesign their consumable logic for qbox also!

  • But with ox_inventory there are still some backoff of item use, ex: you still need to make a event handlers to manage armor/parachute and many other items use and place it somewhere maybe in a resource named ox_inventory_addon.

This is where my commit comes in place, it acts as a wrapper for items use and fix both of the above issues

POINT NOT TO USE MY COMMIT

  • if ox makes a separate logic for cosumable handling for qbox
  • if qbox is maintaining a separate resource for handling inventory addons

@mafewtm
Copy link
Member

mafewtm commented Dec 8, 2023

We'll keep that in mind.

@mafewtm mafewtm closed this Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants