How do I place an array

Hey does anyone one know how to place an array for verse into a map the tutorial is too outdated to work anymore please and thank you for your time

Maybe I’m just still a little too new to verse, but as someone who has been coding in UE for a few years, I’m not really sure what you mean.

An array is a way of storing/organising data. For example you could have a number array that expects the int data type. Then your array would be full of numbers; like this - ArrayOfNumbers (1, 2, 3, 4, … , 9, 10, 11). Another example similar to what I think your asking might be an array of objects. So you could have an array that stores different types of boxes; ArrayOfBoxes (Box1, Box2, Box3, Box4, Box5) – [side note the box is just an example, you could store NPCs, landscapes, buildings, whatever. The point is an array stores multiple slightly different instances of the same data type. You can even store arrays within an array].

Now to place/spawn what is in an array, I am still figuring that out myself. Verse code seems like a ridiculous, unnecessarily complicated language system to me as someone who is familiar with c++. But what do I know. But if you wanted to spawn something from an array, you would write a function that spawns the type of thing in your array and then you would access the thing in the array by calling its position in the array.

So if we use the box example and you want to spawn the 3rd box stored in your ArrayOfBoxes, you would write a function that expects you to give it the boxes data type when it’s called and can spawn a box, and you would access that specific box by using ArrayOfBoxes[2] (the first position of an array is position 0, thats why we use 2 to get our 3rd box). So that might look something like this:

SpawnABoxFunction(ArrayofBoxes[4], SpawnLocation)

If you want to spawn all the boxes in the array you could just call the function as many times as you need and change the number in the array index slot, but thats hard coding and not recommended. I would look into “for loops” if you need to repeat the some action multiple times.

Anyway, I know this doesn’t exactly answer your question but I got the impression you didn’t really fully understand what an array is/does. So this is more of a mental guide you can use going forward. If you already knew this well then I’m sorry, I can’t help. But I know when I was starting out, a lot of forum responses are not super beginner friendly and I didn’t want to reply with something that was going to go completely over your head. :slight_smile: