How do I create a Drag'n Drop Inventory?

Get help using Construct 2

Post » Fri Dec 04, 2015 5:06 pm

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. :D
If someone already did something like that it would be cool if you could attach an example capx.
Thanks for replies! :)
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Sat Dec 05, 2015 5:54 pm

Can anyone help?
Thanks :)
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Sat Dec 05, 2015 6:03 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Dec 05, 2015 6:31 pm

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
Eat ALL THE BACON!
B
47
S
17
G
3
Posts: 290
Reputation: 5,070

Post » Sat Dec 05, 2015 10:50 pm

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! :D
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Sat Dec 05, 2015 11:26 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 07, 2015 2:59 pm

@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
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Mon Dec 07, 2015 6:39 pm

Can anyone help regarding the multiple inventorys and what I could improve? :)
Thanks
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Mon Dec 07, 2015 8:59 pm

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?
Eat ALL THE BACON!
B
47
S
17
G
3
Posts: 290
Reputation: 5,070

Post » Tue Dec 08, 2015 4:20 pm

@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!
Image
B
5
S
3
Posts: 193
Reputation: 1,063


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests