How do I create a Drag'n Drop Inventory?

0 favourites
  • 10 posts
From the Asset Store
Awardkit
$5 USD
Create custom awards and achievement or use the many templates and create your own.
  • Hi,

    I would like to add a Drag'n Drop Inventory to my game. I already tried different things but i can't get it to work properly.

    The inventory should have slots where the items are put in and the player should be able to move them in there. I also would like to have a limit of items in one slot so it puts them in another one if one is full. Just like in Minecraft for example.

    If someone already did something like that it would be cool if you could attach an example capx.

    Thanks for replies!

  • Can anyone help?

    Thanks

  • I've also wanted to have a drag and drop inventory, with a bit more easy setup...

    I've been working on one the last few days... If I find a good method, I'll let you know!

    Justin

  • Thanks LittleStain, antares330,

    I already searched on Youtube and the Scirra tutorials. I can't find anything that really helps me.

    Actually my problem is to save the item ID and the amount in an array (I don't have much experience with arrays) and let the game automatically put the items in the next free coordinate in the array. Also I have problems with setting the item slots to the stored item and the amount.

    Thanks again!

  • The amount of examples on the forum and tutorials and youtube is enormous..

    None of them will be exactly what you want, but by studying them, changing them a bit, you'll get a long way..

    After doing that, instead of asking the big question "How to make this" you could ask smaller questions, regarding specific things not found in the examples and/or tutorials..

    If arrays are difficult, you could first look at tutorials about that subject..

    They might not be specifically what you need, but you can learn a lot from them, making it easier to understand what you have to do to get them working..

  • LittleStain, antares330,

    Ok I'm now able to add an item to an array and set the amount of the item and the animation frame to the value in the array. Now I would like to be able to add more arrays or make the array 3 dimensional so I can actually have more than one inventory (to make chests for example). For that I have to improve the way the slots work too I think. Because at the moment every slot has it's own instance variable that tells the game where the value is stored in the array.

    I'll put in a link with my capx so you can get a better understanding from what I mean.

    Thanks for your help!

    https://drive.google.com/open?id=0B7r2W ... UFaRUY5eVE

  • Can anyone help regarding the multiple inventorys and what I could improve?

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I haven't really had time to keep working on my current version... so I haven't had time to think deeply about it...

    I don't know if setting up a 100 arrays for all your chests is the right way of going about it... (could be, but, I have no clue on how that would effect performance.)

    Couldn't you just make the array larger, into the 3D dimensions? then each new chest would be back a layer?

  • antares330

    That's exactly what i was thinking of. Look at my example capx maybe it will help you. I think I'm on the right way.

    I'll try more things out. If I find out something new I'll let you know!

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