In an RPG game...
I think I need a little help getting my head around the dimensions and structure for an array of types.
I wish to use an Array because I need to represent an inventory listing (of an amount of inventory 'Spaces') capable of holding an indefinite number of items. These inventories need to be linked to each Character (again, possibly an indefinite number of characters will need inventories), and also, some items (i.e. bags) will have smaller inventories of their own.
Hope this is understandable, it does gert confusing, I know.
I've not used Arrays mixed with Types before, so I'm not 100% on the syntax and stuff, hopefully by implementing Arrays it will make things much easier, more efficient and cleaner-looking. From my ideas so far (without arrays), here's some thoughts:
Note that I need to cross reference the "Inventory" field along with Slot_Reference numbers in the last Type where the actual contents of slots arew to be found. I think that eventually, because there will be approximately 10 000 different items, this will get quite slowed down, although the inventories will only need to be iterated through when the inventory screen is opened or an object is picked up/dropped/equipped/unequipped etc.
Please can someone help me to make this more efficient?
I think I need a little help getting my head around the dimensions and structure for an array of types.
I wish to use an Array because I need to represent an inventory listing (of an amount of inventory 'Spaces') capable of holding an indefinite number of items. These inventories need to be linked to each Character (again, possibly an indefinite number of characters will need inventories), and also, some items (i.e. bags) will have smaller inventories of their own.
Hope this is understandable, it does gert confusing, I know.
I've not used Arrays mixed with Types before, so I'm not 100% on the syntax and stuff, hopefully by implementing Arrays it will make things much easier, more efficient and cleaner-looking. From my ideas so far (without arrays), here's some thoughts:
Type Character Field Char_name$ Field Char_Inventory_Ref EndType Type Inventory Field Inven_Reference Field Number_of_Slots Field Has_Inven End Type Type InvenSlots Field Inven_Ref Field Slot_Reference Field Item_Reference End Type
Note that I need to cross reference the "Inventory" field along with Slot_Reference numbers in the last Type where the actual contents of slots arew to be found. I think that eventually, because there will be approximately 10 000 different items, this will get quite slowed down, although the inventories will only need to be iterated through when the inventory screen is opened or an object is picked up/dropped/equipped/unequipped etc.
Please can someone help me to make this more efficient?