Hello World example
This is a step by step guide to create a simple mod that prints "Hello World" on the screen. These instructions are based on this video. You can follow either the video or the written steps below. This tutorial is created for the OB57 version of the game.
Dummy source files
Parts of Paladins are written in UnrealScript. When making mods, your code may reference classes and functions from the base game. These scripts are stored inside .upk packages located in <Paladins install folder>/ChaosGame/CookedPCConsole. Examples include "PlatformCommon.upk" and "TgGame.upk".
However, you do not need to have the real source code to compile your mod. You only need to have dummy (stub) source files that only contain class and function definitions. These files are only used during the compilation and do not contain any real implementations.
You can download the OB57 dummy files from here. Extract and place them into the Developement/Src folder and replace any existing files if prompted.
The dummy files need to also be included in the file: C:\UDK\<UDK project>\UDKGame\Config\DefaultEngine.ini. Open the file and find the section [UnrealEd.EditorEngine]. Add lines to make it look like below:
[UnrealEd.EditorEngine]
+EditPackages=CustomGame
+EditPackages=AkAudio
+EditPackages=PlatformCommon
+EditPackages=TgGame
+EditPackages=TgClientThe scripts are compiled in the order that they are listed here.
Modifying the code to print Hello World
- Create a folder with your mod name and a Classes folder inside it if you haven't already.
- Copy files from the TgMod folder into your folder. We'll use them as a starting point.
- Open
TgMutator.ucwith any text editor. - Find the Init() function and modify the messages to your liking. For example:
m_TgPC.ClientMessage(">> HELLO WORLD! <<", , 30.0);- Save the file
Compiling and testing
The easiest way to compile is using Tempest:
- Open the settings menu where you have your builds.
- Enable Developer Mode.
- Under "Projects" add your UDK project folder.
- For example:
C:\UDK\Paladins
- For example:
- Under "Scripts" add the folder off your mod.
- For example:
C:\UDK\Paladins\Development\Src\MyMod
- For example:
- Click "Compile".
- Close the terminal when it finishes.
- Click Ok in the dialog that opens.
- Tempest automatically adds the mod to your game.
- Launch the game.
- Run this console command, replace MyMod with your mod's name.
switchlevel BMM_P_v01?game=siege?mutator=MyMod.TgMutator
- You should see the custom message.
The compiled UPK file is in the folder C:\UDK\<UDK project>\UDKGame\Script.
