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

Items and inventory with Grid #35

Open
scriptsengineer opened this issue Mar 14, 2023 · 5 comments
Open

Items and inventory with Grid #35

scriptsengineer opened this issue Mar 14, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@scriptsengineer
Copy link
Member

The idea is to add an option to the item to be active if this item has grid information with X and Y and Z option (Z for an inventory that is 3D, see #32 )

Grid Inventory: Resident Evil 4 Example
image
https://store.steampowered.com/agecheck/app/254700/

Inventory should also have an option to define whether or not it is grid based
Question: The inventory and item with grid must be created class that extends the current ones or just add an option in the already existing classes? 🤔

@Cleptomania
Copy link

Has there been any progress on this? Would you be open to a PR implementing this?

@scriptsengineer
Copy link
Member Author

I had no progress, just planned, I would be interested in reviewing your PR

Has there been any progress on this? Would you be open to a PR implementing this?

@benjamin-kirkbride
Copy link

@scriptsengineer could you give a brief idea of how you would approach adding this feature?

@scriptsengineer
Copy link
Member Author

scriptsengineer commented Sep 18, 2023

@scriptsengineer could you give a brief idea of how you would approach adding this feature?

I accept suggestions
We have two questions here:

1 - Be incremental

Initial idea was to have a GridInventory (which extends the Inventory) in which it will have a double array that indicates which slot of the base Inventory that item is pointing to
Example slot x: 1 y:0 indicates slot[1] of the base Inventory
the slot x: 1 y:1 would indicate the slot[1 + (width of grid)] of the base Inventory

2 - Items that occupy more than one slot:

I really wanted to check some examples but today I would do it like this:
If the item occupies more than one slot, the additional slot points to the main one.
Example of a 2x2 grid where the "-" indicate the same InventoryItem ID: 2 placed horizontally
[ ] [ ]
[ - ] [ - ]

the x[0] y[0] slot would place the current item information
the x[1] y[0] slot would have special information (Here I accept suggestions, in this case I marked it with an x in front of the number) indicating the continuation of an already existing item.

[ ] [ ]
[ 2 ] [ x0 ]

@benjamin-kirkbride
Copy link

benjamin-kirkbride commented Sep 18, 2023

Perhaps we try to emulate this: https://github.com/peter-kish/gloot/blob/master/docs/inventory_grid.md

@scriptsengineer scriptsengineer added this to the 1.0.0 Release milestone Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants