After following Rama’s awesome tutorial:
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,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