Greaver's Forum Posts

  • Ease up guys!

    99 offered you a good way of using array to handle a large inventory and you can't expect it to fit all uses or be used without tweaking to suit your needs.

    And 99 should know his CAPX solutions are not always going to fix a problem and people need to be walked through what a CAPX does or have it designed more specifically for a certain use or it just confuses them.

    If you can't use it there are CAPX inventory examples in the tutorials to look at.

    He did well ^_^

  • On 'long toes' touched.

    Select 'long toes'.

    Teleport to inventory.

    What are u on about? When u pick up couple of items, then drop them all from the first spot, then the last item will get stuck.

    It does not work, i cant use this system. Its too flawed, too many holes, thanks for trying though, but maybe someone else can help

  • Yea i already made one myself, but i am asking u with your inventory type since mine has no drag and drop.

    I did share it in the previous forums which u downloaded, seems u forgot already.

    Alot of games are with a gamepad, and not all devoloped games here are for PC u know? Try to get that into ur head.

    So many people play with gamepad, i dont know how u missed that part.

    All i asked for ur inventory was to auto select the first possible slot available. Instead of dragging and dropping it, u just click the item and it goes to the first free slot.

    The sample u did is not working, anyway since u seem like this is a great effort for u, then u dont need to reply anymore here. Have fun dude.

    Edit; It does not work when u pick up items and then drop all, some will get stuck, maybe someone else knows how to do this better in a correct way?

    Instead of doing it urself? Ya mean literally? Cant believe i fall 4 that.

    Anywayz, as i said already: all you need is a system that selects things.

    You should have made one that YOU like&love to play with, and shared it.

    But since you are literally. Here goes 1 way of 1 billion.

    https://www.dropbox.com/s/6el1j20sbr0rl ... .capx?dl=0

    I cant test this myself, i dont own a 90tys game pad. At least change the button to something you can remember/use.

  • >

    > Is there a way to do this without drag and drop? Like with cursor for control?

    >

    Yes of course. In fact, all the drag&drop does (and matters) in the example is selecting inv spots and objects.

    Any other way you pick them is fine.

    If by controller, then how to do it -> picked up item, pin on first available slot? Instead of doing it urself?

  • InyTinny more a system. Can just delete the array, and it still works. But at 1 point you need the array to easily store inventory in local storage and recreate inventory from local storage. And then this is the way to go. Every instance variable on 1 place in the array.

    https://www.dropbox.com/s/lofat0vb0xwaf ... .capx?dl=0

    Hehe wow very nice!! ^_^

    Is there a way to do this without drag and drop? Like with cursor for control?

  • > Hey there! ^_^

    > Basically i am currently designing an inventory system and i would like to ask - what is the best way to do it without causing lags? Ie not hiding it on an invisible layer or something, since having 100 items+, always invis on a laywer may cause delay.

    > So what is the best way if not using a new layout for it?

    >

    > Any1 knows or got any examples?

    >

    Using the invisible layer would only cause a short lag when the game loads and should not lag after running.

    For that many items an array system would be a massive headache and those are the only two ways I know to do it. I use a hidden layer for an inventory of about 250 items and it causes a short lag when loading but I just use a message telling the user to wait while I am creating monsters and objects lol!

    Hehe nice!! ^_^

    So basically when inventory is ''off'' you set the layer to invisible and pause it? Then when its ''on'' you pause the game and make the inventory layer visible ?

  • Hey there! ^_^

    Basically i am currently designing an inventory system and i would like to ask - what is the best way to do it without causing lags? Ie not hiding it on an invisible layer or something, since having 100 items+, always invis on a laywer may cause delay.

    So what is the best way if not using a new layout for it?

    Any1 knows or got any examples?

  • Hello again Greaver, you're welcome.

    [quote:1oi9utfp]1. Browser thing, is this necessary for it to work? And what does it do? Cant figure it out.

    The Browser object can be very useful, in this case, to help debug your script with log messages. You can see this messages by displaying the console message of your browser (in my case I press CTRL+Shift+J on Chrome under Windows to show/hide the console). For more convenience you can also use a function to call this Browser object. I suggere for "cleanliness" and performances to disable this log messages when a project is in production.

    [quote:1oi9utfp]2. arr_inventory.At(Self.slotID) - sets the frame to ID to match the item picked up - however what code can we do to also set the animation? Not only frame but animation too?

    I don't have explore anymore your needs but I suppose, in the same way, something like "Set animation" of the Slot sprite to the animation value of the Item sprite ("YourSprite.AnimationName" expression) should do the trick.

    [quote:1oi9utfp]3. Can we store 10 different values? Or is there a limit? Hehe thanks in advance! ^_^

    I'm also currently working on an inventory system, fully stackable and dynamic, whith a hotbar for action shortcuts ("à la Diablo" or Minecraft in much simpler for the moment). I would say that you can store and do whatever you want, it depends on your approach and your vision, but in terms of methodology I think I will be gone on something more agile, but after all it's not essential and depends again on your needs.

    Sorry i dont understand ur animation explanation, anyone else knows how to do this??

  • Hi Greaver,

    In your logic and after the loop in your AddToInv function, just pick the right Slot and set variables with passed values in parameters. Have a look in the modified capx. https://dl.dropboxusercontent.com/u/507 ... ified.capx

    Good luck for the next steps! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Hehe hey, great! Thank you so much!! ^_^

    I have few questions though;

    1. Browser thing, is this necessary for it to work? And what does it do? Cant figure it out.

    2. arr_inventory.At(Self.slotID) - sets the frame to ID to match the item picked up - however what code can we do to also set the animation? Not only frame but animation too?

    3. Can we store 10 different values? Or is there a limit? Hehe thanks in advance! ^_^

  • Hello there! ^_^ (capx included below)

    So i have been studying and following this particular inventory system; https://www.scirra.com/tutorials/583/easy-inventory

    And i have adjusted it to what i need - however i have problem of copying the ID of the ground item (pick up)

    into the inventory (created item). The item that is on the ground will play a random number value of, lets say

    'StrID' and 'VitID'.

    Coptying the item frame from the ground to the inventory was easy and fine, but copying the ID value does not seem to work.

    Anyone knows how to do it, if possible?

    I uploaded a capx here;

    http://www.filedropper.com/testshow

  • Anyone else knows?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please clarify what exactly you want to do. Do you want to copy 3 new items or add an item with 3 properties?

    * Item on ground has;

    HpID:175

    MpID:125

    VitalityID:100

    * - When the item goes from ground to inventory, we want the HP/MP/Vitality ID values to follow

  • Hi, I am doing an inventory system myself currently, displayed as a grid (it works so far) and also did some stuff related to it in the past.

    1) The example in the tutorial has a function for that "AddToInv". From what I understand you pass the ID of the item as parameter 0 when you call the function "AddToInv". Look into the capx of the tutorial for the function call action in event 6.

    2) If you are using the exact same functions as the tutorial you can't just change to the height to 6 to have a 6 by 6 grid as the example uses row 1 on the Y axis to store the number of items of a given ID.

    There are basically two approaches here, both are valid and possible to use, but I believe the first one is a lot easier to manage (and I used it myself):

    A) Always use the X axis to store items and the Y elements for each X axis element as the items properties. So have an array of 36 width with whatever height you need (I do not know what information besides item name you need to store in the array).

    Advantages:

    - very easy to add remove new items from the array, as you can just pop and push, and use "array.width-1" to retrieve the index of the last added (empty) x element, and don't need to do custom functions for it.

    - counting empty space or number of items is easy (equal to array.width).

    Disadvantage:

    - requires a bit of tinkering to have it display as an item grid. Basically you need to map a one dimensional X index to a row/column combination. Not hard, but it is some extra work. But not much as your inventory slots will need a row and column position anyway, regardless if you go with a 2D array or a 3D array.

    B) Do a 3 dimensional array, with x and y being grid position and z-axis elements being item data. IMO this is a lot better for maps or other grid-based structures where you need to check relative position, calculate distance, angle or do any kind of shapes. Personally I use a 3D array for a tilemap.

    Advantages:

    - easier to map to a grid

    Disadvantages:

    - counting empty slots or finding an empty slot is more difficult.

    - you can't just add a new item by pushing a new X level element easily. Well you can, but you are basically creating new slots at the same time. So to use the array effectively, you would need to have logic to find if you have empty slots, where there is an empty slot and if no empty slots are available to push a new array element.

    So how to copy a paremeter if it has more than 1 ID? i cant go X,X,X to copy 3 ID's to the new item

  • Hello there! ^_^

    So i have been learning and following this tutorial - https://www.scirra.com/tutorials/583/easy-inventory

    It is indeed amazing. Only thing i changed was to add number if existing item is in inventory, so if i pick up same item it will take a whole new space. So, i have 2 questions;

    1. I want the item i pick up to copy its ID such as strength/healing etc and add it to the array, how do i do that?

    In the tutorial above i cant find 'space' to copy the ID from the item picked up to the item created in inventory?

    2. I want a 36 slot inventory system, should i use 'Width' only and place them 6 and 6 underneath? Or is it better to use 'height' in some way to add the ones under? And how would that go?

    Thanks in advance ^_^

  • You can set items to global in the properties to have them keep their values when navigating between layouts. Is it a very basic inventory though because usually you would make one with an array and send the data to game rather than make one that is 100% graphics based. You are implying that you are going to start hiding inventory stuff that you're not using. With an array you can create slots and send the item data to game and display the graphics you want without the need to hide anything, although I don't know what your game is so this might not be relevant.

    RPG games - it does look like they use a different layer for a full screen inventory - but this resets monsters on other layouts.

    Maybe somehow with an array, but with many slots, this may become a bit hard haha xD

    • Can a zelda type inventory be array?