Welcome to jdrgaming.com Monday, March 18 2024 @ 10:33 PM PDT

BF42 mods for TPU - part two

DarkRyda picked up the modding efforts for TPU where I left off. Originally TPU was mainly about adding tank and plane spawns to all the original and XPack maps, including planes on carriers. As you all know by now, DarkRyda's map mods go way beyond that, while keeping the spirit of TPU the same: namely, that you can always catch a ride in a tank or plane. What follows are Ryda's notes on the modding he has done for TPU. -- Jeff


The first thing to remember when modding maps is to make a copy of everything as it is originally. Make a folder somewhere and copy all the maps you have right now to that folder. This way when you need an original file later you will have it. The reasons for this are: 1. sometimes you won't be able to join a server without the original map (everyone must have the same version); and 2. when you mess a map up when modding, you can always go back and use the original copy. Sometimes people mess up their maps and the game won't start any more; they end up completely reinstalling Battlefield 1942. Being able to go back with a fresh copy of the original will save you from having to do this.

Jeff's first how-to note on modding should have taught you how to extract maps, mod them a bit and then repack them. That's a big thing; it makes the entire process a lot easier once you learn that process.

Now that you have learned how to increase spawn rates, I'm gonna go over a few advanced things.

ADDING/SWAPPING UNITS

If you want to add a tank or plane to a map that currently doesn't have those units on the map, there are a couple of key things to remember. First you have to keep the map as "pure" as possible. Pure means anyone can still log into a server where that map is running and play it. A map nobody but you can play is "unpure" and is no fun at all. There are a certain number of templates you can use in every map; some have more than others. You can only use the original templates provided if you want to keep a map pure. If you add templates it renders the map unpure and nobody can join, hence it would not be a good online map. Sometimes there are templates that are not even being used; sometimes there are two templates for the same things. Sometime there are templates for things nobody ever uses, such as APCs. These are the templates I use to add different units to the TPU server.

I also use Battlecraft to help me as a tool for modding maps. I don't actually use the program to make the modifications, I simply use it to see what things would look like on the map, if they fit in a certain place, and most importantly, I use it to determine the coordinates for added units. Unfortunately every single added unit must be hand typed into the map files. Once you have done this a few times and see how time consuming it can be, you can see how much care is actually put into the TPU server itself.

Another thing to always keep on hand is the TPU style template properties; this the secret to the TPU server:

ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 15
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.Radius 20
ObjectTemplate.DamageWhenLost 10
ObjectTemplate.MaxNrOfObjectSpawned 6
Here is an example of El Alamein's original objectspawntemplates.con file:
ObjectTemplate.create ObjectSpawner lighttankspawner   ---------> light tanks  KEEP
ObjectTemplate.setObjectTemplate 2 sherman
ObjectTemplate.setObjectTemplate 1 panzeriv
ObjectTemplate.MinSpawnDelay 40
ObjectTemplate.MaxSpawnDelay 80
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

ObjectTemplate.create ObjectSpawner heavytankspawner   ---------> heavy tanks KEEP
ObjectTemplate.setObjectTemplate 2 m10
ObjectTemplate.setObjectTemplate 1 Tiger
ObjectTemplate.MinSpawnDelay 70
ObjectTemplate.MaxSpawnDelay 110
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

ObjectTemplate.create ObjectSpawner APCSpawner   --------------> POSSIBLE SPARE
ObjectTemplate.setObjectTemplate 2 M3A1
ObjectTemplate.setObjectTemplate 1 Hanomag
ObjectTemplate.MinSpawnDelay 35
ObjectTemplate.MaxSpawnDelay 55
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

ObjectTemplate.create ObjectSpawner willyspawner   ------------> main car spawner KEEP
ObjectTemplate.setObjectTemplate 2 Willy
ObjectTemplate.setObjectTemplate 1 Kubelwagen
ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 30
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

ObjectTemplate.create ObjectSpawner ScoutCarSpawner  -----------> second car SPARE
ObjectTemplate.setObjectTemplate 2 Willy
ObjectTemplate.setObjectTemplate 1 Kubelwagen
ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 30
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

