Inventory package fails when the user has over 20 items

Describe the bug:
The InventoryViewScript contains the following line in the UpdateInventoryView function:

self:SendToLocal("LocalUpdateInventoryView", currentIndex, self.inventoryScript.inventory, self.inventoryScript.currencies)

This is really inefficient as it sends the whole inventory (self.inventoryScript.inventory) to the client. It is also called fairly often. If the user has over 20 items it fails completely, as it runs into networking restrictions.

A solution would be to optimize the Inventory package to only send the necessary data that has changed. Most of the time it would be enough to only send the index of the selected item.

How do you cause this bug?

  • Use the default Inventory package
  • Assign 20 items to the user, for example with the InventoryDefaultsScript
  • Update the inventory, for example by selecting a different item in the hotbar

Which platform: PC

Which input: keyboard + mouse

Your Crayta username: Vilva#9953

Game seen in (including “Hub” or “Editor for XYZ”): Editor for Farmer’s Life

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): Every time

Time + date seen: 26.09.2022

Version number (found in Help tab in Settings): 0.g3.9.128732

1 Like

Hi @Vilva,

Could you just throw me an example to put in InventoryDefaultScript in Farmer’s Life to reproduce this please?


Hey @QA_NFraser ,

in Farmer’s Life the bug doesn’t occur anymore, because I used the Inventory package from Daigoro instead of the default one.

Hi @Vilva,

Alrighty, thanks. I’ve put a bug report in with the info you supplied.

1 Like