Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    I'm trying to create a randomized dungeon.

    Beginners
    9
    26
    1642
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • OrangePeel
      OrangePeel last edited by

      Okay, thanks! I will go try that now!

      pianofire 1 Reply Last reply Reply Quote 1
      • pianofire
        pianofire Fuze Team @OrangePeel last edited by

        @OrangePeel Just some general advice. Don't try to run before you can walk. At least work through the tutorials first before diving right in (apologies if you have already done so)

        OrangePeel 1 Reply Last reply Reply Quote 3
        • SteveZX81
          SteveZX81 F last edited by

          Welcome @OrangePeel I wish you luck with your game because I like games like that. For the record Fuze has a superb and incredibly friendly discord server if you're interested. (I think the white icon at the top is the link)

          OrangePeel 1 Reply Last reply Reply Quote 3
          • OrangePeel
            OrangePeel last edited by

            @CasualTie5 recommended I use a grid like in the level tutorial, and I’ve been working on something like that on and off, however I created a single variable, rng, which I set to a random of five different tiles for the ground, but now whenever it rolls that randomly it sets it to just whatever it rolled first, so all the ground will be bare, or chests, or spawn enemies. I attempted to stick it all into a loop, however this caused it to do the same thing, but it would just random roll it multiple times and they would all still be the same. I just wanted to ask here if there was any way to do it besides making separate variables for every single space on the map. Does anyone have any solution other than that? I will be willing to do anything lower maintenance than making 100s of separate variables.

            CasualTie5 1 Reply Last reply Reply Quote 1
            • OrangePeel
              OrangePeel @pianofire last edited by

              @pianofire. Yeah no I did do the tutorials, but thanks anyways, I appreciate just the attempt.

              1 Reply Last reply Reply Quote 0
              • OrangePeel
                OrangePeel @SteveZX81 last edited by

                @SteveZX81 Thanks! I don’t really do discords and stuff though. :)

                1 Reply Last reply Reply Quote 1
                • PickleCatStars
                  PickleCatStars F last edited by

                  Share your code, you should be able to do it with an array, something must be going wrong somewhere...

                  1 Reply Last reply Reply Quote 0
                  • CasualTie5
                    CasualTie5 F @OrangePeel last edited by CasualTie5

                    @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)

                    OrangePeel 1 Reply Last reply Reply Quote 0
                    • landein207
                      landein207 last edited by

                      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 :)

                      OrangePeel 1 Reply Last reply Reply Quote 0
                      • OrangePeel
                        OrangePeel @CasualTie5 last edited by

                        @CasualTie5 thanks. I’ll go do that now.

                        1 Reply Last reply Reply Quote 0
                        • OrangePeel
                          OrangePeel @landein207 last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • PickleCatStars
                            PickleCatStars F last edited by

                            Post a screenshot of the bit that’s giving you trouble :)

                            1 Reply Last reply Reply Quote 0
                            • DomDom
                              DomDom F last edited by DomDom

                              This post is deleted!
                              xevdev 1 Reply Last reply Reply Quote 1
                              • DomDom
                                DomDom F last edited by

                                This post is deleted!
                                OrangePeel 1 Reply Last reply Reply Quote 1
                                • OrangePeel
                                  OrangePeel @DomDom last edited by

                                  @DomDom Okay, I'll try it.

                                  1 Reply Last reply Reply Quote 0
                                  • xevdev
                                    xevdev F @DomDom last edited by

                                    @DomDom surely 6 or greater

                                    DomDom 1 Reply Last reply Reply Quote 0
                                    • DomDom
                                      DomDom F @xevdev last edited by

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • xevdev
                                        xevdev F last edited by

                                        No thanks kept clear of sprites and the map. But I believe you.

                                        1 Reply Last reply Reply Quote 1
                                        • Martin
                                          Martin Fuze Team last edited by Martin

                                          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

                                          OrangePeel 1 Reply Last reply Reply Quote 3
                                          • OrangePeel
                                            OrangePeel @Martin last edited by

                                            @Martin Alrighty, thanks! :)

                                            1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post