Page 1 of 1

Multiple Array Support

PostPosted: Fri Jun 05, 2009 11:32 pm
by Bee-Ant
As we know, GE only uses 1D array that can be saved in group. I would like be able to save 2D and 3D array as well.

Also, please fix the array handler. It gets problem when handling high array. I encounter the problem when trying to read 50x50 array from external file.
The middle row shifted.

I would like also be able to change animation through animindex.

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 3:56 am
by BeyondtheTech
speaking very generally, how about flattening out a two-dimensional array to something like this?

Code: Select all
i=0;
for (y=0;y<10;y++)
{
   for (x=0;x<10;x++)
      {
         matrix[y*10+x]=i;
         i++;
      }
}


I use this as it's probably better on memory consumption, too.

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 7:41 am
by Fuzzy
It is far easier to load a 1D array from file. A little math will make it seem like a 2D array.

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 8:00 am
by Bee-Ant
BeyondtheTech wrote:speaking very generally, how about flattening out a two-dimensional array to something like this?
Code: Select all
i=0;
for (y=0;y<10;y++)
{
   for (x=0;x<10;x++)
      {
         matrix[y*10+x]=i;
         i++;
      }
}

I use this as it's probably better on memory consumption, too.

I know this...but all I want is to save the array in a group.
OK, I can store that array in a file, but I want it saved in group...
Fuzzy wrote:It is far easier to load a 1D array from file. A little math will make it seem like a 2D array.

Do you have example to prove it?

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 8:42 am
by Fuzzy
Beyondthetech just showed you how.

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 8:54 am
by Bee-Ant
Oh...just change the 10 to make another size huh?

Re: Multiple Array Support

PostPosted: Sat Jun 06, 2009 9:35 am
by Kalladdolf
And a very good idea, too!

Re: Multiple Array Support

PostPosted: Tue Jun 09, 2009 3:39 am
by Bee-Ant
Whats the limit of the array anyway?
And whats the limit of the variable?

Re: Multiple Array Support

PostPosted: Tue Jun 09, 2009 12:23 pm
by makslane
I need to look he code, but I think the array index limit is the size of int C type (up to 2,147,483,647)
I canĀ“t remember the limits for array dimension or number of itens but is a huge number.

Re: Multiple Array Support

PostPosted: Tue Jun 09, 2009 12:37 pm
by Bee-Ant
Oh, but in variable bar, it seems about 999...