I have a BP_SaveGame that contains the variable CurrentLevel which is where I want to update and store the current name reference of the level the character is in which is checked at the point of saving.
The SavePoint is a physical overlap the player hits that runs the save to game slot but it checks the current name of the level and attempts to set it in the BP Save Game in Current Level but it fails, I believe it’s because its trying to convert it from String to Name but the ‘Get Current Level Name’ doesn’t allow me to capture it as a Name
The level won’t open because something happens in the conversion from String to Name and it fails. I can change the variable to String and that’s fine but now I can’t open the level by Name or Reference based on that variable that is now a string as it was a Name type
Exit the game and click Load it should load the save from the save point from that level but it fails, I need this to be easily modified so I can load the game from the latest save from the level in which the save was triggered
This is in fact printing ‘None’ in the PrintString when the game saves when it should have captured the result from Get Current Level Name which is ThirdPersonMap, more testing reveals that Get Current Level Name is getting the correct result, the conversion breaks somehow when it’s being Set
PS:
The FName type is quite involved: FName in Unreal Engine | Unreal Engine 5.4 Documentation | Epic Developer Community
It is entirely possible that you can’t create a new FName because you don’t have access to the FName table. I am really not sure about this but that’s why I urged you to keep the name as a string as long as possible.
This is the Savepoint the player overlaps to save game where it should capture, update and store the level name to be pulled when load game is clicked from main menu
It looks like you have bp save game object reference as a variable in the save point? Instead try getting game instance, get save game from that, then access the function that should work
You need to get the save game object from game instance and set the values that way, a local reference won’t work, also id recommend setting up functions in your save game to set it’s variables