In this post we’re going to see how to create a custom gameplay debugger category. By the time of this writing the official documentation page is outdated.

This post was written in 4.15 version of the engine. Depending on the time you’re reading this, this information may be outdated as well.

Please note that this is a followup post to my “Creating Custom Modules” post. So before going any further, make sure that you have followed that post and everything works fine.

Download the entire source code from my GitHub repo

Modifying the .Build.cs file

Before we go any further, open up the .Build.cs file of your module (in my case this will be OrfeasModule.Build.cs file and add the following lines of code:

When you’re done with that, add a new C+ class that inherits the UObject inside your module and name it CustomGameplayDebugger so you can follow the tutorial easier.

Creating the GameplayDebuggerCategory

Open up the header file of the CustomGameplayDebugger class and erase the code that the editor has written for you and declare the following class:

Then, open up the source file of your class and type in the following code:

Before you attempt to build your project, make sure that your character class is marked with the appropriate *_API macro – otherwise you will encounter a linker error. (Special thanks to Mieszko Zielinski for his help on this one).

In my case, my project is named “GDBlogPost” so my character class is going to have the following macro in the class declaration:

class GDBLOGPOST_API AGDBlogPostCharacter : public ACharacter

Moreover, don’t forget to add the Health and MaxDamage properties of the character somewhere in its header file:

The last things we need to do, is to tell our Module to register our custom gameplay debugger category on its startup. Moreover, we need to tell our Module to unregister our category if its shutdown. To do that navigate to your module’s source file and type in the following code:

Once you’re done with that, save and build your project. At this point, if you navigate to your Project’s settings inside the Gameplay Debugger option, you will have the following category available:

(Click on image to enlarge in a new tab)

You may have to restart your Editor if that option isn’t visible.

Enabling the Gameplay Debugger

To enable the gameplay debugger click on the apostrophe key on your keyboard (‘) and type in the “showflag.debugAI 1” console command while simulating your game.

Then, select your character. The following window will appear:

(Click on image to enlarge in a new tab)

 

Share postShare on Facebook16Tweet about this on TwitterShare on LinkedIn0Share on Reddit3