-
Inventory?
Hello, I've tried to create a pretty simple inventory, but I can't find a way to do it. First of all, you should be able to buy and sell the inventory slots. Then, from another frame, you should be able to buy some stuff into the inventory, of course. The stuff from the inventory could also be sold again. And, I should be able to save all the obbjects/slots in the inventory, and load them again when I restart the app. Suggestions?
-
Re: Inventory?
You could use an array... make it global... and then everytime you put something in it... you assign a unique code to that array...
And everytime the frame starts, you check for the values in that array and show the objects you want...
Did I explain myself??
-
Re: Inventory?
Wouldn't you need a ini file?
-
Re: Inventory?
INI, XML, array, list, anything.
-
Re: Inventory?
you should use an array wich would be like this:
x=1 obj type X=2 number of obj
Y=1 PP7 munitions 8
y=2 M41 munitions 35
y=3 etc... etc...
then you use fast loops and you make an algorithm that find if a place is empty and put an object in the right Y axis
(sorry if you don't undertsand me but i'm not english so that's not realy easy to explain that kind of stuff ^^, anyway I use that on a RPG I'm creating so it does work)