The APC spawner and the second car spawner can be used to add units. This way most of the map stays the same and you don't have to move much around. If you change the APCspawner to spawn different units they will take the place of the APCs on the map. In this case at El Alamein, that includes the APCs at both bases. As for the second car spawner, it does not have any locations on the original map. If you were to use this template, you would also have to add new spawn locations to the objectspawns.con file. I'll get to that later. Okay, let's say we want to change the APCs at El Alamein to artillery pieces: Wespe and Priest. All you have to do is swap out the units in the template as just shown, then change its properties to spawn more than one unit at a time.

Before:

ObjectTemplate.create ObjectSpawner APCSpawner   
ObjectTemplate.setObjectTemplate 2 M3A1
ObjectTemplate.setObjectTemplate 1 Hanomag
ObjectTemplate.MinSpawnDelay 35
ObjectTemplate.MaxSpawnDelay 55
ObjectTemplate.SpawnDelayAtStart 0                original template
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

After:

ObjectTemplate.create ObjectSpawner APCSpawner   
ObjectTemplate.setObjectTemplate 2 priest
ObjectTemplate.setObjectTemplate 1 wespe
ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 15
ObjectTemplate.SpawnDelayAtStart 0                TPU Server style template
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.Radius 20
ObjectTemplate.DamageWhenLost 10
ObjectTemplate.MaxNrOfObjectSpawned 2   ----->  set to only spawn 2,  this can be increased to a max of 6

Now all locations at El Alamein that used to spawn APCs will spawn artillery the TPU way.

Now let's say we want to use the second car spawner to add planes: Mustangs and Zeros. You would do the same thing...

Before:

ObjectTemplate.create ObjectSpawner ScoutCarSpawner  
ObjectTemplate.setObjectTemplate 2 Willy
ObjectTemplate.setObjectTemplate 1 Kubelwagen
ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 30
ObjectTemplate.SpawnDelayAtStart 0                original template
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10

After:

ObjectTemplate.create ObjectSpawner ScoutCarSpawner  
ObjectTemplate.setObjectTemplate 2 mustang
ObjectTemplate.setObjectTemplate 1 zero
ObjectTemplate.MinSpawnDelay 10
ObjectTemplate.MaxSpawnDelay 15
ObjectTemplate.SpawnDelayAtStart 0                TPU Server style template
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.Radius 20
ObjectTemplate.DamageWhenLost 10
ObjectTemplate.MaxNrOfObjectSpawned 6

Since there were two car templates, all the original car templates are being used by the willyspawner template. The second car template has no locations yet, so you will have to add them yourself. I use Battlecraft to find locations on maps for Battlefield maps. I don't actually mod the maps within the Battlecraft program, I just use it to find locations so I can type them into the objectspawn file. First, open Battlecraft and load up El Alamein, then go to each airfield and find a good spot for a plane or two, then simply add a new plane in those locations, spinning them around to face the right way as needed. Then when you're done and it looks like a good spot, you double-click on the plane and its coordinates will pop up. Use these coordinates in the objectspawns file.

Here is an example of the plane locations at the Axis airfield at El Alamein... in the objectspawns file:

Object.create FighterSpawner                      <------Template being used for this location
Object.absolutePosition 265.919/41.4279/1289.97   <------Location on the map
Object.rotation 161.519/-13.4245/0.0279846        <------Which direction the unit is facing when spawned
Object.setOSId 5                                  <------Which flag is being used to spawn this unit
Object.setTeam 1                                  <------Team the unit is being spawned for at start of game 
rem
rem ***  ***
rem
Object.create FighterSpawner 
Object.absolutePosition 297.125/41.4631/1300.55
Object.rotation 160.346/-14.0447/0.0862427
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem
Object.create DiveBomberSpawner 
Object.absolutePosition 289.082/41.7822/1275.25
Object.rotation 159.736/-11.1299/1.52588e-005
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem

Once you have the coordinates for a new plane you must write up a new location in the map files, using the second car spawner template:

Object.create ScoutCarSpawner  
Object.absolutePosition 
Object.rotation 
Object.setOSId 5
Object.setTeam 1

When you're done, the objectspawns file should look like this....

