Loading a Map Variable from a Save Game returns Unknown class

Hi, I am trying to save a data map variable and reload it so I can generate a hex map. I generate the map first, the map infomation is added to a data map structure, with a custom struct as the key (Containing 2 integers, the x and y coordinates) and a blueprint object as the object with stores information about that tile such as if its water or ground. This data map is then used to generate the visual map. Now I have created a custom save game blueprint to store this data map so that the map can be reloaded.

The issues is that when I load the save game, and get the data map from it, it shows “unknown class”. So I can’t search the map anymore. It contains the right amount of objects. I’m not entirely sure why its doing this, on the save game the object has the same type as before, it just doesnt know the blueprint class type when its loaded back? I am also saving two integers for the x and y size of the map and these load fine. Is this a bug? or am I doing something wrong?

Saved values:

Loaded values:

Data Object failing to load:

I’d try a few things

  1. Use print to debug, not the debugger

  2. Remove the save game file and try again

  3. Try a separate experiment project, to make sure you can read/write the structure successfully.

It’s hard to save much more with this small amount of info :slight_smile:

Hey, thanks for the reply.

  1. Sorry, I’m not entirely sure why printing to debug would be better here? whats wrong with using the debugger?
  2. I am deleting the save file and creating a new one currently, it always has the same result of not recognising the map value class even though it is defined in the save blueprint object.
  3. This seems to happen to happen with any custom blueprint I’ve made, in a seperate project and only attempting to save the blueprint stored in the map (HexData) as a single variable, the struct that is the key (struct_coords) saves fine on its own though.

It’s very unreliable as showing values.

Oh, class instances can’t be saved, only class references. That makes sense now.

1 Like

Correct :slight_smile:

1 Like

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