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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Save Whole Actor Data

Hi I have a question

Is there a way to save all Variables from a Actor. And load them after the game is Restart?

Without which I have to enter all the single?

Maybe with Get all actor with Interface (SaveData)

And then save all the variables from this actor with this interface?

How do I do this and how do I then recharge all?

I can not find anything on the Internet looking for several days

Product Version: UE 4.13
Tags:
more ▼

asked Jan 04 '17 at 04:59 PM in Blueprint Scripting

avatar image

Yoroie
1 2 1

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

1 answer: sort voted first

I would do it like this:

Create a custom C++ SceneComponent. This component has a string property representing a filename.

To save the actor's data, the SceneComponent will iterate through the actor properties using a UProperty iterator. For every primitive property, transform the values into a string. For every actor property, get the class and tag and make a string out of them. Concatenate all strings. Write this string to disk at the filename.

Saving can be triggered on a user action or if you want to make it really fancy, there are some functions that get triggered when properties change their values. Read " How to handle property updates in code? ".

To retrieve the values, the SceneComponent will get the file from filename, parse the string and write the values back into the actor properties. For the actor properties, use the class and tag to find the actor in the scene.

Add the SceneComponent to all actors that need to remember their property values.

This is a generic solution and it only makes sense to use it if you have a lot of objects that need to remember their values. If you just need to save values for a single or a few objects, you could use the "Save Game to Slot" and "Load Game from Slot" nodes.

more ▼

answered Jan 04 '17 at 05:46 PM

avatar image

Titirez
323 13 12 24

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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