Topic:   Inventory System   (Read 38029 times)


0 Members and 1 Guest are viewing this topic.

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Inventory System
« on: June 10, 2008, 07:44:10 PM »
I am currently working on a inventory system that will be able to support thousands of different items and it includes magical items. (example: Sword of never missing + 99 on chance to hit) I would like your input about this system and maybe include some magical items.
Possible bonuses include: (on weapons) Extra Damage, Bonus Chance to hit,
(on all items) Bonus stat points (strength, dexterity, constitution, intelligence, wisdom, charisma)
(on armor) bonus armor and return damage
Oh and don't forget to include a reasonable sell value for your magical items.

P.S. There is a very good chance I will use this inventory system on my next game after labyrinth.
« Last Edit: June 10, 2008, 08:00:49 PM by Tireas_Dragon »
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Inventory System
« Reply #1 on: June 11, 2008, 10:20:12 AM »
what do you mean by support thousands of items? then you list a bunch of stats that are irrelivant to an inventory system, tell us whats different compared to this:

let potion=potion+1

print "potion: "+str$potion

if potion>1 then
let potion=potion-1
let hp=hp+50
print "potion: "+str$potion
end if

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #2 on: June 11, 2008, 02:43:46 PM »
I mean thousands of different items and the things are possible bonuses for magical items.
heres a link but no magic items are in it yet. http://www.mediafire.com/?ns2m20flw3w
« Last Edit: June 11, 2008, 02:48:55 PM by Tireas_Dragon »
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Inventory System
« Reply #3 on: June 11, 2008, 04:10:06 PM »
I like the way it sorts out each item's number so that if an earlier item is dropped the ones after it move down. That's clever. :)
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #4 on: June 11, 2008, 04:16:30 PM »
With this system I can make an almost infinite number of different items. I can make an item that is plus 6 to your strength and intelligence.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Inventory System
« Reply #5 on: June 11, 2008, 04:50:41 PM »
I don't really understand how that's different to other systems though. I mean, the inventory system I've always used is really simple, yet it can handle unlimited items with extra properties as well. QoM's code is kinda like this:
Code: [Select]
IF playerweapon$ = "Rusty Dagger" THEN
 Â playerWC = playerWC + 10
 Â playerhit = playerhit + 3
END IF

IF playerweapon$ = "Battle Axe" THEN
 Â playerWC = playerWC + 20
 Â playerhit = playerhit + 5
END IF

IF playerweapon$ = "Long Sword" THEN
 Â playerWC = playerWC + 35
 Â playerhit = playerhit + 8
END IF
So if you wanted an item to raise an attribute, you'd simply slip in the extra line of code:
Code: [Select]
IF playerweapon$ = "Rapier of Quickness" THEN
 Â playerWC = playerWC + 40
 Â playerhit = playerhit + 3
 Â STATdexterity = STATdexterity + 4
END IF

IF playerarmor$ = "Cloak of Endurance" THEN
 Â playerAC = playerAC + 25
 Â playerdef = playerdef + 6
 Â STATendurance = STATendurance + 3
END IF
Simple yet effective. Any property you want an item to have is easily implemented. Is your code very different to that?
« Last Edit: June 11, 2008, 04:59:06 PM by Silverwind »
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #6 on: June 11, 2008, 05:04:08 PM »
My code inserts all those bonuses with 1 line of code.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Inventory System
« Reply #7 on: June 11, 2008, 05:23:24 PM »
Wow! Now that is impressive! :D Can't wait to see it. Here's a simple inventory I just came up with that stores item properties in arrays.

This is how to set the properties of weapons and armors. The first parameter in the array is the item's name, the second parameter is the Attack plus it gives in combat, and the third parameter is the Defence plus it gives in combat.
Code: [Select]
Weapon1Stats$ = "RustyDagger 10 0"
Weapon2Stats$ = "BattleAxe 14 0"
Weapon3Stats$ = "LongSword 20 0"

Armor1Stats$ = "LeatherVest 0 8"
Armor2Stats$ = "ChainMail 0 12"
Armor3Stats$ = "SpikedCuiras 3 17"

How to set the player's weapon/armor properties to that of another item: (in other words, how to equip an item)
Code: [Select]
PlayerWeaponStats$ = Weapon1Stats$
PlayerArmorStats$ = Armor1Stats$

How to reference the properties of an item:
Code: [Select]
PlayerWeaponName$ = WORD$ PlayerWeaponStats$ 1
PlayerArmorName$ = WORD$ PlayerArmorStats$ 1

WeaponAttackPlus$ = WORD$ PlayerWeaponStats$ 2
ArmorAttackPlus$ = WORD$ PlayerArmorStats$ 2
WeaponAttackPlus = VAL WeaponAttackPlus$
ArmorAttackPlus = VAL ArmorAttackPlus$
WeaponDefencePlus$ = WORD$ PlayerWeaponStats$ 3
ArmorDefencePlus$ = WORD$ PlayerArmorStats$ 3
WeaponDefencePlus = VAL WeaponDefencePlus$
ArmorDefencePlus = VAL ArmorDefencePlus$

Attack = Attack + WeaponAttackPlus
Attack = Attack + ArmorAttackPlus
Defence = Defence + WeaponDefencePlus
Defence = Defence + ArmorDefencePlus

It's fairly straight forward. You shouldn't have to edit any of the code to use it, so you don't even have to understand it. All you have to do is set the values of "Weapon1Stats" "Weapon2Stats" and so on. If you do understand it however, you could add extra parameters such as attribute bonuses or durability. Or even the item's sell price. :) It's easy to mod.
« Last Edit: June 11, 2008, 05:28:08 PM by Silverwind »
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #8 on: June 11, 2008, 05:29:16 PM »
That works pretty similar to mine, but mine I have done a lot to so I can implement magic properties.

EDIT: Wow I should of thought of the word idea. I'll insert it right away.
« Last Edit: June 11, 2008, 05:38:18 PM by Tireas_Dragon »
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Inventory System
« Reply #9 on: June 11, 2008, 05:37:47 PM »
Cool. As I mentioned above, you could always add more parameters to the arrays in this system in order to add magical bonuses.

How are you managing to keep it down to a single line when you reference an item's properties though? That's what's really amazing.
« Last Edit: June 11, 2008, 05:38:15 PM by Silverwind »
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #10 on: June 11, 2008, 05:38:53 PM »
Not for referencing just for declaring.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Inventory System
« Reply #11 on: June 11, 2008, 05:45:15 PM »
Oh. I was thinking you'd discovered a Godly command Al hadn't told us about or something, lol! (DOMENU READMIND ;D )
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #12 on: June 11, 2008, 05:49:16 PM »
LOL I didn't realize I was leading you to believe I was some sort of GM God who can do practically anything with a line of code.

I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #13 on: June 12, 2008, 11:51:25 AM »
Alright here it is with magic items included, and two-handed weapons.

http://www.mediafire.com/?m4qobs1m2ig

P.S. I named some of the armor after the people here on the GMG I hope no-one minds.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Inventory System
« Reply #14 on: June 13, 2008, 03:17:40 PM »
I looked at the number of downloads of the inventory system its 0 why hasn't anybody taken a look at the fixed system?

I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.