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. 

Reading data from a .sav file

Hey guys,

I'm unable to actually get the data back from my .sav file I'm testing. The data I'm writing to it probably cannot be serialized and I was wondering if that was something that can be helped without writing my own save file system.

 My header file looks like this:
 
 /**
  * 
  */
 
 //Lets forward declare our Level Editor Data holder
 class ULEData;
 //Fdec Actor to use
 struct FdataToReturn;
 
 USTRUCT(blueprintable)
 struct FDataStruct {
 
     GENERATED_BODY()
 
     UPROPERTY(VisibleAnywhere, Category = "Saved Data")
     TArray<FdataToReturn> dataToWrite;
 
 };
 
 UCLASS(Blueprintable)
 class UILETEST_API UTestSaveGame : public USaveGame
 {
     GENERATED_BODY()
 
 public:
 
     UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Basic)
     FString PlayerName;
 
     UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Basic)
     FString SaveSlotName;
 
     UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Basic)
     int32 UserIndex;
 
     //lets us set the data for the level
     UFUNCTION(BlueprintCallable, Category = EnterData)
     void setOurLEData(ULEData* incData);
 
     //lets us get it back
     UFUNCTION(BlueprintCallable, Category = EnterData)
     TArray<FdataToReturn> getLEData();
 
     //constructor
     UTestSaveGame();
     
     //UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Basic)
     FDataStruct dataToSave;
 
 
     
     
 
 };


 my cpp looks like this:
 
 
 #include "UILETest.h"
 #include "LEData.h"
 #include "TestSaveGame.h"
 
 UTestSaveGame::UTestSaveGame()
 {
     //Do nothing for now
     SaveSlotName = TEXT("TestSaveSlot");
     UserIndex = 0;
 }
 
 
 void UTestSaveGame::setOurLEData(ULEData* incData) {
     
     ULEData* tempStore = incData;
     dataToSave.dataToWrite = tempStore->SDataArray;
 }
 
 
 TArray<FdataToReturn>  UTestSaveGame::getLEData()
 {
     if (dataToSave.dataToWrite.Num() > 0)
     {
         //return our array
         return dataToSave.dataToWrite;
     }
     else
     {
         //basically return nothing
         return TArray<FdataToReturn>();
     }
 }


I then in blueprint call this, store my data points of ULEData and save the slot

but when I load the slot (even though it's valid.) my struct is empty and the data inside it is empty..

I figure this is not getting written to the file. Any advice to what I'm missing?

Thanks

Product Version: UE 4.15
Tags:
more ▼

asked Feb 16 '17 at 10:04 PM in C++ Programming

avatar image

Demoneyejin
95 11 16 26

(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