How do i Implement this style inventory?

Get help using Construct 2

Post » Sun Jul 21, 2013 9:20 am

Hi all,

I have a few questions about working with an inventory,I am trying to grasp the thought of how to actually toggle the inventory itself while ingame.
Im not sure if the inventory has to be on its own layout? or do i just pin all my inventory sprites to a seperate box that is within a current layout?
Alot of the Tutorials tell us how to make the inventory work but they lack on telling you how to actually incorperate it ingame.
I left an example of the type of inventory im trying to make,Its a simple inventory in my opinion but thats coming from someone who knows nothing about them.Thanks in advance for helping.
Inventory Example Tutorial
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jul 21, 2013 10:40 am

@RookieDev Simplest way is to put it where it should appear in qui layer (parallax 0,0) and just toggle inventory stuff on/off, visible/invisible.

Or use something like this Example Capx
Press enter to toggle.

First time I made something like this whit C2 but seems to work ok.

Don't know if someone made layout object for C2 that would be one way as well.

EDIT: Over complicated for this task. Use later example instead.Katala2013-07-22 10:26:07
B
33
S
9
G
3
Posts: 517
Reputation: 5,181

Post » Sun Jul 21, 2013 11:09 am

@Katala I will check this out right now! thank you,all i really needed to know is do i have to make a whole layout as my inventory or just pin it to an object,I have some work to do and i will check this capX out if i have additional questions i will come to you,Thank you Katala and Nice Pic man definitly feeling the landscape.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jul 21, 2013 11:20 am

Pic is from Queenstown New Zealand. Your signature is also true
Feel free to ask.
B
33
S
9
G
3
Posts: 517
Reputation: 5,181

Post » Sun Jul 21, 2013 11:44 am

@Katala awesome stuff and that signature is more than true,I wish more people understood.About the capX you sent,I wanted to know if you could fill me in on what Time_Stamp is doing,And also i really commend your style on how you made this pop up so smoothly,I really am attracted to this design.I want to learn more on how you did this.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jul 21, 2013 2:38 pm

@RookieDev Time stamp prevents it executing both actions on same tick (game cycle) I find this usefull on many occasions. Maybe there is other ways of doing same thing but this is one I know. You could try disable "inv_sheet time_stamp < Time" and change order of events 3 and 4 to see what happens.

Smoothness comes from lerp. I don't really know much of the math behind it but in this case it moves inv_sheet from it's current Y position to wanted position (Self.up and Self.Down) whit this lerp formula
lerp(Self.Y, Self.down, dt/0.1)
if you want to adjust the speed change that dt/0.1 part (dt=delta time)

Self.up and Self.Down values are set in the first events.

Edit: Actually it seems to work without "for each Inventory" condition in the first event.Katala2013-07-21 14:42:30
B
33
S
9
G
3
Posts: 517
Reputation: 5,181

Post » Mon Jul 22, 2013 12:32 am

@Katala I want to thank you for going into detail about how some of this works,I never knew how time stamp worked and to go even further i never even heard of it before you shown me this capX.The Lerp function is also something i know very little about but seeing how you created this formula it is showing me some things i never thought possible with Lerp.
Thanks again Katala im going to study this for awhile.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Mon Jul 22, 2013 1:23 am

Inventories are quite fun to do. @Vladoss post a very nice tutorial about them some time ago, You should check it out, cause it looks like what you need - looking at this image you post as an example.

I've remixed @Katala file to something more understandable Toggle inventory example remixed.capx

But for inventory itself You should really use an array - it's not that difficult and will save you a lot of time and headache if you decide to do it be events.
shinkan2013-07-22 01:39:11
ImageImageImageImage
B
155
S
62
G
41
Posts: 2,586
Reputation: 34,412

Post » Mon Jul 22, 2013 1:36 am

@shinkan your link has 404 and i want to thank you for adding to this thread,I need all the info i can get to make this inventory shine.I would love to see you remixed capX file when you fix this.I also have been feeling like arrays will be my best option,Im just having a hard time learning them.
I will check out the tutorial you mentioned aswell,Thank you for adding this information shinkanRookieDev2013-07-22 01:37:50
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Mon Jul 22, 2013 1:40 am

Fixed. If you want I can make you an example of inventory with arrays, need some break from my current project heh.
ImageImageImageImage
B
155
S
62
G
41
Posts: 2,586
Reputation: 34,412

Next

Return to How do I....?

Who is online

Users browsing this forum: Eren, shukra, Voytek and 9 guests