Set up different 3D Arrays for scrollable inventory lists

1 favourites
  • 4 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • Hey folks,

    I'm trying to create several item databases for my game, all of which I want to be able to display as separate scrollable lists on different Layouts:

    1. Inventory A - Items that are dynamically-generated from an Array of 'characters with attributes' that is populated by a JSON File in my project folder, in combination with some randomization of properties of each item
    2. Inventory B - Items generated as a result of a mini-game but the player can modify the names of before finalizing
    3. Inventory C - A 'currently equipped Inventory B items' bucket that can be viewed separately from Inventory A
    4. Inventory C - Items that are crafted from combining items in Inventory B
    5. Inventory E - Items that have been purchased from Inventory A, and deleted from Inventory D upon purchase

    Now, I think that Inventory A is actually the first one that I have to build, since it's pulling its data from a static JSON source. Then I would have to do Inventory B, and so on. Imagine this is the first three sheets of the Array:

    Sheet 1:

    Boom Stick 3 Shotgun 450 George

    Sheet 2:

    Pew Laser 10 Rifle 1000 Sarah

    Sheet 3:

    Ratatat 8 Machine Gun 850 Bilbo

    And each of these sheets would be a scrollable list item somewhere on a Layout (I 'think' I know how to make a scrollable list, just downloaded an example CAPX that has everything I need, but might need to know how to instantiate each list item from these Array sheets).

    I wanted to ask specifically instead of combing through a bunch of 'kinda the answer' posts that aren't easy to fit together. I can't finish my game without these scrollable lists, and they need to have solid data delivery systems so I figured Arrays would be the best way. For what it's worth, I had this figured out in C2 by just using rexrainbow's TaffyDB C2 plugin and For loops, but that plugin is not available for C3.

    Any help is appreciated!!!

    Thanks!

  • I don't mean to be rude but I did read through that twice... What was the question you wanted to ask exactly?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I thought this subforum was the "How do I?" section. I'm asking how to do these things. I wanted to explain what I'm trying to do, with the pretense of, "how do I do this?"

    How do I best replace TaffyDB as a reliable C2 database plugin? How best to set up inventories that can borrow data from each other? How to create arrays that I can use to make scrollable lists in C3?

  • Ok so there's 3 parts to this: displaying an array, modifying arrays, and saving arrays.

    It sounds like you have a solution for displaying, so I'm not going to touch on that much, since there are many different ways to do so depending on how you want it too look and feel.

    My main advice would be to use seperate 2d arrays instead of a 3d array, since you want to be able to modify them individually. For example in your fifth point, you want to remove an item from one array upon adding it to another. If you were to delete the xth row in a 3d array, it would delete that row across the entire z axis as well.

    So start with organizing the arrays you want as seperate objects, displaying them, and modifying them as needed as 2d arrays.

    For saving, you can get an entire array's content as a string with the array.asjson expression. Save this string to a local storage key for loading later with the array object's load action.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)