Hello, trying to refresh on how to iterate/set multidimensional arrays, and there used to be a good documentation article on arrays that had this included. Now this is the only page i can find:
It also mentions nested for loops. We will usually need a nested for loop to go through a multidimensional array. I definitely was exploring using a 2D array at some point so if this helps any, I saw this video tutorial before about that: https://youtu.be/0-nbwvJCPq0?si=TtDo7NLqdhF062H0&t=1170
Yeah that’s a great video, his videos how I learned Verse. Hope they can add the documentation back! Right now I been using Claude to troubleshoot but Verse is a tough language for AI to get right haha
For sure! If you need any help with thinking through a problem with arrays, maybe I can help!
I was going to use a 2D array for one of my stages in my map to randomly select a part of the stage to sink into some water, but it turns out I didn’t really need that setup. All I needed was to put all the stage tiles into just one array and shuffle that to get a random order of the tiles.
I finally figured it out, I was spawning traffic props for a traffic simulation and wanted a 2D array so I could know what lane the car was in without storing more than the creative prop. Something I learned is that you can’t set the 2D array without first initializing each row with an empty array.