Object.create FighterSpawner 
Object.absolutePosition 265.919/41.4279/1289.97
Object.rotation 161.519/-13.4245/0.0279846
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem
Object.create FighterSpawner 
Object.absolutePosition 297.125/41.4631/1300.55
Object.rotation 160.346/-14.0447/0.0862427
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem
Object.create DiveBomberSpawner 
Object.absolutePosition 289.082/41.7822/1275.25
Object.rotation 159.736/-11.1299/1.52588e-005
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem
Object.create ScoutCarSpawner  
Object.absolutePosition         <-----add coordinates here
Object.rotation                 <-----add the units rotations here
Object.setOSId 5
Object.setTeam 1
rem
rem ***  ***
rem

If you do it all right, when you play El Alamein, there should be a new plane sitting on the Axis airfield. If you wanted to add more than one you would have to make two ScoutCarSpawner locations and add the numbers accordingly. The same process can be used to add more tank locations on the map too. Simply make a copy of a tank location and add new coordinates. You can add up to 999 spawn points for each template. Use Battlecraft to find out which flag you need to use for each added unit: in El Alamein the Object.setOSId 5 is the flag at the Axis main base. If you were to set all new units to this flag they would always be German tanks or planes, so remember that. Each new location should be using the closest flag; sometimes that can get confusing and each map is different. A trick I use in Battlecraft (again) is: I find the flag closest to where I'm gonna add something; I double-click on something already being spawned by that flag (a tank, MG, whatever) then look at its coordinates in the objectspawns file. If it says Object.setOSId 2, then all the units I add around that flag will use that flag ID. Use the same process for the next units you want to add by the next closest flag.


Understanding how to use the ObjectSpawns CON file

Here is a simple example of what a spawn point looks like in the objectspawns file, and an explanation of what each line means:

Object.create spawner  ----------->  which template is being used
Object.absolutePosition x/y/z ---->  location on the map
Object.rotation x/y/z ------------>  which way the vehicle is facing/tilted
Object.setOSId 0 ----------------->  what flag is being used to spawn this vehicle
Object.setTeam 0 ----------------->  what team the vehicle spawns for at the start of the game

Now I'll explain in detail how to control things a little better.

Object.create spawner  ----------->  which template is being used

In this line you would use whatever template you want this location to spawn. For instance if you want a light tank you would use the lighttankspawner template. Same thing if you were adding artillery: you would use the artilleryspawner template. Note: if you mistype the spawner name the location will not work.

example  Object.create lighttankspawner
Object.absolutePosition x/y/z ---->  location on the map

In this line you will use numbered coordinates to define the vehicle's location on the map. Picture the map as a 3-D grid:

  • X = a location going north or south. The bottom or south side of the map is 0; the higher the number the farther north the location is.
  • Y = an elevation location on the map. The higher the number, the higher the elevation.
  • Z = a location going east or west. The left or west side of the map starts at 0; the higher the number, the farther east the location is.
Object.rotation x/y/z ------------>  which way the vehicle is facing/tilted

In this line you will use numbered coordinates to define which direction the vehicle is pointing, and if needed, how the vehicle is tilted.

  • X = this number defines the direction. 0 means it is facing north. 90 means it's facing east. 180 means it's facing south. -90 means it is facing west.
  • Y = which way the vehicle is tilted long ways. Most of the time this is 0 (flat). If you filled Y in as 90, the vehicle would spawn facing straight up and would explode.
  • Z = which way the vehicle is tilted sideways. Most of the time this is 0 (flat). If you filled Z in as 90 the vehicle would spawn on its side and explode.<.li>
Object.setOSId 0 ----------------->  what flag is being used to spawn this vehicle

Every flag has a number. All maps are different, so this gets confusing sometimes. It's kinda important to make vehicles that are close to a certain flag use that flag to spawn those vehicles. There can be up to seven total flags and each one has an ID number, so each vehicle being spawned by that flag must have the same ID number as well. Usually when I add units I write down each flag's ID number and I add units around one flag at a time. If you use a different flag ID, that vehicle will spawn even when the flag it is closest to is grey.

Object.setTeam 0 ----------------->  what team the vehicle spawns for at the start of the game

This is optional. 0 = neutral; 1 = Axis; and 2 = Allied. Almost all of the time it doesn't matter what this is set to, because if the location already has a flag ID it will spawn the vehicle for whatever team controls that flag. So most of the time the Object.setOSId overrides this.