Unreal Tournament 3 Script Setup

Part 2: Compiling a mutator

What this tutorial explains

This tutorial explains how to write, compile, configure, test and release a mutator from scratch. The tutorial includes instructions for creating a small sample mutator called UT Noir that lets you play the game in black and white.

What this tutorial does not explain

This tutorial does not explain how to write code. The UT Noir sample mutator source code is provided to get you started with a bit of script that is guaranteed to work.

The sample mutator

UT Noir

This sample mutator is provided to get you started with an example that is guaranteed to work. It is very basic and will let you play the game in black and white.

Open Notepad and copy the following text into it:

Save the file in Unicode format as My Documents\My Games\Unreal Tournament 3\UTGame\Src\UTNoir\Classes\Mutator_UTNoir.uc.

Compile

Now we're getting there!

Unicode

Make sure your script files are saved in Unicode format or you will get the following compile error:

ModPackages

Before you can begin compiling your code, you have to tell the game about your mod. Open My Documents\My Games\Unreal Tournament 3\UTGame\Config\UTEditor.ini in Notepad and search (Control+F) for [ModPackages]. Underneath the line that reads ModOutputDir=..\UTGame\Unpublished\CookedPC\Script, add the following line:

For example, if you are adding the UT Noir mutator, you would add this line:

UT3.exe

Create a shortcut to Program Files\Unreal Tournament 3\Binaries\UT3.exe and rename it to UT3 make. Right-click it and choose Properties. At the end of the Target, add a space followed by the word make. It should now look like this:

Double-click the shortcut to compile! A window should pop up and some text should flash by. If you made no coding errors, it should end up looking like this:

Congratulations!

Configure

The compiler saved the compiled mutator and its configuration settings file in the following locations:

For example, if you just compiled the UT Noir mutator, you would end up with these files:

Mutator name and description

Open your mutator's configuration settings file in Notepad and edit the following values:

You can use spaces in the name, but you cannot use multiple lines in the description.

For example, the UT Noir mutator's configuration settings should look like this:

Save the configuration settings file.

Test

You must publish (or "cook") your mutator before you can test it. To publish it, simply move the compiled mutator file to the My Documents\My Games\Unreal Tournament 3\UTGame\Published\CookedPC\Script folder.

Launch the game, select a map, select your mutator (it should be somewhere at the bottom of the list) and watch what happens!

Release

Upload a zip file containing the mutator .u file and the configuration settings .ini file in the proper folder structure (or include instructions on where they go).

Notes

UT3.exe automagically determines which mod packages have to be recompiled by remembering when they were last modified. If you make any changes to a package, it will be recompiled next time you use UT3.exe make.

If you have multiple ModPackages listed and update one of them, all packages below that package will also be recompiled.