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 Game with custom blueprints/classes

Right now, I'm trying to save a game. I can create a save game with built-in values such as int, float, string, etc. How do I save/load the data of a custom object/blueprint?

For instance, I have a character with health, maxHealth, Exp, etc, all stored in a custom object called PlayerCharacterInfo. I stuff an array of those into a blueprint inherited from Save Game. If I save and load in the same game (without closing it in editor) then the save/load works perfectly. However, if I save, then close the game, then load that save game, everything is value of None. I believe it's saving a reference to the object in the world instead of the data within it. How can I save the data itself, instead of just a reference to it?

Product Version: UE 4.10
Tags:
more ▼

asked Feb 24 '16 at 09:40 PM in Blueprint Scripting

avatar image

Yulgalminakf
73 12 18 27

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

1 answer: sort voted first

use a struct instead of an object. then you can save that struct. object references wont save properly because the pointers are only meaningful during runtime, so fill the struct with basic types, like bytes or ints.

more ▼

answered Feb 24 '16 at 09:57 PM

avatar image

ScottSpadea
9.6k 320 205 450

avatar image Yulgalminakf Feb 24 '16 at 10:10 PM

Is it possible to make a struct in blueprints, or would I need to hop into C++?

avatar image Yulgalminakf Feb 24 '16 at 10:12 PM

Never mind, found it. TY for the help!

avatar image Yulgalminakf Feb 24 '16 at 10:22 PM

Okay, I see how to make structs in the editor, but is there a way to make structs inherit from other structs, or would I need to do C++ code for that?

(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