@tarkus - no problem there. I've written a save system so inventory/player stats/time etc. can go multi-level.
On your multi-dimensional arrays, they can be done (but they are a pain). A method I am using is to index the item in name properties. I then use that index, pick up a string from a hard coded lookup list for display in my inventory . I only parse the string to get the values when user looks at the inventory, ie: I don't keep the values or the entities, just the string. The only data I ever "carry" is the string for the items the user has (multiples of same thing is simply incremented). The entity is killed off and forgotten about at pickup. I simply eat/drink/use the "string" (which is removed on use).
This has the advantage of leaving me with a single location to edit any item properties (balancing for example) in one place regardless of the number of items or type of items placed on any given map.
entity.name = 1 or 2 etc...
eg:
if itemIDX == 1 then return "DRINK,Bottle of Water,10,1,800,0,1,1,0,1,2"
elseif itemIDX == 2 return "FOOD,Bush Berries,5,6,100,1,3,2,2,4,1"
etc.....
Every bottle of water on a map is simply named "1". The string contains weight, value etc.. etc... I add a timestamp to the string after pickup so I can deteriorate any contents.
(And I just save the string when I jump levels and the exact same parser/method applies)
@others
That's a better idea. I see what smallg has done with the mines. Unfortunately I can't carry the "e" because when I jump levels the "e" is worthless.
I've since settled on a stored list of items on each map ("e" picked up on level load) and bring the item to my position when needed. As long as I keep the "cache" out of range it shouldn't have any significant resource hit. In addition, when I load the save, I'll query what I have and only "tag" the cached entities that may be dropped in the new level and destroy any that *can't* be used.
ie: If there are "chips" in level 1 and I take 1 packet to level 2 and level 2 has no chips, I have stored "chips" (equal to maximum chips in level 1) to access (eg: 10) . Since I only have 1 packet, I pick up the "e" of 10 packets and destroy 9.
Can't think of a tighter way at the moment. Be so much better if we could just dynamically load entities....
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD