Now I know this is possible to do using a function and a kind of wrapper for an array which transposes values into appropriate indices but i think having hard coded arrays that can be defined just as Array[100,100] would be a logical addition to the language.
Thoughts?
Yeah, this would be really useful for me for programming the tile engine I'm coding at the moment, (I'm currently using the 'wrapper' function you mentioned), although I'm not entirely sure what applications this would have in adventure games.
I mean, if CJ's up for it, high fives all round, but he can only really be expected to add features which predominantly affect the genre AGS was designed for.
MD arrays can be used for loads of things from a mathematical point of view.
The most obvious application i can think of is cartesian coordinates which are used all the time in graphics algorithms.
Just FYI, you can already "trick" the engine into supporting two dimensional arrays of types like int:
// header
struct str_x {
int y[100];
};
// script
str_x x[100];
// now one can do:
x[40].y[20] = 3;
Of course it still isn't possible to do stuff like x[40].y[20].tile = 1;
I'd find inbuilt support for multi-dimensional (or at least 2d) arrays really useful... but I'm trying to make non-adventure games with AGS. I can't think of much use for them in your average adventure game, but if there's enough support maybe CJ will make it a higher priority.
Quote from: OneDollar on Sat 24/10/2009 12:30:17
if there's enough support maybe CJ will make it a higher priority.
Woot for e-Petitions! ;D
I mean granted limited adventure game use with this feature, non-adventure games are not that uncommon, and it will just add to AGS's already quite prominent versatility.
I've also been using AGS to work on various (unfinished) non-adventure games, but the main relevant reason I can come up with is that when trying to transcribe non-AGS code modules, which are plenty to be found, that quite often they require multi-dimensional arrays, and they always assume that they are available.
Funny, I was just wishing today that ags had two-dimensional arrays. Again, though, it was for a non-adventure project. I don't think I'd ever use them in an AG, but obviously there are plenty of crazy folk who love to use AGS for purposes unintended. :)
This has been discussed before. Maybe the LUA Plugin might be a good stand in?
Quote
I've also been using AGS to work on various (unfinished) non-adventure games, but the main relevant reason I can come up with is that when trying to transcribe non-AGS code modules, which are plenty to be found, that quite often they require multi-dimensional arrays, and they always assume that they are available.
This probably the best reason I've seen for implementing multi-dimensional arrays. Otherwise the work-arounds work just fine. Personally I would rather have improved support for stucts, struct in struct, struct and function pointers.
As structs are about the most useful thing in the whole scripting language, I'd second that! :)
This is probably the third most requested addition to AGS and it's been discussed over and over again. Yeah, there are work-arounds, yeah it would be great to have native support. I just wish people would limit their suggestions and ideas to a single collective thread (which they gloss over to make sure it hasn't already been suggested). Threads like this (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36284.220) streamline the process and give CJ one place to look to see all the current popular suggestions instead of having to jump around and look at repetitive posts.