Inventory Rework

09/03/2017

Inventory system has been reworked; lots of modifications have been done to make the system a lot better.

MODIFICATIONS:

 - System now uses ID's instead of names

 - Names, sprites, and stackable attributes are assigned to each ID

 - Code condensed from about 250 lines to 50 lines, using for loops to loop through each ID instead of writing it out for each object.

 - Items can now stack, item stacks can be set in the inventory object (currently, maxStack is set to 15)

 - Inventory sorting methods now only use two parameters (slot value "i" and item id "j" or "k" etc.) compared to the prior three or four. This is because all of the previous parameters can now be accessed via the item's ID.

TO DO:

 - Crate inventories still need to be fixed. Inventory system no longer works for crate inventories.

 - Optimisation is needed. Lag occurs on weaker computers when the inventory is drawn, not sure why.

Lot's of progress though. Gonna go work on the new crate inventory tomorrow, not quite working yet.

Create your website for free! This website was made with Webnode. Create your own for free today! Get started