x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Save map at runtime

Hello,

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: https://docs.unrealengine.com/latest/INT/API/Editor/UnrealEd/FEditorFileUtils/SaveMap/index.html. 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.

Greetings, Leo

Product Version: Not Selected
Tags:
more ▼

asked Aug 28 '14 at 02:39 PM in C++ Programming

avatar image

DJ_Lectr0
110 15 18 27

avatar image DarthB Aug 29 '14 at 11:10 AM
avatar image DJ_Lectr0 Aug 29 '14 at 03:38 PM

ok, I can make a save game class with a uworld property, but how can i set the uworld?

avatar image DJ_Lectr0 Aug 30 '14 at 10:39 AM

By that I mean, how can I set the current rendered / used uworld, not the one of the save game class.

avatar image Ehamloptiran Aug 30 '14 at 10:48 AM

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.

avatar image DJ_Lectr0 Aug 30 '14 at 11:02 AM

ok, will try them and report.

avatar image DJ_Lectr0 Aug 30 '14 at 02:49 PM

Ok and how can I get the current WorldContext??

avatar image DJ_Lectr0 Aug 30 '14 at 06:10 PM

Tried it and nothing happens. Did you do something else? Like telling the engine to load the new world.

avatar image DJ_Lectr0 Sep 04 '14 at 05:16 PM

Or do you know what the difference between the editor and game is in this respect?

avatar image DJ_Lectr0 Sep 10 '14 at 04:45 PM

Ok after looking in the save file, it only has the path to a temp folder with a map in it. Could I load a map in game?

avatar image Ehamloptiran Aug 30 '14 at 03:23 PM

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).

avatar image DJ_Lectr0 Sep 25 '14 at 11:53 PM

Bump, really need an answer

avatar image DJ_Lectr0 Oct 01 '14 at 11:00 PM

nothing???

avatar image Ehamloptiran Oct 02 '14 at 05:38 AM

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.

avatar image DJ_Lectr0 Oct 02 '14 at 06:55 AM

Ok, is there a way then to save out actors, without having to save all properties manual (for example get an array with all properties)?

avatar image Ehamloptiran Oct 02 '14 at 07:06 AM

Serialize? This is already setup to serialize all actors properties that aren't transient. So you could just bridge off that.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question

Related Questions