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"

Nothing is saved

After following Rama's awesome tutorial:

https://wiki.unrealengine.com/Save_System,_Read_%26_Write_Any_Data_to_Compressed_Binary_Files

I happen to encounter this problem: Everything goes alright, but when I go to the directory in which files should be saved, I find nothing in there.

Here is the code of the functions:

void UBrickRenderComponent::SaveLoadData(FArchive& Ar, TArray& SaveVertexBatch ) { Ar << SaveVertexBatch; }

bool UBrickRenderComponent::SaveGameDataToFileCompressed(const FString& FullFilePath, TArray& SaveVertexBatch)

{ FBufferArchive ToBinary; SaveLoadData(ToBinary, SaveVertexBatch);

 // Compress File 
 //tmp compressed data array
 TArray<uint8> CompressedData;
 FArchiveSaveCompressedProxy Compressor =
     FArchiveSaveCompressedProxy(CompressedData, ECompressionFlags::COMPRESS_ZLIB);

 //Send entire binary array/archive to compressor
 Compressor << ToBinary;

 //send archive serialized data to binary array
 Compressor.Flush();


 
 //vibes to file, return successful or not
 if (FFileHelper::SaveArrayToFile(CompressedData, *FullFilePath))
 {
     // Free Binary Arrays 
     Compressor.FlushCache();
     CompressedData.Empty();

     ToBinary.FlushCache();
     ToBinary.Empty();

     // Close Buffer 
     ToBinary.Close();

     return true;
     
 }
 else
 {
     // Free Binary Arrays 
     Compressor.FlushCache();
     CompressedData.Empty();

     ToBinary.FlushCache();
     ToBinary.Empty();

     // Close Buffer 
     ToBinary.Close();

     return false;
     
 }

}

And here is the call:

if (!SaveGameDataToFileCompressed("C:\\Users\\Migue\\Documents\\Unreal Projects", VertexIndexMap)) { UE_LOG(LogStats, Log, TEXT("COULD NOT SAVE BUAAAAAAAAAAAAAAAAAAAAH")); }

Is there anything obvious about this? If you guys know some useful way of invoking UE4 god, Rama, that would be cool

Product Version: Not Selected
Tags:
more ▼

asked Feb 03 '15 at 09:54 PM in C++ Programming

avatar image

AlatristeCraig
1 2 3

avatar image bpeck Feb 03 '15 at 10:00 PM

Sorry for your troubles dude, but your title made me lol. Pretty existential stuff.

avatar image AlatristeCraig Feb 03 '15 at 10:20 PM

Indeed, hahaha! :D

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

1 answer: sort voted first

Hey guys I just tried to create a text file myself and then complete the path like this:

if (!SaveGameDataToFileCompressed("C:\\Users\\Migue\\Documents\\Unreal Projects\\lalala.txt", VertexIndexMap)) { UE_LOG(LogStats, Log, TEXT("COULD NOT SAVE BUAAAAAAAAAAAAAAAAAAAAH")); }

And IT WORKS!!!

I do not know what is in there now, I guess I will have to find out, because it was 1KB initially, and after compiling the program it is 13KB now! :D :D :D :D :D

more ▼

answered Feb 03 '15 at 10:32 PM

avatar image

AlatristeCraig
1 2 3

(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