BF42 mods for TPU server
- Sunday, October 25 2009 @ 09:01 AM PDT
- Contributed by: Jeff Rivett (site admin)
- Views: 8,588
Several people have asked how I modded my server to increase the numbers of tanks and planes, how I added extra planes to carriers, how I changed the types of units spawned and how I was able to do all that without creating new maps that need to be downloaded. Well, read on for the gory details.
Server content check setting
In order for server-side mods to work properly, you have to make a change to your server configuration. In the serversettings.con file, change the game.serverContentCheck setting to '0':
game.serverContentCheck 0
If you don't change this setting, players who try to join your server will see this error message: "DATA DIFFERS FROM SERVER", and they will not be able to join.
Adding more tanks and planes to standard BF42 maps
I modify the maps on my main PC in my regular BF42 client folder, test them there in single player mode, then copy them to the server. You'll need to use WinRFA from the Battlefield Mod Development Toolkit (see 'Files and links' in the left sidebar).
[1] Back up the RFA files for the map so you can revert if you mess something up. Or you can just make a backup of the whole maps folder (e.g. copy D:\Battlefield 1942\Mods\bf1942\Archives\bf1942\levels to C:\BF1942MapBackups).
[2] Create a folder for your work (e.g. C:\BF1942Data). We'll call this the main data folder.
[3] One by one, using WinRFA, open and extract all the files for the map (e.g. \Battlefield 1942\Mods\bf1942\Archives\bf1942\levels\Tobruk.rfa, Tobruk_001.rfa, Tobruk_003.rfa, etc.) into a subfolder of the main data folder (e.g. C:\BF1942Data\Tobruk). There may be more than one source file, but unpack them all into the same folder.
[4] You might also want to consider moving the contents of the resulting bf1942\levels\<mapname> folder up to the root of the map folder and deleting the bf1942 folder to keep things simple. For example, move all the files in C:\BF1942Data\Tobruk\bf1942\levels\Tobruk to C:\BF1942\Data\Tobruk and then delete C:\BF1942Data\Tobruk\bf1942. But this is optional.
[5] Use a text editor such as Notepad to modify the file SinglePlayer\ObjectSpawnTemplates.con, replacing all the lines for each aircraft and tank spawner section after the two lines indicating which aircraft (/tank) will spawn with these lines:
ObjectTemplate.MinSpawnDelay 10 ObjectTemplate.MaxSpawnDelay 15 ObjectTemplate.SpawnDelayAtStart 0 ObjectTemplate.TimeToLive 30 ObjectTemplate.Distance 20 ObjectTemplate.Radius 20 ObjectTemplate.DamageWhenLost 10 ObjectTemplate.MaxNrOfObjectSpawned 6
[6] SOME maps (XPack1 and XPack2) require that you do the same thing for Conquest\ObjectSpawnTemplates.con as well.
[7] Repack the modified map directory with WinRFA as follows:
- source directory is the one where we made the changes above; the main folder for the map (e.g. C:\BF1942Data\Tobruk); if you left the extracted files where they were originally, this would be C:\BF1942Data\Tobruk\bf1942\levels\Tobruk
- base path is bf1942\levels\<mapname> (e.g. bf1942\levels\Tobruk)
- save in the folder where we got the RFA files to begin with (D:\Battlefield 1942\Mods\bf1942\Archives\bf1942\levels) (Note that this will overwrite your game client files for that map, meaning that from now on, when you play this map, you will be playing the new version. So now you can understand why it's important to back up your map files before you start making changes.)
[8] Delete any additional RFA files in the source folder (Tobruk_000.rfa, Tobruk_003.rfa, etc.) There should be only one big RFA file for the map when you're done.
[9] Test the map in BF42 in single player mode.
[10] Copy the new RFA to the same folder on the server and delete the extra RFAs for those maps as well (Tobruk_000.rfa, Tobruk_003.rfa, etc.)
Planes on Carriers
As for changing the carrier spawners, I had forgotten how much of a pain in the ass that was. I eventually figured out that you have to unpack the main OBJECTS.RFA file (in \Battlefield 1942\Mods\bf1942\Archives) and modify the spawners in the carrier objects. For extra carrier planes in Midway, I made the following changes to the Vehicles\Sea\Enterprise\Objects.con file in the unpacked OBJECTS.RFA:
rem *** Enterprise_corsairSpawner *** ObjectTemplate.create ObjectSpawner Enterprise_corsairSpawner ObjectTemplate.setObjectTemplate 1 corsair ObjectTemplate.setObjectTemplate 2 corsair ObjectTemplate.minSpawnDelay 10 ObjectTemplate.maxSpawnDelay 10 ObjectTemplate.TimeToLive 120 ObjectTemplate.Distance 20 ObjectTemplate.spawnOffset 0/0/0 ObjectTemplate.holdObject 1 ObjectTemplate.team 1 ObjectTemplate.MaxNrOfObjectSpawned 6 rem *** Enterprise_sbdSpawner *** ObjectTemplate.create ObjectSpawner Enterprise_sbdSpawner ObjectTemplate.setObjectTemplate 1 SBD ObjectTemplate.setObjectTemplate 2 SBD ObjectTemplate.minSpawnDelay 10 ObjectTemplate.maxSpawnDelay 10 ObjectTemplate.TimeToLive 120 ObjectTemplate.Distance 20 ObjectTemplate.spawnOffset 0/0/0 ObjectTemplate.holdObject 1 ObjectTemplate.team 1 ObjectTemplate.MaxNrOfObjectSpawned 6
As well as similar changes to the Shokaku objects.con.
When re-packing the Objects.rfa file using WinRFA, the base path is just Objects.
Swapping Units
Finally, if you want a certain kind of plane, tank or any other type of unit to spawn instead of what currently spawns somewhere, you should be able to simply change the name of the unit in SinglePlayer\ObjectSpawnTemplates.con. For example, in Guadalcanal, to change a Corsair spawner to a Mustang spawner, this:
ObjectTemplate.create ObjectSpawner FighterSpawner ObjectTemplate.setObjectTemplate 2 corsair
becomes this:
ObjectTemplate.create ObjectSpawner FighterSpawner ObjectTemplate.setObjectTemplate 2 mustang
- Updated 2010Oct04: fixed formatting problems, added unit swap instructions.
- Updated 2011Oct18: converted article to HTML format because of recurrence of formatting problems.