Skip to content

C++ Reference ​

Call the Scooter Utilities runtime library from your own C++ code.

Every Scooter Utilities Blueprint node is a static function on a Blueprint function library class in the ScooterUtilsBPLibraryModule runtime module. Add the module as a dependency and you can call those same functions from C++, plus a couple of C++-only extras for debug logging.

Setting Up Your Module ​

  1. Make sure the plugin is installed and enabled in your project. See Installing and Enabling.

  2. In your module's .Build.cs file, add ScooterUtilsBPLibraryModule to your dependencies:

    csharp
    PrivateDependencyModuleNames.AddRange(new string[] { "ScooterUtilsBPLibraryModule" });

    Use PublicDependencyModuleNames instead if your module's public headers include Scooter Utilities headers.

  3. If your code lives in another plugin, list Scooter Utilities as a dependency in that plugin's .uplugin file:

    json
    "Plugins": [
      { "Name": "ScooterUtils", "Enabled": true }
    ]
  4. Include the header for the class you want to call, then call its static functions. You never need to create an instance.

TIP

The module name is ScooterUtilsBPLibraryModule, not the ScooterUtilsBPLibrary folder name under Source.

Headers and Classes ​

HeaderClassDescription
DebugPrint.hUSUDebugPrintTimestamped logging to the Output Log and log files, plus the SCOOTER_DEBUG_PRINT macro. See Debug Print.
FileIO.hUFileIOLoad, save, and append text files. See File IO.
ScooterUtilsBPLibrary.hUScooterUtilsBPLibraryRead and write config values. See Global Config.
BPReflection.hUBPReflectionName and path information for an object's Blueprint. See Blueprint Reflection.
LoremIpsumGenerator.hULoremIpsumGeneratorPlaceholder text. See Lorem Ipsum.
JSONBlueprintLibrary.hUJSONBlueprintLibraryString-based JSON creation and parsing. See JSON.

The runtime module is set up for Windows, macOS, Linux, and Android, and works in packaged games as well as in the editor.

Quick Example ​

A small actor that logs a message, builds some JSON, and saves it to the project's Saved folder:

cpp
// MyActor.cpp
#include "MyActor.h"
#include "DebugPrint.h"
#include "FileIO.h"
#include "JSONBlueprintLibrary.h"

void AMyActor::BeginPlay()
{
    Super::BeginPlay();

    SCOOTER_DEBUG_PRINT(TEXT("MyGame.log"), EDebugLevel::Info, TEXT("%s started"), *GetName());

    FString Json;
    Json = UJSONBlueprintLibrary::AddField(EJSONFieldType::String, Json, TEXT("actor"), GetName());
    Json = UJSONBlueprintLibrary::AddField(EJSONFieldType::Boolean, Json, TEXT("started"), TEXT("true"));

    FString SavedPath;
    UFileIO::SaveTextToFile(EFileLocation::ProjectSaved, TEXT("ActorState.json"), Json, SavedPath);
}

C++ Reference Pages ​