Legacy:UTute1
This page is superseded by Setting Up UnrealScript and Regen Mutator.
It will be deleted as soon as we're all satisfied the new pages have all the material from here & all the links are changed :)
UTute 1: Setting Up
Making Games in the Safety of Your Home
Time to get busy. To create a mutator or mod for Unreal Tournament 2003, all you really need is a copy of the game and the tools it comes with. Course, it doesn't all come pre-assembled.
Step 1: Export the source code
You have two choices here. You can go to unreal.epicgames.com and download the UDE with the latest source code already decompiled. Extract this into your UT2003 folder and voila - you have the source code. The Class Tree has links to download the source code
OR you can go into UnrealEd 3, bring up the Script Editor and export the scripts from there. To do this, do UnrealEd Main Menu -> View -> Show Script Editor and then in the editor do File -> Export all scripts. Nine times out of ten, UED will then crash (unless that bug has been fixed) - but you will generally get the source code.
If you look at your UT2003 directory now, there should be about a dozen new folders. Inside each of these folders should be at least one subfolder "Classes", containing a bunch of .uc files. UC is the uncompiled unrealscript extension while U is the compiled extension. The folders all represent packages. A package in OO design is pretty much just the grouping of specific types of files. UT2003 has a lot more organization to it than UT did, more fully seperating out weapon classes from effect classes and so on.
Step 2: Make Your Own Package
While some editors don't require you to do this by hand, it's so easy it seems silly not to. To create your own package that the compiler will recognize, just create a new directory named the same as your package e.g. "MyPackage". In it, make a subdirectory called "Classes". Finally, open your UT2003.ini and find the list of "EditPackages". Add "EditPackages=MyPackage" to the list. The compiler will now attempt to compile your package with the rest.
Quicknote about the order of EditPackages - if you have one package dependant on the other, the dependant package must come after the other one. Notice how the first package in the list is "Core"
Now go to your command prompt, CD down to your UT2003/System directory and type ucc make. Voila! You get ... an error! That's because your package is completely empty. Let's quickly fix that.
Step 3: Make a Quickie Mutator
Go into the directory/package XGame and open the file "MutRegen.uc" with notepad. Promptly "Save As" with this file as the file "MutRegenPlus.uc" into your package's classes directory. You should take caution to never directly edit any of the classes that came with the game. If you do, the package size will become invalid, you won't be able to play online and you might possibly break the game itself.
Your first step to making MutRegen your own is changing the classname to match what you saved the file as. So change:
//=============================================================================
// MutRegen - regenerates players
//=============================================================================
class MutRegen extends Mutator;
to:
//=============================================================================
// MutRegenPlus - regenerates players plus!
//=============================================================================
class MutRegenPlus extends Mutator;
Now what fun is modding if you don't modify anything? Take the line down below that says:
if (C.Pawn != None && C.Pawn.Health < C.Pawn.HealthMax )
{
C.Pawn.Health = Min( C.Pawn.Health+RegenPerSecond, C.Pawn.HealthMax );
}
And change it to:
if (C.Pawn != None && C.Pawn.Health < C.Pawn.HealthMax*2 )
{
C.Pawn.Health = Min( C.Pawn.Health+RegenPerSecond, C.Pawn.HealthMax*2 );
}
You just altered the second variable of the Min function, which is essentially the cap that can be returned. Now, save your file, make sure your package is in "EditPackages" (ucc may have removed it if you got the error above) and "ucc make" again. At the end, you should get:
-------------------------MyPackage - Release--------------------------
Analyzing...
Parsing MutRegenPlus
Compiling MutRegenPlus
Importing Defaults for MutRegenPlus
Success - 0 error(s), 0 warning(s)
D:\UT2003\System>
Quicknote on compiling - I ran into this while testing out this tutorial...if you don't see the above, make sure the UT2003.ini file hasn't been rewritten again without your EditPackages line in it. If it has, make sure you've closed out any programs which might have it opened after putting it back in and recompiling.
And in your System directory, there should be a MyPackage.u file. However, there are two more steps before you can see your new code work in the game. The code is there, but you have to tell the game to see it. In UT2003, this is done in two places. First, go back to your MutRegenPlus source and look at the bottom. Every class in Unreal has default properties (even if you don't seem them, that just means they are using the properties of a parent class). Mutators in UT2003 take advantage of three specific properties in the game. We will go over more of their meaning in the next UTute, but for now just change the section that says:
GroupName="Regen"
FriendlyName="Regeneration"
Description="All players regenerate health."
to:
GroupName="Regen"
FriendlyName="Regeneration Plus"
Description="All players regenerate health to superhealth limits."
Finally, you'll need to make an INT file named after your package in the System directory. This is a file which will describe to the engine the most basic parts of your package. For now, just copy:
[Public]
Object=(Class=Class,MetaClass=Engine.Mutator,Name=MyPackage.MutRegenPlus,Description="Regeneration Plus")
And save it into the MyPackage.int file. Recompile your code and start up UT2003. Go into Instant Action, select "Regeneration Plus" into your mutator list, and watch as you regenerate to 200 health.
Step 4: Choose an editor
Many modders just use notepad and ucc make to handle their classes. Others prefer a more interactive development environment. Epic has offered up UDE as a possible solution. Another excellent solution is WOTgreal. I prefer wotGreal (wotgreal.com), because it has a couple of features (find declaration, easy handling of int files) I prefer. It's good to find an environment that makes you feel comfortable.
There's a list of editors on the Applications page.
Related Topics
Continue to UTute2: A Modify Mute (Cooler)
Back to the UTutes Table of Contents.
This page and Getting Started In UnrealScript need merging - maybe call it Setting Up UnrealScript
MinisterFish: I'm working on merging them.