Cogito, ergo sum

Legacy:Mod Authoring/How To Build Your Package

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Now that your package is set up, you are ready to build it. You don't have any code written yet, so lets make a very simple useless mod. This will serve as a good example of making a new GameType.

In the MyPackage\Classes directory, create a file called MyGame.uc. Put the following code inside of it:

class MyGame extends DeathMatchPlus;
 
defaultproperties
{
	GameName="My Game"
}

This creates a class called MyGame that is a subclass of DeathMatchPlus. All we are doing is changing the name of the game... pretty simple. Notice the inheritance in action. All the code that makes up DeathMatchPlus is now a part of your game type.

Save the file and change directory to System. Type ucc make and watch the code burn. Pretty soon, your package will be compiled and a new MyPackage.u will be sitting in the System directory.

In order to make our new gametype show up in the menus, we have to give it a metaclass definition. Create a file in the System directory called MyPackage.int. INT files primarily contain localization information for foreign versions of the game, but they also contain extra information about the classes inside a package.

Add the following lines to your .int file:

 [Public]
 Object=(Name=MyPackage.MyGame,Class=Class,MetaClass=Botpack.TournamentGameInfo)

Save it and exit. When UT's menus search for games to list in the Game selection window, they search all the .int files in the System directory for classes that have a MetaClass of Botpack.TournamentGameInfo. Now your game will show up on that list. Start Unreal Tournament and go to Start Practice Session. Find your game on the list. If you start it, "My Game" will show up as the game's name in the scoreboard. Cool!

So that's how you build a basic project. Obviously writing a mod is a lot more complicated than that. Now we'll get down and really dirty by looking at the specifics of different types of mod.


Prev Page: Legacy:Mod Authoring/Setting Up Your ProjectSection 6 of 12 – Next Page: Legacy:Mod Authoring/Making A Mutator