A registry of debug cheats with a built-in window for Unreal Engine.
A registry of debug cheats with a built-in window for Unreal Engine.
NsCheats is a registry of debug cheats with a built-in window. Game systems register buttons, toggles, number fields, text fields, pickers, and debug text. A developer opens the window during play and uses the cheats.
NsCheats is for development builds. In a Shipping build, the registry, the window, and the console commands compile out. NsCheats does not replicate, and it does not give an in-game UMG widget.
stat fps and stat unit.Unreal Engine 5.7+
NsCheats folder into the Plugins folder of your project."NsCheatsRuntime" to the module dependencies in Build.cs.Implement INsCheatProviderInterface on the object that owns the cheats:
#include "NsCheatsSubsystem.h"
void UMyEconomySubsystem::RegisterCheats_Implementation(UNsCheatsSubsystem* CheatsSubsystem)
{
CheatsSubsystem->ForProvider(this, TEXT("Economy"))
.Section(TEXT("Coins"))
.Button(TEXT("Economy.AddCoins"), INVTEXT("Add 1000 coins"),
FNsCheatExecuteDelegate::CreateUObject(this, &UMyEconomySubsystem::AddDebugCoins))
.Toggle(TEXT("Economy.FreePlay"), INVTEXT("Free play"),
FNsCheatGetBoolDelegate::CreateLambda([this]() { return bFreePlay; }),
FNsCheatSetBoolDelegate::CreateLambda([this](bool bValue) { bFreePlay = bValue; }));
}
Then call RegisterProvider(this) on the UNsCheatsSubsystem of the game instance. Do this in BeginPlay for an actor or a component, and call UnregisterProvider(this) in EndPlay.
Run ns.Cheats.Toggle in the console to open the window.
| Builder call | Blueprint call | Row in the window |
|---|---|---|
Button |
Register Button Cheat |
A Run button |
Toggle |
Register Toggle Cheat |
A check box |
Float |
Register Float Cheat |
A number field |
Text |
Register Text Cheat |
A text field, with a Run button if an action is bound |
Picker |
Register Picker Cheat |
A dropdown, with a Run button if an action is bound |
DebugText |
Register Debug Text Cheat |
Read-only text |
ButtonRow |
None | A row of buttons |
UNsCheatsSubsystem – The game instance subsystem that owns the entries, the providers, the console commands, and the window.INsCheatProviderInterface – One function, RegisterCheats(UNsCheatsSubsystem*), for C++ and Blueprint.FNsCheatBuilder – The C++ builder that ForProvider(Owner, Tab) returns.FNsCheatEntry – One entry: id, label, description, tab, section, sort order, type, owner, and delegates.RegisterProvider / UnregisterProvider – Add or remove a provider and its entries.ExecuteEntry(Id) – Run the action of an entry from code.OpenCheatUI / CloseCheatUI / ToggleCheatUI – Show or hide the window.DumpRegisteredCheats – Log all entries and return the list as a string.ButtonRow has no Blueprint registration function.RegisterProvider.