(Example) Zelda Style Inventory

  • I whipped up a Zelda style inventory that is nearly functional, including cursor moving, preventing the cursor from scrolling off grid, item quantities (for bombs, arrows, etc), removing/adding items, setting an item to the active slot (and storing it's name in a text instance variable, in order to decide 'check for x' for events) and after a few hours of debugging, it's nearly bugfree. Though, let me know if you find another bug when you play around with the capx, or if there's any part of my capx I could optimize or improve.

    https://dl.dropboxusercontent.com/u/589 ... ntory.capx

  • Bump! Made a major overhaul to the inventory demo capx and reuploaded it:

    *Majorly cleaned up events. No more events setting "Bow", "Bomb", etc animations anymore, slots now have itemIDs, which you can set per inventory slot to specify where each item goes as long as the itemID instance variable matches the animation number. Animations are now named ix (i1, i2, i3, etc) and despite still being repeat events setting a single frame animation (attempting to set a function call for it will just cause all of the slots with unique itemID instance variables to be obtained all at once), it's now dynamic and is:

    "i" &spr_invSlot.itemID

    *Disabled the remove item events. Feel free to reenable them but you generally don't "lose" items in a Zelda game, so I figured besides the rare case, it's unneeded and can be deleted.

    *Added full array support using a json file requested and loaded to an array (a 3d one), the game sets a boolean to true (x,2,0) when a new item is obtained, and sets a text value to x on x,y,z (on 56,0,0, where there is 15 empty slots for expansion if desired) for the active item slot, such as "Bow" or "Lamp", the key for the 3d array is as follows:

    Name,defense,damage,usagetag(describes the item's special function if any),hasbeenobtained(a boolean),placeholder(use the last value for whatever you want)

    Some examples below:

    Lamp,null,null,light,false,null

    Clothing,null,null,null,true,null

    Shield,1def,null,block,false,null

    Firerod,null,2dmg,spawnplatfrom,false,null

    Some of these itemdata rows are dynamic (such as Clothing or Shield), so set the x,1,1 to to a string or number, such as 2(to represent obtained tier two sword) or mirrorshield

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, this is nifty! Thanks for the upload!

  • Thank you, no problem! I figured there wasn't enough inventory systems like this, so it was worth sharing.

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