Making a Batch File
Command Line Arguments
- Batch File
The first step towards learning how to make your own server is learning how to make a batch file. It all starts with Notepad - so open up a copy of Notepad. Since we are trying to make an Unreal server, then we are going to want to execute Unreal.exe. In order to do this, we simply type the path name to the file. For example, if your Unreal is installed in C:\Unreal, then you would type this in notepad:
Simple enough, eh? After you type that, go to file --> Save. Choose a location that you would like to save the file in. On the bottom where you see the "Save as type" drop down box, by default is says "Text Documents (*.txt)." But we do not want to create a text document - we want to make a batch file. So click on the drop down box and set it to "All Files." After you've done that, give your file a name, and add ".bat" to the end. So if I wanted to name my file "BatchTest," I would type "BatchTest.bat" into the filename box. Next, click save. So now, navigate to the place where you saved the batch file and double click on it. What happened? Unreal opened! Now that you've learned how to create a simple batch file, we'll move on to command line arguments to make Unreal launch as a server.
- Command Line Arguments
Every time you launch Unreal through a batch file, you have the option of typing extra parameters onto the end of the line to alter the way Unreal launches itself. To make a server, you would attach "-server" onto the end of the line. If your Unreal is located in C:\Unreal, then your server launch command would look something like this:
Not bad, eh? Now what if you want to change the map that the server starts up on? Not a problem! Simply insert the map name after Unreal.exe. For example, if you wanted to open the server on DmDeck16, the command would change to this:
C:\Unreal\System\Unreal.exe DmDeck16 -server
But we are not finished yet. Opening a server like this does us no good if we don't assign a gametype to the server. A gametype is any class within an Unreal package that contains code to designate the game operates. "DeathMatch" and "Team Game" are examples of gametypes. Certain mods (such as EDM) contain their own special gametype classes. But for now, we will practice with the usual Unreal gametypes. The Unreal gametype for DeathMatch is UnrealShare.DeathMatchGame. The extra parameter to set the gametype is "?Game=(GAMETYPE)." So if we wanted to launch our server on deck16 in a deathmatch game, our command line would look something like this:
C:\Unreal\System\Unreal.exe DmDeck16?Game=UnrealShare.DeathMatchGame -server
Making sense? Likewise, if we wanted to run any mutators on our server, we can do that through the command line too with the "?Mutator=(MUTATORCLASS)" parameter. If we wanted to run a Deathmatch Game on Deck16 with a mutator class called MyMutator.MyMutatorClass, we would do:
C:\Unreal\System\Unreal.exe DmDeck16?Game=UnrealShare.DeathMatchGame?Mutator=MyMutator.MyMutatorClass -server
My EDM mod specifically has special variable fields inside EnhancedDM.ini called EstablishedMutators that make it unnecessary to use the "?Mutator=" parameter, but it's worth mentioning for those of you reading who want to run a mutator and are not using EDM :)
Now that you know how to create your own batch file that launches a server with any map or gametype of your liking, we can move on to ServerPackages...
Some mods that you run on your server may require you to look in your Unreal.ini for a section that is known as "ServerPackages." Everything in the ServerPackages section names files that every player must download off your server before being allowed to enter.
Lets say you download a mutator, and a read-me file that comes with the mutator says that the mutator class is SomeMutator.SomeMutatorClass and it also says that the mutator needs to be entered into your server packages. Well, you already know from the previous section how to start up your server from a batch file with a mutator class, but how the heck do you enter something into server packages? Since the class is SomeMutator.SomeMutatorClass, that means that the actual file name is SomeMutator.u, and the mutator package is simply: SomeMutator
(As a side note, the same rules apply for textures, sounds, and music. If you have SomeTexture.utx, then the texture's package name is simply: SomeTexture)
So, what you do is you open Unreal.ini and do a search for "ServerPackages" and you should come across a section with quite a few entries. You may see ServerPackages=Female1Skins, ServerPackages=Male3Skins, etc...go to the bottom of the list and make your own entry:
You have now told your server that the "SomeMutator" package is required for every player to download before entering the server. With this mutator package in your server packages, you can now start up the server with the proper command line from your batch file and have the server running without an issue.
Now that you understand what batch files, command lines, gametypes, mutator classes and server packages are, you should be able to comprehend the EDM installation instructions without a problem.
Back to Main Page