nested types (a la rpg inventory system)

Blitz3D Forums/Blitz3D Beginners Area/nested types (a la rpg inventory system)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

hiya. haven't visited the blitz language in a while and trying to dust off the skills.i was trying to write a simple inventory (well, really a shop ) system for a equally simple rpg type game.

i have types set up for various items (potions/swords/armor/etc). something like this:

Type potion
	Field ID%				;id number associated to the potion
	Field name$				;name of the potion
	Field potType%			;type of potion 1=heal,2=buff, etc
	Field value%			;buy/sell value of potion
End Type



then have a type set up for the shop

Type shop
	Field ID%
	Field name$
	Field owner$
	Field potions.potion
	Field armors.armor
	Field swords.sword
	Field sellerGold%
End Type



and here is where my brain is sorta getting fuzzy:

;make a potion
potions.potion=New potion
potions\ID=1234
potions\name="healing elixir"
potions\potType=1
potions\value=20

;make a shop
shops.shop=New shop
shops\ID=4567
shops\name="house of goods"
shops\owner="yo mamma"
....
...
.



pretty much, i'm trying to achieve creating the items and assigning them to the shopkeepers shop. does that make any sense? i suppose the same would be true for a "inventory" system (like what items are being carried on a player, etc. right?

any direction here would be nice,or a codearchive/thread i've missed in my search.

thanks much.

edit: i guess i overlooked this link: http://www.blitzbasic.com/Community/posts.php?topic=41453 i'm guessing this would be the way to do what i'm thinking?