How would you store multiple arrays, and be able to call a specific array from that list?

Here’s what I’m trying to do.

I want to have 1 array per level in a savegame that stores the players location every so often to essentially create a ghost to race against. The problem I’m running into is how to store multiple arrays AND be able to call/modify a specific one depending on the level.

So far it seems structs are my best option for this, but they don’t have a simple way to get a specific index within the struct.

What are my options or how would you tackle this?

Hey @TheFrostHound!

So the problem is that unlike many systems, Blueprint does not allow nesting arrays, strangely. Nesting arrays would definitely be the solution here, typically, but we’re going to have to be a little creative in the execution here.

One thing you could do is just separate them out within the savegame using categories, naming them appropriately for each level, storing them in the GameInstance and then when you load the level, Set the “Current GhostData” in your level by referencing the GameInstance? Does that make sense?

Manually calling the correct array from my savegame in something like the level blueprint would absolutely work, I was just hoping for a more scalable solution lol.

Being able to place a single blueprint in a level and just switch an integer to pull the proper index from a nested array was what I was originally setting out to do, but as you said you can’t really nest arrays.

Worst case I can make your suggestion work, I was just really hoping to not do that haha

1 Like

Like Mind-Brain said, blueprints does not allow nested arrays in any form.

What I would suggest is using maps.

Like this:

You can use a unique string or integer as an identifier for each coordinate an have some kind of system in place so you know which coordinate to pull.

Just make the map public so it can always be edited and accessed easily (which is default i suppose).

1 Like