Replies: 8 comments 12 replies
-
yeah... missing multi-dimensional arrays definitely caused me a headache here and there in Godot. I'm just thinking out loud here, but if all your items are at least rectangular in their shape they'd on the grid (no tetris blocks, more like battleship), then you could just add a Vector2 property to an item that stores its size. Something like:
would be equal to:
And in your "suitcase", extrapolate if an item fits by checking the empty slots around a clicked slot and compare that to the space requirements of an item. (sorry for accidentally closing this discussion 😇 ) |
Beta Was this translation helpful? Give feedback.
-
Phasorknight, I remember discussing this with you a little before and you seemed interested in making it more modular so a third party inventory system could optionally be used Perhaps instead of overhauling the current system we could make a framework of some kind so that a system like GLoot is compatible? Perhaps via signals? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
So I made some progress on making it work like a grid! I'm still needing to figure out how to get it to work with colliding unmergable objects and also scaling up the texture without scaling up the grid square that its attached to: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
More progress:
gridinventory2.mp4 |
Beta Was this translation helpful? Give feedback.
-
@Phazorknight I'm close to a fully functional solution. I've tested it on the Cogito 04 scene and the only thing I need to get working now is the external inventories and making sure that the default unaltered inventory state doesnt break anything. How would I go about raising a PR? |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, Since I merged PR #194, I'm replying here. Here's a quick demo: I'm going to open a few issue tickets for a handful of quirks that I wasn't fully able to fix myself yet, maybe someone else can take a look. As this also changes a handful of things, I'll try to add a new section in the documentation that explains how it all works soon. |
Beta Was this translation helpful? Give feedback.
-
Hey all,
So as part of the project idea I've had I was wanting to make a grid inventory system like in Resident Evil 4 or Deus Ex but I'm honestly not sure I'm smart enough to do this, one of the major issues I've run into with Godot is that it can't do typed 2D Arrays, so changing the existing InventoryPD class to use two dimensions instead of one seems to be impossible. I tried with a Dictionary but Dictionaries in the editor dont appear to support resources, and I wasn't able to find a way to prefill the dictionary with empty values.
Has anyone tackled grid based inventories in projects before? I'm kinda really struggling with this.
Beta Was this translation helpful? Give feedback.
All reactions