How do I Create an inventory system that can have items between multiple layouts?

0 favourites
  • 3 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I am creating a game and I thought I had built a decent inventory system until I started creating multiple layouts and the items don't travel between them. I tried using persist but that only helped me to put the 'item' in the 'slots' when I come back to a layout and not when I went to another.

    I'm creating my head over this a lot. I have made a discovery which notes the name of the item and the slot to which I have added it. But now how can I get that to come in other layouts in the same sequence and align them to my slots? Creating new items just creates unwanted objects every time I enter a layout.

    Is there a better way to create an inventory? I'm creating a point-and-click game for reference.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of Persist you are probably looking for global items or a global layer. This way the objects would continue between layouts. The global layer is more for a HUD or UI if the inventory acts like this. Making the inventory slots themselves 'global' by ticking the box in the properties means they will travel between layouts. Don't use both the layer and global object, pick one style.

    In general though you should be using Arrays. There is a tutorial here although it might be a bit scary to look at if you are new to them. construct.net/en/tutorials/building-rpg-style-inventory-2499/programming-inventory-setup-4

    Think of the array like a list or table of items and the rows are slots for storing them, columns would be data related to the item like name or amount. It gives you less of a physical style inventory and more of a storage that you can manipulate with events, you have more control with that.

  • Thanks Lionz.

    My first post seems to be riddled with mistakes after a long frustrating session on game-making but you were able to decipher what I meant and give me some valuable info.

    I think I will need to use the array sooner or later since there is no way around it. The game wasn't meant to be so huge to invest long hours on a separate systems but now I think it might be worth it.

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