# Thread: Getting Started Compiling a Mod

1. ## Getting Started Compiling a Mod

These are the basic steps you need to get your mod compiling and running in the game.

Mod source should be put in My Documents\My Games\Unreal Tournament 3\UTGame\Src, in a subdirectory of your package name. You put the .uc files in a further subdirectory named Classes.

Next, you need to tell the game that your package should be compiled. In UTEditor.ini under the section [ModPackages], add a line for your mod:
Code:
ModPackages=MyCoolMutator
Run "ut3 make" to compile your mod. The output script goes into My Documents\My Games\Unreal Tournament 3\UTGame\Unpublished\CookedPC\Script. Note the "unpublished". By default the game does not load files in this tree. This is so that you can choose to "cook" the mod (mostly for faster loading - only really useful for mods with a lot of custom content) or you can simply copy it into the Published branch. Since cooking/copying all the time is tedious, while testing you can pass the game the "-useunpublished" command line parameter to tell it to use the files in the Unpublished branch.

When you compile a mutator, gametype, or weapon, the compiler will automatically generate an .ini file for your mod package that tells the menus about it. You can opt out of this by setting the property bExportMenuData to false in your class's defaultproperties.

Feel free to post if you have questions or need help - that's what this forum is for.

2. I added mypackage to the UTeditor.ini but all i get when i run 'ut3 make -full' is

core - release
engine - release
gameframework - release
...
...
...
UTGameContent - release

//edit
when i run 'ut make' i get this message

3. Thanks for the quick reply Mysterial

But there is a mistake
Rypel figured it out: it is ModPackageS, with an S.

4. Thx Mysterial. But theres one typo in your tut. It should be "ModPackageS=MyCoolMutator" with the additional S. Then it works

5. Thanks, fixed the typo.

6. I get a standard windows crash (popup box come up with ut3.exe has encountered a problem etc) when I compile and it gets down to my package and writes "-------vyd-release-----------" like that. Any ideas? I'm pretty sure I followed the instructions

7. Thanks Mysterial you guys rock.
Now all I need is UT3...

8. I'm trying to run the basic of basic helloworld mutators as a test to make sure everything is working right, and to also get a feel for the engine again. But I'm having some issues.

I have successfully compiled the mutator, and i'm using the -unpublished and -log flags to get some output. I can see that it's trying to load my mutator, but its just saying...

Code:
Error: Error reading attributes for 'C:\Games\Unreal Tournament 3\Binaries\..\UTGame\Unpublished\CookedPC\Script\MutHelloWorld.u'
No idea's on whats causing this. Although the mutator does appear in the in-game lists. So I try to start a local instant action with my HelloWorld mutator and...

Code:
ScriptLog: Mutators MutHelloWorld.HelloWorld
Warning: Failed to load 'Class MutHelloWorld.HelloWorld': Failed to find object 'Class MutHelloWorld.HelloWorld'
So I have no ideas at all, anyone else got any?

Here's the code im using...

Code:
class HelloWorld extends UTMutator
config(Game);

function PostBeginPlay()
{
Super.PostBeginPlay();
}

defaultproperties
{
GroupNames(0)="TEST"
}
I'v also tried instead of function "simulated event" as that appears to be used about the place but no dice.

9. Originally Posted by Limi
i'm using the -unpublished
It's actually "-useunpublished"... I had another typo in my post... guess I didn't proofread it well enough

10. Now I don't have to wait for UDN to open

11. I'd be modding like a madman but I don't have the game yet for some reason, I can't figure out why!

12. so u r just as sick as i am im modding all day ... the only difference is that I HAVE THE GAME !!!!

13. Beat that: I don't have the game, but already coded two mutators.

14. Originally Posted by Wormbo
Beat that: I don't have the game, but already coded two mutators.
HAXXXXXXXXX!

15. Thanks for the info Mysterial! My German UT3 arrived so I can now start trying to get some form of RPG working for UT3 . Do you think the new menu system will allow something similar to UT2004RPG client side configuration with UT3?

16. I suggest you don't touch the GUI part until after the first patch. It's likely they're gonna add stuff that will come in very handy for you.

