Quick Start

Create and load your first ARDEM C++ mod plugin in Unreal Engine 5.

This guide walks you through creating a minimal working mod plugin from scratch. By the end you will have a C++ module that subscribes to the player join delegate and broadcasts a welcome message.

Prerequisites

  • Unreal Engine 5.3 or later installed via the Epic Games Launcher
  • Visual Studio 2022 with the C++ game development workload
  • The ARDEM Mod SDK — download from the Developer Portal
  • Basic familiarity with Unreal Engine plugin development

Step 1 — Create the Plugin Folder

Inside the game's Plugins/ directory, create a folder for your mod. The folder name becomes your plugin identifier.

bash
ArdemGame/
└── Plugins/
    └── MyFirstMod/
        ├── MyFirstMod.uplugin
        └── Source/
            └── MyFirstMod/
                ├── MyFirstMod.Build.cs
                ├── Public/
                │   └── MyFirstMod.h
                └── Private/
                    └── MyFirstMod.cpp

Step 2 — Create the .uplugin Manifest

MyFirstMod.uplugin
{
  "FileVersion": 3,
  "Version": 1,
  "VersionName": "1.0.0",
  "FriendlyName": "My First Mod",
  "Description": "A minimal ARDEM example mod.",
  "Category": "Mods",
  "CreatedBy": "YourName",
  "Modules": [
    {
      "Name": "MyFirstMod",
      "Type": "Runtime",
      "LoadingPhase": "Default"
    }
  ]
}

Step 3 — Configure the Build File

MyFirstMod.Build.cs
using UnrealBuildTool;

public class MyFirstMod : ModuleRules
{
    public MyFirstMod(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicDependencyModuleNames.AddRange(new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
            "ArdemCore",      // ARDEM base systems
            "ArdemGameplay",  // Player, items, world API
        });
    }
}

Step 4 — Write the Module

MyFirstMod.h
#pragma once

#include "Modules/ModuleManager.h"

class FMyFirstModModule : public IModuleInterface
{
public:
    virtual void StartupModule() override;
    virtual void ShutdownModule() override;

private:
    FDelegateHandle PlayerJoinHandle;
};
MyFirstMod.cpp
#include "MyFirstMod.h"
#include "ArdemModAPI.h"
#include "ArdemPlayerController.h"

DEFINE_LOG_CATEGORY_STATIC(LogMyFirstMod, Log, All);
IMPLEMENT_MODULE(FMyFirstModModule, MyFirstMod)

void FMyFirstModModule::StartupModule()
{
    IArdemModAPI& API = IArdemModAPI::Get();

    // Bind to the player join delegate
    PlayerJoinHandle = API.GetEventManager()->OnPlayerJoin.AddLambda(
        [](AArdemPlayerController* Player)
        {
            if (!Player) return;

            const FString Msg = FString::Printf(
                TEXT("Welcome to the server, %s!"),
                *Player->GetPlayerName()
            );

            Player->ClientSendChatMessage(Msg);
            UE_LOG(LogMyFirstMod, Log, TEXT("Player joined: %s"), *Player->GetPlayerName());
        }
    );

    UE_LOG(LogMyFirstMod, Log, TEXT("MyFirstMod loaded."));
}

void FMyFirstModModule::ShutdownModule()
{
    // Always clean up delegate handles on shutdown
    if (IArdemModAPI::IsAvailable())
    {
        IArdemModAPI::Get().GetEventManager()->OnPlayerJoin.Remove(PlayerJoinHandle);
    }

    UE_LOG(LogMyFirstMod, Log, TEXT("MyFirstMod unloaded."));
}

Hot Reload

During development you can use Unreal's Live Coding (Ctrl+Alt+F11) to recompile your plugin without restarting the editor or server. Changes to function bodies are applied immediately.