Page 1 of 1

Variables and savable multidimensional arrays

PostPosted: Fri Aug 26, 2005 12:57 am
by BeyondtheTech
I noticed that in the User Variables section that there's a spot to allow a variable to be an array as well as make it part of a group used for the loadVars/saveVars function.

The problem is that I have a 2-dimensional array and the field only allows you to enter one dimension.

Is there a "manual" way to initialize a variable (and array for that matter) and make it part of a group without having to use the User Variables dialog box?

Also, I am redoing a lot of code and found out the hard way that I had to drudge through the User Variables dialog box for every variable I had to make Game Editor recognize. Imagine having to do that 50 times, ugh. Any chance of the compiler automatically detecting non-recognized variables/commands and asking you to add it for you? Or how about an import of a variable list. Both or either would save a lot of time.

PostPosted: Fri Aug 26, 2005 1:18 am
by makslane
You can use "fake" multidimensional arrays.

Your multidimensional array declaration:
int array[10][5];

Array use:
array[i][j] = .....;

Other solution:
int array[10*5];

And use:
array[i + 10*j] = ...;

PostPosted: Fri Aug 26, 2005 2:08 am
by BeyondtheTech
Somehow, I knew you were going to say that. :wink:

What about automatically adding Variables detected in the script? That would be very cool.

PostPosted: Fri Aug 26, 2005 12:58 pm
by makslane
BeyondtheTech wrote:What about automatically adding Variables detected in the script?


I don't know. Can be dangerous.

PostPosted: Fri Aug 26, 2005 1:06 pm
by BeyondtheTech
Well, not like it would automatically, but just as you check syntax and list out all the lines of code that have issues, you can list out all the undetected keywords and ask to add them in.