Inventory system, copy ID

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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">

  • 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 again Greaver, you're welcome.

    [quote:2jji9lkl]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:2jji9lkl]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:2jji9lkl]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.

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

  • However all is said!

    Do you take the time to read the doc or do some research?

    To change the animation, it's simple:

    "Add action" for your Slot sprite at the same level of the previous change.

    Choose "Set animation" and put the name of your animation in the value field.

    You can pass it again by a parameter in your function, it depends on how you want to do it.

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