17. Originally Posted by Jrubzjeknf
I suggest you don't touch the GUI part until after the first patch. It's likely they're gonna add stuff that will come in very handy for you.
That would require patience, that's not me . I hope there will be some way to create client side guis, but if not I already designed some strategies to work around that.

18. Originally Posted by rans.m
I get a standard windows crash (popup box come up with ut3.exe has encountered a problem etc) when I compile and it gets down to my package and writes "-------vyd-release-----------" like that. Any ideas? I'm pretty sure I followed the instructions
I had the same problem. I was trying to copy an existing mod and modifying it. In my case the problem disappeared when I removed all defaultproperties except for Name.

19. Originally Posted by Wormbo
Beat that: I don't have the game, but already coded two mutators.
Owned!

So how do you export the existing U files? Need Harmon to get WotGreal Explorer working for these files.

20. wait so hows the story on exporting existing mutators from ut2k4 into ut3?

21. Originally Posted by Sarge-David
wait so hows the story on exporting existing mutators from ut2k4 into ut3?
Well they'd just be "ports" of them. There are already a few in the "User Mods" area.

22. so...if I follow the steps here i can make my own mods?

23. Originally Posted by TYF00N
so...if I follow the steps here i can make my own mods?
Best bet would be to take a look at the standard mutators that came with UT2 and the ones that came with UT3.. there are a few that are ported like Bighead and lowgrav.

take a look at the subtle differences between the two.

Then try an easy UT2 one and try porting it over...

That hardest part is getting used to the new folder structure.. but even that gets pretty simple once you've got it.

24. I'm picking up the game tomorrow and want to start coding right away. How do you get the source scripts? For UT2K4, I always just downloaded them, but I can't find the UT3 ones anywhere. Also, will WOTgreal work for this?

Edit: I remember the last UEd had a cript editor, but it was crap. Is the new one existent, usable, useful?

25. Originally Posted by jbizzler
I'm picking up the game tomorrow and want to start coding right away. How do you get the source scripts? For UT2K4, I always just downloaded them, but I can't find the UT3 ones anywhere. Also, will WOTgreal work for this?

Edit: I remember the last UEd had a cript editor, but it was crap. Is the new one existent, usable, useful?
In UED for UT3, goto the Actor Browser and do "File -> Export All Scripts"

That will put all the source into your My Documents\My Games\Unreal Tournament 3\UTGame\ExportedScript folder

26. Is there a way to change the directory? I don't use My Documents, actually I don't even use the drive it's on except to hold Windows.

27. Originally Posted by Angel_Mapper
Is there a way to change the directory? I don't use My Documents, actually I don't even use the drive it's on except to hold Windows.
Here is one hack I know of.. haven't tried it tho:
http://forums.epicgames.com/showpost...7&postcount=21

Here is also one from Microsoft themselves to change the way it works:
http://support.microsoft.com/?id=310147

But I'm with you, I'd rather have it all on my "Game" partition.

Also, as I was tired of losing my personal stuff when i reformatted my windows drive, I always keep a D:\My Documents folder and on the desktop you can right click and change the path quite easily to use this path. Now you never have to worry about it. Been doing that for nearly 10 years now across 98, ME, 2000 and XP... now it finally looks like I have another good reason to do that.

28. Would be very interested to know what the error message: "Error: Error reading attributes for " means - I too get this when I started up a server with my first ut3 addin.

The thing seems to run - so it may just be what you get when running from the unpublished directory.

I'm now looking forward to getting the game so I can test this darn code....

29. Originally Posted by Angel_Mapper
Is there a way to change the directory? I don't use My Documents, actually I don't even use the drive it's on except to hold Windows.
You could use a windows util called FSUTIL (if you use NTFS), which can basically let you have 1 file in two separate locations. Anything changed on one file will change the other, as they are really the same file. I know you can do this on a file-by-file basis but I haven't looked into using full directories. I'll look into it when I get back -- the pharmacy calls!

30. Originally Posted by Angel_Mapper
Is there a way to change the directory? I don't use My Documents, actually I don't even use the drive it's on except to hold Windows.
The MyGames folder is pure evil. It's really chaotic compared to the Ut2004 mod folder structure.

