How do i Implement this style inventory?

0 favourites
From the Asset Store
Inventory Aid
$4.90 USD
Create grid-based game inventories and items easily.
  • 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

  • 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.

  • 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.

  • Pic is from Queenstown New Zealand. Your signature is also true <img src="smileys/smiley11.gif" border="0" align="middle" />

    Feel free to ask.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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 shinkan

  • Fixed. If you want I can make you an example of inventory with arrays, need some break from my current project heh.

  • Fixed. If you want I can make you an example of inventory with arrays, need some break from my current project heh.

    That would be awesome if you could do that for me to have a visual,Alot of the examples on the website are lacking some stuff so i have been tryin to peice things together using multiple peoples tutorials and its kinda confusing because everyone has a different approach.I would be more than grateful to have your help with this inventory shinkan

    also thank you for fixing that link im going to check that out right now.

  • Just tell me what you need - basic stuff like how many rows, columns...

    You want to add items by clicking on them with mouse or overlapping by another sprite? Same type of items should stack on each other or occupy different cells? I try to comment everything in file so you could easily understand whats going on and make changes to any part of it.

  • shinkan i will have 4 rows of 10 slots,I would be adding them to the iventory when the player breaks a block a dropped block will spawn for the player to pickup and it will be by overlapping.The same items should stack ontop of each other.You can think of this inventory like Minecraft.I say that because the way minecraft picks items up,You just move overtop an item and it automaticly goes into you inventory.I apoolgize if im not the best at explaining this in detail.If i missed something just let me know.I am making this for Mobile devices if that helps,so everything will be touch.

    One main reason why i need to create this inventory is because i cant add or destroy blocks unless they are inside the inventory in the hotbar,I want to make the player dig and collect blocks instead of having them all for them from the begining.

  • RookieDev just send you a pm

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • shinkan Thanks for improving that. I have bad habit of making simple thigs too complicated <img src="smileys/smiley9.gif" border="0" align="middle" />

    Can you explain how this works:

    self.state = 0 ? 1:0

    For example what does "?" do

    Could it be used for more complicated state systems. I'm sure it's already explained many times before just don't know what to search for.

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