I need help making a menu that lists what you have in your inventory, the list changing when items are added and removed from it. I also need a menu for techs, and figured that it could be done the same way as an item menu.
A really simple way would be to always list every possible item you can have and just make it show 0 if you have none of them.
Much more simple than having to remove items and rearrange the order if an item disappears.
for a 1 dimensional array, if you didnt want to use String Parser, you'd have to store different bits of information in a large number, but it can't have a preceding 0, so basically you'd have 1, then the information.
Say each bit of information had a range between 1 and 999, and you wanted to store the item id and item quantity
you'd have (1001999,1002001,1003015)
Then you'd have to seperate these using the left$ or right$ mid$ functions.
This would give:
item 1, quantity 999
item 2, quantity 1
item 3, quantity 15
in the inventory list, where obviously you'd have some system to replace item id with it's name.
There are other ways, but I find a 3 dimensional array the easiest way.
Edited by the Author.
My signature is never too big!!!
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
23rd June, 2007 at 16:49:49 -
Okay I was thinking of a much easier way but I guess if you want really long numbers you can do that.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
if you still need help, Radix made me an awsome example of this a while back, a quick search should bring it up, it included, item stacking, drag and drop and allowed you to delete and arrange the items. Its worth a look even if you can do it yourself as it was a really good inventory system.