Download

Wiki Code Tutorials

How to Prevent Stale AActor* Pointers in UE4

Dear Community,

If you are experiencing crashes due to stale AActor* pointers, I have just the new wiki for you!

A stale pointer means the AActor* returns true when you verify != nullptr, but then dereferencing still causes a crash.

Check out the solution here:

:slight_smile:

Rama

You can now Get Traced Distance At No Extra CPU Cost!

Dear Community,

Epic accepted my pull request to expose Distance information as part of FHitResult!

The PhysX engine was always returning this information, so my requested Engine code change did not affect performance at all.

The advantage is that now whenever you do a trace, you already have the non-squared actual distance from the start of the trace to the impact point available to you!

Trace Functions Wiki Updated With Info About New Distance Property of FHitResult

Enjoy!

:slight_smile:

Rama

Packaged Game Paths: Obtain Paths based on Game Executable

Dear Community,

In this wiki I share with you many functions that enable you to obtain absolute paths that are based on the location of the game exectuable.

In otherwords you can package the game, and then move it at any time to any directory, and the path generated will be accurate for your whole moved project!

Example:



//InstallDir/WindowsNoEditor/GameName
const FString ThePath = FPaths::ConvertRelativePathToFull(FPaths::GameDir());


In a pre-packaged game this will be where the .uproject is, but in packaged game it will be your main game directory off of windowsnoeditor!

Packaged Game Paths ~ Obtain Directories Based on Executable Location

:slight_smile:

Rama

AI Pathing Customization in C++

Dear Community,

In this wiki I show you how you can completely customize the UE4 PathFollowing behavior every tick in C++!

I used this method to make my C++ AI Jump Pathing videos!

Custom UE4 AI Pathing Every Tick


https://youtube.com/watch?v=sMMSQdnyt6o

Enjoy!

Rama

Entry-level Guide to UE4 C++

Dear Community,

For anyone wanting to learn UE4 C++ I have posted an entry-level wiki guide here!

I discuss the essential basics you need to know to get used to both C++ and UE4 C++

Have fun today!

:slight_smile:

Rama

Custom Level Blueprints in C++

Dear Community,

In this wiki I show you how you can use a custom Level Blueprint, which enables your level designers to utilize custom features of your game’s code base!

Solus C++ Wiki Tutorials ~ Custom Level Blueprint

Rama

Get Enum From String

Dear Community,

I’ve added a new entry to my UE4 C++ Enum wiki!

I am giving you the code to get an enum value back from a string, after it was initially converted to a string!

UE4 Wiki Link



emplate <typename EnumType>
static FORCEINLINE EnumType GetEnumValueFromString(const FString& EnumName, const FString& String)
{ 
	UEnum* Enum = FindObject<UEnum>(ANY_PACKAGE, *EnumName, true);
	if(!Enum) 
        { 
          return EnumType(0);
        }		
	return (EnumType)Enum->FindEnumIndex(FName(*String));
}
 
//Sample Usage
EChallenge ChallengeEnumValue = //Initial Value

FString ParseLine = GetEnumValueAsString<EChallenge>("EChallenge", ChallengeEnumValue))); //To String

EChallenge Challenge = GetEnumValueFromString<EChallenge>("EChallenge", ParseLine);  //Back From String!


Enjoy!

Rama

Solus C++ Wiki Tutorials

Dear Community,

I have created many C++ tutorials around the development of The Solus Project (with Hourences)

Solus C++ Wiki

Topics include:

  1. Custom Level Blueprints

  2. Getting List of Hardware Supported Screen Resolutions

  3. Concatenating FText

  4. Custom Actor Components Via C++

  5. Globally Accessible Data Storage Class

  6. Custom Game Instance Class

  7. Declare Console Commands in C++, implement in BP!

:slight_smile:

Rama

UDP Sockets Wiki, Send Data From UE4 Instance To Another!

Dear Community,

Here is my latest wiki, on sending any data you want from 1 UE4 Instance to Another using UDP sockets!

:heart:

Rama

465c97e71f555224eab45a2f098c46ae669ed85a.jpeg

Wiki on Delegates

6ea815f24385fedf27e8d89c5835a7e9bfd4c3f4.jpeg

I’ve released a new wiki on C++ and BP-Exposed Delegates!

I discuss:

  1. Raw C++ Delegates
  2. Slate Delegates
  3. UObject Delegates
  4. BP and Level BP exposed delegates

Delegates in UE4

Rama

Thanks a lot for these tutorials Rama, I’ve benefited immensely from so many of them. Also happy to see the new wiki on delegates; just a few months ago I was searching to see if you’d written one!

With so many delegate types, combinations and special macros like BindDynamic/etc I found them very confusing while starting out despite being familiar with basic function pointers. Hopefully newcomers to delegates will find it easier now!

BTW I can’t be the only one who types β€œunreal rama <search topic>” while looking for UE4 resources :slight_smile: Definitely interested in the book you said you were working earlier in this thread.

You’re welcome @VSZ!

Yes the book is still something I am working on!

:slight_smile:

:slight_smile:

Rama

FVector function from me for you in 4.11, ::DistSquaredXY

Dear Community,

This FVector function is from me for you in 4.11!

From the release notes:



New: Added FVector::DistSquaredXY helper function


There’s many times I just wanted XY Squared distance, no Z value included, and now it’s part of the Engine!

:slight_smile:

Rama

How to Debug a Packaged Game

Dear Community,

Are you getting crashes in packages games with no debug info in the crash reporter?

Need fancier debugging powers of Visual Studio in a packaged game?

I’ve just released a new wiki on how you can debug packaged games!

I cover:

  1. including debug symbols when packaging
  2. attach to process using Visual Studio

How to Debug a Packaged Game

:slight_smile:

Rama

How to Package Custom Files With Your Game

Dear Community,

New Wiki!

How to Package Custom Files With Your Game!

Many thanks to Epic’s Jamie Dale!

Rama

Simple and Fast Way to Link External C .lib and .dll files that will package with the game

Dear Community,

In this wiki I show you an utterly simple and fast way to get your external .lib working in UE4, satisfying the following three requirements.

a. The external lib functions can be called in a WITH_EDITOR build, when run from commandline.

b. The lib functions can be called from within the Editor in PIE, and the editor will actually load properly.

c. The external lib functions will work in a packaged game!!!

Wiki Link

:slight_smile:

Rama

PhysX Wiki

Dear Community,

I’ve now updated my PhysX wiki to 4.11!

Specifically, all PToU conversions were moved from PhysicsPublic.h to PhysXPublic.h

Enjoy!

Rama

Example Of Template Functions

I make extensive use of C++ Template functions in my Min/Max of Array, full code here!

Min/Max of Array Forum Link

Wiki on C++ Templates

Update to Float As String With Precision

Update to Float As String With Precision

I now handle a case of 1.9999 within precision turning into β€œ2.0” :slight_smile:

:heart:

Rama

Wiki on Using Code Plugins in Your Projects

Dear Community,

I’ve created a simple wiki on how to extend/utilize code from code plugins in your main UE4 project!

Rama