I'm trying to create a randomized dungeon.
-
@pianofire. Yeah no I did do the tutorials, but thanks anyways, I appreciate just the attempt.
-
@SteveZX81 Thanks! I don’t really do discords and stuff though. :)
-
Share your code, you should be able to do it with an array, something must be going wrong somewhere...
-
@OrangePeel I would assume that is necessary - particularly, because you might want to compare the values of different tiles (for example, you might not want to have a group of four items right next to each other)
And if you use an array, it should be managable (using for-loops) -
If u want use the same random(number) just put in the loop instead of making 100 variables out of it in the loop the number will be always changing i hope this helps :)
-
@CasualTie5 thanks. I’ll go do that now.
-
@landein207 I tried that, but because it was all the same variable in the end of the loop it ended up being the same still.
-
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 -