Issue with using Inventory Array

Get help using Construct 2

Post » Sat Feb 22, 2014 8:53 pm

Hey everyone!

I tried to look up some better ways of doing this, or something that would help me out ,and wasn't able to.
I've been using Encrypted Cow's tutorial here: https://www.scirra.com/tutorials/583/ea ... g-an-array

To create an inventory, and I'm using it pretty much exactly as he has it which you can see here:

Image

However, I don't want to have to right click on an item to get rid of it, etc, I want to be able to use multiple items at once to create a new item.

For example, the player needs to make a apple pie, but needs pie crust, apples and sugar to do so.

Say Pie Crust is itemID # 20, Sugar is itemID #15 and Apples are itemID #2 while the actual PIE itself is itemID #3

Is there a way in events to essentially say if the player has ItemID 20, 15, and 2 that they can then receive the Pie, Item ID #3? And have those 3 items vanish from the inventory, and have only the pie left?

If anyone can help me understand this a bit better, I'd really appreciate it!
B
4
Posts: 78
Reputation: 606

Post » Sat Apr 26, 2014 5:34 pm

You'll need to provide the .capx that contains this issue. That would make it easier to help you. However one suggestion I would like to make is that you model your Item Combining after Wndows Explorer file selection. So you would need a Select Item Group of Events that would handle the case where you would be pressing Ctrl and Left Clicking. This could result in the Inventory that was clicked to get highlighted. Thus in the game you could repeatedly select more items, then have a Combine Items Group of Event that would trigger on a Right Click if the number of Selected Items is greater than 0. Then somehow that event group would determine what item should be created based on the Selected Items and then have the Selected Items destroyed. This is just one example. A better would be to have a Recipe that you choose to make an item from and it would automatically check to see if you have all the necessary Items and then destroy/create the appropriate Items.
B
9
S
2
G
1
Posts: 41
Reputation: 708


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests