I was wondering if there were some good resources for the concepts of a FPS inventory. My current idea to to just have a JSON file with every item having a “name” “type” “weight” and “count” propertys. I was thinking this would have the added benefit of using a single list that can be used for multiple menus(ie: healthpacks menu, ammo menu, etc)

Are they different approaches or resources for FPS inventorys?

  • DarkAri@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    You would have to create a UI object for the container, and a array or list for the actual inventory objects, and then a way to sync this data to disk or to a save buffer to keep it updated.

    • lilith267@lemmy.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 months ago

      Oh wow did now expect a year and half old post to still be receiving comments LOL

      Thank you for the input and I have already come a very long way in the hobby and this question almost seems silly now

  • eRac@lemmings.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    If the items are standardized, all you need in the inventory is an item ID of some sort and a count. You then have an item DB that has name, icon, weight, etc for each item.

    If you have random items, you need to store more properties, but you should keep the inventory structure as slim as you can.