I'm trying to create a randomized dungeon.
-
Post a screenshot of the bit that’s giving you trouble :)
-
This post is deleted! -
This post is deleted! -
@DomDom Okay, I'll try it.
-
@DomDom surely 6 or greater
-
This post is deleted! -
No thanks kept clear of sprites and the map. But I believe you.
-
This is indeed a bug in the current (live) implementation of multi-deminsional arrays. The 2nd dimension (presumably 3rd+ too) will inherit the size of the first. I remember raising this issue previously.
I just checked and it is already fixed in the upcoming 2.15.0 release. So in 2.15.0 the sample will work as you expect.
It's a bit dirty, but as a workaround for now use this:
int MAX_COL = 26 int MAX_ROW = 6 array level[MAX_COL][MAX_COL] for row = 0 to MAX_ROW loop for col = 0 to MAX_COL loop // or len(level[0]) will work too here level[row][col] = random(5) repeat repeat
This is of course wasteful because it defines a 26 x 26 array, but at least it works
-
@Martin Alrighty, thanks! :)
-
So
I've been creating arrays
Array whatever [ 1 ]
And just increasing multi dimensional arrays and it seems to work.
If that makes sense. -
No, what do you mean?
-
@xevdev do you mean creating new elements of an array, even if they exceed the declared array length?
if yes, I'm pretty sure it is indeed an intended way of using arrays in FUZE -