Casting to Save Game Object failing

I have a script that is supposed to save data from a temporary save game cache to a saved game file. For some reason, I cannot cast to the save game file using the Load Object function I’ve created. The Load Object function is used is countless other places, so I’m not sure why it’s failing here.

The point of failure:

The Load Object Function:

You need to do the cast here

Because the top branch is returning a generic save game, and the bottom branch is returning your class of save game.

I tried removing the Load Object node and replaced it with the Load Game from Slot. For some reason, it succeeds when I use a “Cast to SG_Cache” node. But I can’t figure out why this would be, because this slot is not an SG_Cache, It’s an SG_GameSession.

As I’m looking through this, it appears that I cannot use the “Cast to SG_GameSession” Node without it failing. I’m not really sure why this node fails but the “Cast to SG_Cache” node works fine.

Then apparently it is a SG_Cache?

Try removing the savegame and then run the code…

As far as I can tell, it isn’t an SG_Cache. It’s never set as one and the variable is of the type SG_GameSession.

Removing the saved game did nothing unfortunately.

So it appears as though the game is not successfully saving the file. I’m not sure why that is.

Well I deleted a bunch of stuff and put it back in exactly the way I had it, and it works marginally better now. No idea what that was about. Thanks for your help.

1 Like