But you can actually store the mod content and scriptfiles in the directory where UT3 is installed. You just need to create a src folder in UTGame, or define your own in the ModPackages section in the UTEditor.ini file.
The compiled scriptfiles however, are always saved in MyGames\..\Script. But you can also copy the file over to \UTGame\Unpublished\CookedPC\MyMod in the UT3 directory. Content can be put there too.

31. Specifying -nohomedir might work but I haven't tried it.

32. After using it for about a week, I am starting to appreciate the My Games area... I didn't realize at first that you no longer need to put mutators and u files into the game installation area... everything stays in the custom folders.

This is good cuz UT2004 had soo much crap in the system folder that I was never sure what it was and was afraid to delete things cuz i didn't want to remove any core files.

I think tho, that the installer should at least ask you where you want to keep the custom stuff, rather than use the evil M$laden provided space. Keep in mind tho that if you want to use things in a game you don't want to use the "useunpublished" switch... you need to create a "Published" folder under MyDocs\MyGames\UT3\UTGame\ and out the u files there. You could also make a new CookedPC folder under that but it doesn't appear to be necessary, just as long as it is under "Published" it seems to work. This new structure really needs to be more well defined. 33. For released mods the MyGames folder is fine, but for development i find it a bit inconvenient. 34. ## More help getting started? Specific questions... Is there a simple tut somewhere that would explain how to do something basic with the new system? I am watching all the editor videos, but these really don't talk about coding structure, etc. Say, I wanted to take the rocket launcher, do something simple like change the color of it's skin, and then play with some of it's projectile coding. I would like to make a remake of the OMFG from UT2K4 just to use as a learning experience and to get used to the new program. So...I would have to start by making a OMFG directory....but where? Do I put it here: My Documents\My Games\Unreal Tournament 3\UTGame\Unpublished\CookedPC or here: C:\Program Files\Unreal Tournament 3\UTGame\CookedPC Then I create a subdirectory of that named Classes. I would then put the .u files that I am modifying in this directory correct? So for making changes to the rocket launcher I would use the file UTWeap_RocketLauncher.uc as reference. Now...because it is a new weapon, should I rename UTWeap_RocketLauncher.uc to OMFG.uc and change all the class references inside the file to class OMFG extends weapon or is just extending from UTWeap_RocketLauncher.uc better???? Now for changing the fire mode or something with the projectiles I would have to add more .uc files that make the changes to those...I think I can figure out that stuff. For changing the color, is it as simple as the statement I found in the default properties: WeaponColor=(B=0,G=0,R=255,A=255) In the past I would have looked for which texture was called out, then went into the editor and exported the texture, photo-shopped it, and then reimported it into the package. Now...with the way materials are being used, that is all different I believe. I don't even see a texture called out in the code. I'm used to seeing redskin=texture('blah'). So...lets say I have my changes made and I am ready to try and compile them. What is the directory I need to be in and what exactly do I type to compile the scripts? Are there switches to use with the compile command? When I compile, I suppose it gives me a .u file and a .ini file?? Where do I place them then to be able to test them in game? If I can get help on these questions, I will start to put together a tutorial for future coders that need help getting started like myself. I want to do this first and then look at doing a real simple vehicle to get working with vehicles down. Oh... one more question. If I downloaded a mod that someone else compiled. How can I decompile that .u file to .uc files? This would be a way to see how other people are structuring their scripts, so I have some frame of reference. Thanks for any help! EDGE 35. Oh... one more question. If I downloaded a mod that someone else compiled. How can I decompile that .u file to .uc files? This would be a way to see how other people are structuring their scripts, so I have some frame of reference. I don't think that has ever been possible, you'd just have to ask for it at the creators. And you have to put the files in here: My Documents\My Games\Unreal Tournament 3\UTGame\Src So that would be My Documents\My Games\Unreal Tournament 3\UTGame\Src\MyMutator\Classes The other things are good questions. 36. I don't think that has ever been possible I figured out most of it...look here: http://utforums.epicgames.com/showth...=585103&page=2 37. As it seems I'm not the only one that was lost in the structure... I will try to put up some tutorial of the structure, as best as I know it so far. Step 1: Never Touch the Game Install folder! Step 2: Assume for this tutorial that the Game install directory is: C:\Program Files\Unreal Tournament 3\ and the user path is: C:\My Documents\My Games\Unreal Tournament 3\UTGame Step 3: Open UED for UT3. Goto View->Browser Windows->Actor Classes Step 4: From the Actor Class Browser, goto File->Export All Scripts This will take about 3-5 minutes and UED may seem frozen during this time. Check your "user path" for a folder named "ExportedScript", that should start updating with script files for each of the games U files. Step 5: While waiting for Step 4 to complete, or even after it is done, create the following folders (if they don't already exist): C:\My Documents\My Games\Unreal Tournament 3\UTGame\Src C:\My Documents\My Games\Unreal Tournament 3\UTGame\UnPublished C:\My Documents\My Games\Unreal Tournament 3\UTGame\Published The Src directory is where you make mutators. Similar to the previous games, you create a folder named the same as you want the U file to have. Lets say "MyMut" So create the following structures: C:\My Documents\My Games\Unreal Tournament 3\UTGame\Src\MyMut\ C:\My Documents\My Games\Unreal Tournament 3\UTGame\Src\MyMut\Classes\ The Unpublished directory is where compiled code goes. When you run "Make" it will compile the script files and output a U file inside a "CookedPC" directory. This is the "temporary" area for keeping your test versions and stuff. The Published directory is where you put final stuff to play normally. Whenever you download a mutator from the internet, you would put that U file here. The mutator will likely come with a UTMyMut.ini file. You would put that file here: C:\My Documents\My Games\Unreal Tournament 3\UTGame\Config\ The Config file is the equivalent of the .int file from the other games. It has the information that the game needs to see it in the mutator list, the description, as well as find its In-game configuration menu (if any). Step 6: By now, UED for UT3 should be done exporting all scripts and you should see all the files in your C:\My Documents\My Games\Unreal Tournament 3\UTGame\ExportedScript folder. Step 7: If you want to export other U files that weren't in the game directory, like other mutators, etc. You would open a Cmd prompt and run this command: Code: "C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" BatchExport path\to\u\file.u class .uc path\to\destination\folder For example: Code: "C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" batchexport C:\MyMut.U class .uc "D:\My Documents\My Games\Unreal Tournament 3\UTGame\ExportedScript\MyMut\Classes\" Or you can make a batch file like this: Code: "C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" batchexport %1 class .uc "D:\My Documents\My Games\Unreal Tournament 3\UTGame\ExportedScript\~$n1\Classes\"
and just drag and drop the u file on top of the batch file. It will put all extracted files in the "Custom" folder. Modify this file to export other things besides class (images, smesh, etc)

