I'm a doctor, not a mechanic

UE3:Hello World

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 02:15, 13 June 2010 by Wormbo (Talk | contribs) (no underscores in links)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Assuming you have read the first UT3 lesson on UT3 Whats What, You should be ready to make your first mod.

The simplest of mods is the "Hello World" mutator.

Getting Ready[edit]

Go to "My Documents\My Games\Unreal Tournament 3\UTGame\Src" (or equivelent) and create a new folder. The folder name will be the package name for your mod. For this tutorial, name the folder "HelloWorld". In this folder, create another folder called "Classes". The Classes folder is where all your source files will go.

Open up "UTGame\Config\UTEditor.ini" and find the [ModPackages] section, and add to it a line that reads "ModPackages=HelloWorld"

Save and close the file.

Create a file in "UTGame\Src\HelloWorld\Classes" and name it "HelloWorld.uc" and open it for editing.

Either open notepad and Save As, or create a new .txt document and rename it, making sure that it has the correct file extension. (By default, windows hides known file extensions. This can be disabled in Tools>Folder Options...>View.)

The Code[edit]

class HelloWorld extends UTMutator;
 
function InitMutator(string Options, out string ErrorMessage)
{
    loginternal("Hello, World!");
    Super.InitMutator(Options, ErrorMessage);
}

Note: The class name must be the same as the file name.

Either by command line or shortcut, run 'ut3.exe make' to compile it. There should be no errors.

In the same manner, run 'ut3.exe -useunpublished' and start a game with your mutator. When the mutator is loaded, "Hello, World!" will be output to a log file.

The log file will be found in "UTGame\Logs\".

Congratulations, you've made your first UT3 mutator.