playMaker

Author Topic: Inventory array method  (Read 1235 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Inventory array method
« on: March 17, 2018, 10:11:01 PM »
Hi, I created my own inventory system using the method of saving the items' string values in a arraylist.

So when the game is loaded, a FSM will create gameobject items by checking each of the string value in the arraylist for example: 0- touchlight, 1- rope, 2- meat.

That's the method I came up with since arraylist can't save gameobject directly. I am wondering if this is the best method or is there a better method?

Thanks :)
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Inventory array method
« Reply #1 on: March 19, 2018, 05:51:01 PM »
Hi,
it depends a lot on your project.

For larger inventories i would suggest usin xml/json and Datamaker