Download

Wiki Code Tutorials

https://www.mediafire.com/convkey/7d2b/fr75kbso2kkazru6g.jpg

Dear Community,

I have been hard at work making UE4 C++ Code tutorials!

I have added many pages of entirely code-focused tutorials, including both .h and .cpp,

to the UE4 Wiki Code Page!


**UE4 C++**

The entire focus of these tutorials is UE4 C++, not just regular C++.

Using my code samples will help you get a feel of how UE4 C++ works and help you get integrated with the UE4 API.


**Code Example

Custom Save System To Compressed Binary File**

Here’s a sample of the kind of code I am posting on the Wiki Code page:

This is a code sample for how to Save any game data you want from UE4 C++ to a compressed binary filename of your choosing.


bool ControllerClass::SaveGameDataToFileCompressed(const FString& FullFilePath, 
	int32& SaveDataInt32,
	FVector& SaveDataVector,
	TArray<FRotator>& SaveDataRotatorArray
){
	FBufferArchive ToBinary;
	SaveLoadData(ToBinary,NumGemsCollected,PlayerLocation,ArrayOfRotationsOfTheStars); 
 
	**//Pre Compressed Size**
	ClientMessage("~ PreCompressed Size ~");
	ClientMessage(FString::FromInt(ToBinary.Num()));
 
	//
 
	**// 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();
 
	//
 
	**//Compressed Size**
	ClientMessage("~ Compressed Size ~");
	ClientMessage(FString::FromInt(CompressedData.Num()));
 
 
	if (!GFileManager) return false;
 
	**//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();
 
		ClientMessage("File Save Success!");
 
		return true;
		//
	}
	else
	{
		**// Free Binary Arrays **
                Compressor.FlushCache();
		CompressedData.Empty();
 
		ToBinary.FlushCache();
		ToBinary.Empty();
 
		**// Close Buffer **
		ToBinary.Close();
 
		ClientMessage("File Could Not Be Saved!");
 
		return false;
		//
	}
}


**Summary**

Enjoy!

Rama

Thanks Rama. Putting this up is awesome.

Hee hee, thanks Mike!

Rama

“Somebody get this guy a medal” … Awesome…thanks for sharing…
I just learned Unrealscript from going through Dungeon Defense (etc.) and without those to reference I’m going to be lost for a bit in C++…thanks so much for a great place to start…

Rama you are a **** hero! This is already helping me get settled in :smiley:

Thank you so much for this!

Awesome! Thank you!

@Everyone

Yay, I am glad you are enjoying my efforts!

@DAAAAAVVE

I’m liking your name, I hope I spelled it right

:slight_smile:

Rama

Rama! <3 Thanks so much.

Thanks a lot!!

[FONT=Comic Sans MS]New Tutorial: Dynamic Arrays

Dynamic Arrays

Hee hee your welcome SaxonRah!

UE4 C++ is so much fun!

:slight_smile:

Rama

Great job Rama, and thank it will be handful ^^

thanks, that really will help me to get things started!, the fps tutorial is just awesome.

Heey, welcome Daimaku, I’ve been missing you from the UE3 forums :slight_smile:

Rama

Heh, yes, Rama likes is our resident exhibitionist.
I’m just a bit of a flasher :slight_smile:

Great work, now I have a lot of stuff to read on! Thank you! :smiley:

Hee hee, you’re welcome!

:slight_smile:

Rama

Thanks Rama, It covers most of my UE4 questions :slight_smile:

[FONT=Comic Sans MS]Tutorial Added, USTRUCTS(), UE4 C++ Structs

UE4 C++ Structs

Yay!

Rama

Wow, this is a fantastic start. I am amazed you’ve done all this so quickly :smiley:

Hopefully this will break the ice for more people to contribute, although you seem to be a one man coding tutorial army at the moment hah.