In my game I have a map with a lot of actors. Now I want to save this map with all the properties of the actors along, whenever the user hits the save button in game. I have seen this function: FEditorFileUtils::SaveMap | Unreal Engine Documentation. But I cant get it to work (unresolved external symbols) and it is probably only for the editor. So is there an other way I can do this? Because why should I code a method for saving a map when you allready have one.
If a UWorld can be saved out (Havent tried that) then you could load your UWorld back in then get a handle to the current FWorldContext object and use WorldContext.SetCurrentWorld( YourWorld ); then GWorld = YourWorld. Thats what I used to set the current world in editor. But none of them are editor only functions, but no idea what it will do ingame.
If you have a current world already loaded, you can use GEngine->GetWorldContextFromWorld( CurrentWorld ); or GetWorldContextFromWorldChecked( CurrentWorld ); which does additional checks im guessing. Otherwise you can use GEngine->GetWorldContexts( ); which returns an array of them, in standalone play there should only ever be one (Multiple simultaneous worlds are not supported in standalone). In editor there could be at least two (Editor world and PIE world).
I suspect that if the above stuff did not work, then there is no way outside of the editor to save a umap outside of the editor. Im guessing due to the fact that when a game gets packaged, the files get cooked, which strips out a lot of metadata. Which cannot be done during runtime. You may want to look at saving out ur maps to a custom format. And when the world gets loaded. Load in your custom format map and spawn in the necessary actors.