How do I Make An Inventory System?

Just started using Construct 2? Post your questions here

Post » Sun Sep 24, 2017 11:07 am

I'm trying to make a simple inventory system for my game. I'm basing it off of the sample inventory project from Construct 2:

https://www.dropbox.com/s/a21t52ct6evtm69/Inventory-1szq9x0sfx0rc.capx?dl=0

It comes with a lot of comments, which is helpful, but I still don't understand a lot of stuff!
Please take a look at the above capx file and tell me...

1) Where is the part of the Events Sheet that makes the item disappear when clicked on and reappear in the inventory? I thought there might be some kind of "Destroy" command, but there's not, so I'm trying to figure out how it just disappears from the playable level and reappears in the array. Feel free to modify the capx with your comments!!! It will help me!

2) I see Function.Param () a lot. What does that mean? What does it do?

Rest assured, I will have more questions. Let's start with these, though. Like I said, feel free to add more comments and clarification to the Events Sheet. You really do have to explain this stuff like I'm 5 years old.

Thank you!
B
8
S
2
G
1
Posts: 89
Reputation: 1,230

Post » Sun Sep 24, 2017 11:41 am

1) it's in the "DisplayINVContent" function. All items which should be in the inventory are moved (re-positioned) to InvCell sprite.
When you remove them from the inventory, they are returned to StartX, StartY position.

2) Parameters are used if you need to pass information to functions. For example:
Call Function "PlayerUseItem", parameter(0)="HealthPotion", parameter(1)=3
So the function knows that player should consume 3 health potions.

This inventory example you are using is pretty complex. There are a few examples in the FAQ, have you checked them?
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
125
Posts: 1,735
Reputation: 66,791

Post » Sun Sep 24, 2017 11:59 am

@dop2000

Thank you so much! I will check the FAQ. I saw this example on YouTube, so I went with it... plus the instructor said it was "simple". Lies!! Lol
B
8
S
2
G
1
Posts: 89
Reputation: 1,230


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest