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 and load placed Actors in the Editor

I have a level consisting of a road and a few vehicles (which are blueprint assets that I created). I'd like to create different traffic scenarios by putting vehicles in different positions and setting their variables, without creating a separate level for each scenario. Inside the editor, how can I save a set of placed actors to a file (or directory), and load them to the level later based on which scenario I want to work with?

Thanks!

Product Version: UE 4.20
Tags:
more ▼

asked Sep 17 '18 at 03:26 PM in Using UE4

avatar image

Abol_18
1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You have a couple of options, depending on what you want to achieve.

  • if you do not need to make changes during run-time, if you do not need to save anything that changed dynamically during gameplay, you may get away with setting up a DataTable and keeping all the variables inside.

For this you will need to read up on Structs and Data Tables

In practice, you would create a struct for each traffic scenario. Each traffic scenario struct would contain arrays of other structs relating to vehicles present, their state, road layout, conditions and any other variables you may need. You can create this data in a worksheet (anything that can export a *.csv file) or directly in the editor.


  • if you need to save something that has changed during gameplay, you will need to use a Save Game Object. You will still need structs, most likely, otherwise this will become tedious much quicker than you expect.

In this case, rather than holding rows of DataTable structs, you would position your vehicles around the map, set their variables, run the project and save the state of the vehicles to a Save Game Slot by name. This will need to be done in loops. Rinse, repeat and save a different layout, this time round to a different slot. You can then load a save game from a slot and respawn everything.


Save Game Object would work for both scenarios, of course. DataTable allows you to tweak a lot of variables quickly (especially if you do in excel) but the ability to set everything visually in the viewport has its advantages as you can imagine.

more ▼

answered Sep 17 '18 at 04:07 PM

avatar image

Everynone
11.3k 68 22 48

(comments are locked)
10|2000 characters needed characters left
Your answer
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