Organising nested maps/Structs

Hey,

Anyone got any ideas why this won’t load?

I’ve spent quite a few hours staring at it, Occasionally I fix something, but it never seems to work.

It seems to function without errors. I’ve tried going through and toggling breakpoint, but It’s just not giving me any information.
Ive never tried to save structs before let alone nested ones.

https://www.youtube.com/watch?v=7gfA-QO5pA8&t=2129s

This is the save system I use. I mostly understand it all and have had good success with this style.
Probably a bit overkill. But I always rather a be overkill than under

A few additional questions I have about structs and saving them?

1. When you nest like this, Does all the infomation save into one struct?
So the final struct in the nest holds everything and youd Just save and load that one struct?
Or does every struct need to be saved?

Update:
Turns out its nothing to do with nested loops. I couldnt even save a basic int.

nested structs are fine as long as its something that can be saved, ie objects cant be saved

other than that i cant follow your code, can you be clearer what you mean by wont load?

also i dont see any structs, i see maps possibly with structs in them but where do you set the structs?

finally is it intended to have loops within loops within loops and not run on completed?

1 Like

That’s interesting. I didn’t know that.

I think I’m just trying to get my saving and loading practises better. I think in my haste to learn a better system, I may have stepped into terrain I don’t fully understand, And debugging it let alone asking someone else too is going to be a nightmare.

I’m going to go back to looking into how saving and loading works.
The link above is the system I’m practising, but tbh…I don’t fully know if it’s even the best practise.

If you have any links to good tutorials for good system Itd love to delve into it.

probably better to ask, what are you trying to save? and work up from there

1 Like

I’ve spent a while and figured that I think I’m overcomplicating my save system massively. It’s menu based, And essentially is “one level” for its life. It won’t need instances and a lot of flash.
It just needs to save and overwrite on a back button.
I’ve got it to work well and functions exactly as needed. I guess I was trying to put a nail in with a sledge hammer.

So I’m back to my original issue of nesting maps/structs.

I have 15 separate data tables feeding 15 maps in structs.


(I tried putting them into arrays etc but Just couldnt seem to cut it down. This is as small As I could get it)

This creates all the data and puts it into a place You can adjust and save on runtime.
This is run only once when the save is created.

Afterwards you’ll use the created maps during the save’s life.

Now the hard bit

Esentially Its a bit of a brain teaser and I just cant see the answer.

As you progress through the menu, you pick up prefixes. when you reach the end you get the map/struct. Related to the prefixes collected.

And then searching for it looks something like this.

This is how Im currently nesting and its a bit…well not good. So I think I just need help understanding how to be organised with my nesting.

i feel like your confusing maps and structs… all of this should be in one struct. i dont even think you need a map.

I cant even read that :sweat_smile: but lets assume your trying to save a difficulty, that difficulty is one struct with all the options in it. then you have one datatable with all the different difficulties.

1 Like

xD Yeah, thinking about it, I’m using the term map as It’s a key and value, but I guess the struct is using key and values or whatever I want, so There isn’t a map. ahhh gud darn.

I managed to fix it just now. Turns out I’m considerably more stupid than I thought xD

I’d accidentally put a blank member into a few of the structs by accident when I was playing around with them. So when I was trying to retrieve information, I was getting a lot of blanks or false branch throws.

Lol unreal knows how to keep me humble I guess.

Thanks for your help and letting me think through the problem.

1 Like

nothing wrong with learning, good luck with your project

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.