(Example) Zelda Style Inventory

Get help using Construct 2

Post » Thu Feb 25, 2016 10:05 pm

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
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651

Post » Fri Feb 26, 2016 3:32 pm

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
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651

Post » Fri Feb 26, 2016 10:18 pm

Hey, this is nifty! Thanks for the upload!
B
71
S
41
G
24
Posts: 356
Reputation: 18,464

Post » Sat Feb 27, 2016 6:45 am

Thank you, no problem! I figured there wasn't enough inventory systems like this, so it was worth sharing.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651


Return to How do I....?

Who is online

Users browsing this forum: max2612, R0J0hound, spiralmc and 28 guests