GridPack - Create Grid/Tetris Style Inventories

Ohā€¦ Thatā€™s because I did not see the function with : so I figured out it was . I will try this when I get home thanks !

Update : it worked thank you so much !

1 Like

viewports donā€™t seem to work when you transfer item managers

This doesnā€™t help me very much, in what way is the viewport not working?

I believe I might be facing something related to the viewport problem.

Specifically, this occurs while creating a MoveMiddleware function. And moving items to a new ItemManager.

On my case. When conditions are checked on the client and handled accordingly, everything functions as expected. However, when a remote function is fired to request permission from the server (even if it simply returns true, without performing any operations), the viewport GUI becomes blank.

After some testing I came to the conclusion that for some reason, on my code, simply adding a remote function to invoke the server causes the viewport frame to break. If iā€™m not going crazy. I suspect the issue might be something simple that Iā€™m overlooking, or maybe a beginner mistake. but Iā€™m curious if anyone else is experiencing the same problem or something similar.

Edit: I created a queue system and used task.spawn to run the function, and it seems to be working.

2 Likes

i resolved it by making it create a new model everytime the itemmanager changes


there seems to be bug with rotating when a item is intersecting another item

3 Likes

nvm i found a solution to the problem i was having

How would you make it so items can be equipped onto the SingleSlots manually?
Like via clicking a button instead of dragging
image

1 Like

Just a note that this is assuming that the item is already in a itemManager

Ive composited a quick toggle for this, you may change / modify it however you would like

local clicked = false

yourButton.MouseButton1Click:Connect(function()
	if clicked == false then
		clicked = true
		inv1:RemoveItem(myFirstItem)

		inv2:AddItem(myFirstItem)
	else
		clicked = false
		inv2:RemoveItem(myFirstItem)

		inv1:AddItem(myFirstItem)
	end
end)

There might be other ways to do this, but this is how i found the way.

2 Likes

@iFrexsim How would i dataSave items and load them back into the grid when the player joins? Is there a prefered way or would you have any idea on where i could start?

1 Like

Use MoveMiddleware to communicate the item changes to the server and then save them.

2 Likes

Ohh, I see, I didnā€™t notice thereā€™s an additem function haha. Thanks!

Edit: unfortunately, it didnā€™t work with my system but Iā€™ve figured out a different way by adding another trove in the item module script with self._trove:Add()

2 Likes

You can also communicate to the server upon item addition

1 Like

What should i use to communicate the item to the server? Because when i try just sending movedItem thru a remoteEvent it returns Tables cannot be cyclic, and i cant send the movedItem.ItemElement as it returns nil to the server.

1 Like

is it possible to create a grid with a separated grid slots inside them?
Like this, all in one grid instead of multiple
image

1 Like

if you are talking about having all of those slots in one then probably not, i may be wrong but from my knowledge, No.

@iFrexsim do you think you could provide an example as i am a bit stuck

There should be an example in the test folder on the GitHub repo, itā€™s the code I use to test GridPack.

2 Likes

How would I handle items that is server-sided / available for other players as well?
Such as a loot crate that can be accessed by multiple other players and if player1 is viewing the loot crate and takes a loot, then the taken loot wont be available for player2 who is also viewing the same loot crate.

Iā€™ve been working on making a Tarkov style of a game and so far the only problem is handling the inventories on both client and serverā€¦

1 Like

So how will this be used with actual tools? Iā€™m having troublesā€¦

1 Like