Hi my friends ,
I am working with my game and I would like to make huge changes in my code.
I have ready made function for my items on the floor , but my current version of my items function are limited , I can drop only 50 items in each subsquare of my game 200 items in each square.
I am studying about Matrix1 Utilities arrays plugin.
I would like to ask , if is it possible to able to change the size of my array in runtime.
For example I have my array:
Dim Items(10,54,54,4,50) as string
The last dimension of my array is the amount of maximum items I have in my each subsquare.
Items(Levels,Horizontal,Vertical,Subsquare,max_items).
If I want to redim this array or change the size in the runtime (on the fly) is it possible to be happen?
Matrix1 Utilities are possible to do this?
When one of my subsquares will be full of items then , I will increase the capacity by one and if I pickup the item from the floor again, so the size of the array will decreased again and I will release memory. Or I scan all levels with all dropped items and see which square have the most items in , to resize the array in the largest amount of items.
For example if in my whole levels the most full subsquare have 11 items then I redim all array to 11 like:
from
Dim Items(10,54,54,4,50) as string
to
Dim Items(10,54,54,4,11) as string
Technically , I will have infinity ammount of items dropped and I can release and memory.
So I will reserve memory for 11 items only and not for 50 items for my all levels in my whole game.
And in generic if I want to change my level size from 54,54 to 20,30 or if I want to add or remove some level , for example in my level editor , when I create some adventure , I will need to add some one new level in my module , so , I will need to resize my new dimension of my array from 10 levels deep to 15 levels.
Dim Items(15,54,54,4,11) as string
Does all of these are possible?
Thank you...