Step 8:
When you are ready to compile your mutator using "Make" you need to perform the following steps:
1. Open your C:\My Documents\My Games\Unreal Tournament 3\UTGame\Config\UTEditor.ini file and look for [ModPackages]
2. Add a line under that header (the name matches the mutator folder name):
ModPackages=MyMut
3. Open a cmd prompt and run (including quotes):
"C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" Make

That may take about 10-20 secs before it starts but then it will compile just like ucc did in the older games.

Remember "Make" isn't folder specific, you can't tell the game to only "MAKE" one folder, it needs to run all the packages to understand it all. So make doesn't need anything passed into it.

You can also make a shortcut of the UT3.exe file and edit the command line to add make at the end (outside of the existing quotes)

Also note that "Make" will auto-create a UTMyMut.ini file. This file automatically goes into your user path "Config" folder. Be sure to include this file along with the U file when creating a zip package to share your mutator on the web.

38. Thank you, Thank you, Thank you!!!!!!!!!!!!

Kewl....you are kool!! This is exactly what I was looking for. I'm eating Turkey at a family get together, but when I get back home I will set up my directory structure and start doing some modding!!

Excellent Tutorial on the directory structure!

39. Now that we have mutators? How do we make them work on our servers? Is there a "ServerPackages" area? I haven't found one.

40. It should just work on a server. You don't need to do anything to make it download, etc.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•