Module Basics

Core concepts of the ARDEM C++ plugin module system.

Every ARDEM mod is a standard Unreal Engine 5 plugin with a Runtime module. The ARDEM SDK is linked as a dependency and exposes the IArdemModAPI interface, which is the single entry point to all game systems.

IArdemModAPI

MethodReturn TypeDescription
GetEventManager()UArdemEventManager*Subscribe and broadcast game events
GetWorldManager()UArdemWorldManager*Read and modify world state
GetItemRegistry()UArdemItemRegistry*Item database and spawning utilities
GetPlayerManager()UArdemPlayerManager*Access all connected players
GetDataStore()UArdemModDataStore*Persistent key-value store for your mod
GetLogger()FArdemModLogger*Structured server-side logging
cpp
// Accessing the API from anywhere in your module
#include "ArdemModAPI.h"

void UMyModSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
    Super::Initialize(Collection);

    IArdemModAPI& API = IArdemModAPI::Get();

    UArdemEventManager* Events = API.GetEventManager();
    UArdemItemRegistry* Items  = API.GetItemRegistry();
    UArdemWorldManager* World  = API.GetWorldManager();
}

Timers

Use UE5's built-in FTimerManager for scheduling. Get a reference to it from the World object.

cpp
// One-shot timer — fires after 5 seconds
FTimerHandle OneShotHandle;
GetWorld()->GetTimerManager().SetTimer(
    OneShotHandle,
    [this]()
    {
        UE_LOG(LogMyMod, Log, TEXT("5 seconds elapsed."));
    },
    5.0f,   // delay in seconds
    false   // not looping
);

// Repeating timer — fires every 60 seconds
FTimerHandle RepeatHandle;
GetWorld()->GetTimerManager().SetTimer(
    RepeatHandle,
    [this]()
    {
        int32 Count = IArdemModAPI::Get().GetPlayerManager()->GetPlayerCount();
        UE_LOG(LogMyMod, Log, TEXT("Active players: %d"), Count);
    },
    60.0f,  // interval in seconds
    true    // looping
);

// Cancel a timer
GetWorld()->GetTimerManager().ClearTimer(RepeatHandle);

Timer Context

SetTimer requires a valid UWorld. Call it from Initialize() on a subsystem, or from within a delegate callback where the world is guaranteed to be available. Never schedule timers inside StartupModule().