Learning so much new stuff. Thank you! Here is another cool trick for commands!

Awesome to learn new stuff every time watching these videos! Previously i added console command this way:

Go to any class you created and create a static variable, something like this:

static int32 CheatSuperJump = 0;
FAutoConsoleVariableRef CVARCheatSuperJump(
 TEXT("CHEATS.SuperJump"),
 CheatSuperJump,
 TEXT("Allows user to jump higher"),
 ECVF_SetByConsole);

Here we are defining a console command that can be set to be any int32 you desire. When in game, you can see it like this:
superjump

Basically you can set a scope that lets you see what is inside of that scope. In this case, we set Cheat. scope. And you can set all kinds of cheats here. Another very cool use would be create a Debug scope. This way you could for example create int32:s that let you turn on and of debug stuff. That way you would never need to go comment and uncomment stuff! When playing game you could just type something like

Debug.EnableVisualTracing 0 or Debug.EnableVisualTracing 1 to turn on and off the line tracing system. Inside code, you would do something like

if(EnableVisualTracing == 1)
{
// Debug draving code here
}

You can also set where this console command works. For example ECVF_SetByConsole would work in packaged game. You can see the commands here: http://docs-origin.unrealengine.com/latest/INT/API/Runtime/Core/HAL/EConsoleVariableFlags/index.html

Not sure if this is told in later sections, sorry if so :slight_smile:

Privacy & Terms