Server Side Modding

The Official Modding Resource for Battlefield 1942 and Battlefield Vietnam
It is currently Mon Oct 19, 2009 5:30 pm

All times are UTC - 6 hours [ DST ]


Getting Started
Getting Started
Prepping Your Files
  Testing Methods
Auto-Start Map
True Testing Enviroment
General How-To's
Stop Base Camping
Removing Out Of Bounds
Stop Base Camping 2
Disabling Parachutes
Add Repair Points
Add Spawn Points
Paradrops
Main Base Swapping
Modifying the Point System
Conquest Ticket System
Making CTF Versions of Maps
Vehicle How-To's
Replace/Add Vehicles
Lock Vehicles
Partially Disabling Vehicles
Totally Disabling Vehicles
Making a Carbomb
Adding Nitrous
Making Amphibious
Performance Tweaking
Adding Healing Supply
Adding/Changing/Removing Carrier Vehicles
Weapon How-To's
Spawn Weapon Kits
Change the Weapon Kits of Soldiers
Modifying Weapon Attributes
Disabling Weapons
Modifying the Damage System
Disabling Overheating
 
 
 
Fix Wall Hacks
How to Fix Wall/Floor Hacks
Basrah's Edge
Lost Village
Stalingrad
Al Khafji Docks
El Alamein
Other Fixes
Leaning F16 Fix
Glass Humvee
Oil Fields Exploding A-10
Operation Bragg Fixes
 
 
References
Object List
Weapon Kits List
Global Object Spawners
Global Soldier Spawns
Projectile Material Numbers
 

Changing/Adding/Removing Vehicles on Carriers

There are basically three ways to go about doing this:
1) By editing the Objects.rfa, making the changes apply to all maps
2) On a map per map basis (by changing the Objects.rfa)
3) On a map per map basis (without changing the Objects.rfa)
4) Adding more vehicles to the carrier (by direct Objects.rfa edit or on a per map basis)

1) Changing the Objects.rfa
This is straight forward; just open up the objects.con of your carrier, and just make the changes. some examples:

Moving the F14 slightly over to the left:
Open up the Objects.rfa, and edit the file OBJECTS\vehicles\Sea\Nimitz\Objects.con

Go down to where you see:

Code:
ObjectTemplate.create PlayerControlObject Nimitz

then under that, you'll see some lines like this:
Code:
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0

the first Nimitz_F14Spawner is the F14 on the left (standing on the deck looking towards the bow). the first number in the setPosition is the x offset releative to the center of the Nimitz. Change it to -5, so now the code looks like:
Code:
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition -5/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0

this will move that F14 to the left about 6 meters, so that it wont hit the F14 on the right when you take off.

of course, this was probably fixed in DC-F, so lets do something else: lets change the F14 to an A10.

in that same file, go down further till you see:

Code:
rem *** Nimitz_F14Spawner ***
ObjectTemplate.create ObjectSpawner Nimitz_F14Spawner
ObjectTemplate.setObjectTemplate 1 F-14B
ObjectTemplate.setObjectTemplate 2 F-14B
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 40
ObjectTemplate.TimeToLive 120
ObjectTemplate.Distance 200
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.holdObject 1
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.team 2


This is the definition of the F14 objectspawner. Just change the second setObjectTemplate to be A10_b, so that the new code looks like this:

Code:
rem *** Nimitz_F14Spawner ***
ObjectTemplate.create ObjectSpawner Nimitz_F14Spawner
ObjectTemplate.setObjectTemplate 1 F-14B
ObjectTemplate.setObjectTemplate 2 A10_b
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 40
ObjectTemplate.TimeToLive 120
ObjectTemplate.Distance 200
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.holdObject 1
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.team 2


now if you load up Wake CTF (which spawns the Nimitz), you'll see A10's instead of F14's. Remember there are several variants of the Nimitz, so make sure you're spawning the one your editing!

Now you'll notice the A-10's are floating about a half a meter above the carrier. There are two ways to fix this; either change the spawnOffset above in the objects.rfa (for example, the above would be changed to:)

Code:
rem *** Nimitz_F14Spawner ***
ObjectTemplate.create ObjectSpawner Nimitz_F14Spawner
ObjectTemplate.setObjectTemplate 1 F-14B
ObjectTemplate.setObjectTemplate 2 A10_b
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 40
ObjectTemplate.TimeToLive 120
ObjectTemplate.Distance 200
ObjectTemplate.spawnOffset 0/-.7/0
ObjectTemplate.holdObject 1
ObjectTemplate.MaxNrOfObjectSpawned 1
ObjectTemplate.team 2


or you can Active the ObjectSpawner in your map RFA and fix it (for example, put this at the bottom of your ObjectSpawnTemplates.con:)

Code:
ObjectTemplate.Active Nimitz_F14Spawner
ObjectTemplate.spawnOffset 0/-.7/0


WARNING: If you run into problems with this, remember a few things, all vehicles vary in sizes, so be careful that if you swap out a chopper for a plane or something, that if the new vehicle is taller, it may spawn halfway inside the deck. So when you go into the map, there's nothing there. Just adjust the spawnOffset so it spawns higher (increase the second number).

Also, some vehicle spawners dont have the "ObjectTemplate.holdObject 1". if you need it, add it (some vehicles will start vibrating wildly with it or without it.. you'll hafto play with it to find out what you need for different vehicles).

2) Changing on a map for map basis (editing the Objects.rfa)
First thing that needs to be done is the addTemplates in the Objects.rfa need to be remmed out. So go into OBJECTS\vehicles\Sea\Nimitz\Objects.con, and put a beginrem and endrem before and after the block of addtemplates in the nimitz that you want to do this to.

For Example, lets say we want to do this to the regular Nimitz. If you down about half way, you'll see:
Code:
ObjectTemplate.create PlayerControlObject Nimitz

then under that, you'll see all the addtemplate's for the vehicles and soldier spawns. rem them out so that the code looks like this:

Code:
beginrem
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0
ObjectTemplate.addTemplate Nimitz_MH-53Spawner
ObjectTemplate.setPosition 23.1315/21.9/-126.0914
ObjectTemplate.addTemplate Nimitz_UH-60Spawner
ObjectTemplate.setPosition 28.1975/21.9/-2.5820
ObjectTemplate.setRotation -45/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-23.9946
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-101.0266
ObjectTemplate.setRotation -45/0/0
endrem


now if you load up Wake CTF, you'll notice you have an empty carrier. To get the vehicles back, Active the Nimitz in your ObjectSpawnTemplates.con and put the block of code above back in like so:

(ObjectSpawnTemplates.con)
Code:

ObjectTemplate.Active Nimitz
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0
ObjectTemplate.addTemplate Nimitz_MH-53Spawner
ObjectTemplate.setPosition 23.1315/21.9/-126.0914
ObjectTemplate.addTemplate Nimitz_UH-60Spawner
ObjectTemplate.setPosition 28.1975/21.9/-2.5820
ObjectTemplate.setRotation -45/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-23.9946
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-101.0266
ObjectTemplate.setRotation -45/0/0


The nice thing about this method is you can change vehicles on a map per map basis, so in Wake, you'll notice there already exists a spawner for the A10 called DiveBomberSpawner. We could replace one of the F14's for an A10 like so:

Code:
ObjectTemplate.Active Nimitz
ObjectTemplate.addTemplate DiveBomberSpawner
ObjectTemplate.setPosition -5/21/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0
ObjectTemplate.addTemplate Nimitz_MH-53Spawner
ObjectTemplate.setPosition 23.1315/21.9/-126.0914
ObjectTemplate.addTemplate Nimitz_UH-60Spawner
ObjectTemplate.setPosition 28.1975/21.9/-2.5820
ObjectTemplate.setRotation -45/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-23.9946
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-101.0266
ObjectTemplate.setRotation -45/0/0

ObjectTemplate.Active DiveBomberSpawner
ObjectTemplate.team 2


notice i dropped the z down .7 meters and also moved it to the left so it wont hit the F14 on the right.

Also notice i had to set the team to 2 on the DiveBomberSpawner objectspawner. You can do this with the Active like i did above, or you can just go up to where the DiveBomberSpawner is defined and do it there. the down side of this is that you wont get the SU-25 when the central flag is taken. So make sure you acccount for this (use another spawner or something).

If you want to change properties on one of the normal carrier spawners, just active the spawner and make your changes, for example, if you want to decrease the min and max spawn times on the F14's, put this at the end of your ObjectSpawnTemplates.con:

Code:
ObjectTemplate.Active Nimitz_F14Spawner
ObjectTemplate.minSpawnDelay 5
ObjectTemplate.maxSpawnDelay 5


3) Changing on a map for map basis (without editing the Objects.rfa)
Using Trev's discovery on the new team types, it's also possible to make the changes above without having to modify the Objects.rfa at all.

For example, if you want to change the F14 spawner so that it spawns the A10, the following code at the end of your ObjectSpawnTemplates.con will work:

Code:
ObjectTemplate.Active Nimitz_F14Spawner
ObjectTemplate.setObjectTemplate 3 A10_b
ObjectTemplate.minSpawnDelay 5
ObjectTemplate.maxSpawnDelay 5
ObjectTemplate.spawnOffset 0/-.7/0
ObjectTemplate.team 3


If you wanted to totally remove a vehicle from the carrier, you could just change the team number without defining what it spawned, like:

Code:
ObjectTemplate.Active Nimitz_F14Spawner
ObjectTemplate.setObjectTemplate 3
ObjectTemplate.team 3

4) Adding more vehicles to the carrier (by direct Objects.rfa edit or on a per map basis)

Objects.rfa

If you want to add more vehicles to the carrier, just addtemplate an existing vehicle spawner again. Since Nimitz_F14Spawner is an existing vehicle spawner, lets addTemplate it again so it's right behind the front two existing ones. Still working on the Nimitz as we have been above, go down to where you see the addTemplates for the existing vehicles (looks like this:

Code:
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0
ObjectTemplate.addTemplate Nimitz_MH-53Spawner
ObjectTemplate.setPosition 23.1315/21.9/-126.0914
ObjectTemplate.addTemplate Nimitz_UH-60Spawner
ObjectTemplate.setPosition 28.1975/21.9/-2.5820
ObjectTemplate.setRotation -45/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-23.9946
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-101.0266
ObjectTemplate.setRotation -45/0/0

We're going to add the new F14 spawner 20 meters behind the first one above (we can put this anywhere... so lets do it right after the AV8Spawner with a comment) so now your code looks like this:

Code:
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/33.3961
ObjectTemplate.setRotation -1.482/0/0
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 15.0317/21.70/45.8156
ObjectTemplate.setRotation -3.329/0/0
ObjectTemplate.addTemplate Nimitz_MH-53Spawner
ObjectTemplate.setPosition 23.1315/21.9/-126.0914
ObjectTemplate.addTemplate Nimitz_UH-60Spawner
ObjectTemplate.setPosition 28.1975/21.9/-2.5820
ObjectTemplate.setRotation -45/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-23.9946
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.addTemplate Nimitz_AV8Spawner
ObjectTemplate.setPosition 28.1975/21/-101.0266
ObjectTemplate.setRotation -45/0/0
rem ***** New F14 ******
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/13.3961
ObjectTemplate.setRotation -1.482/0/0

The new code is in RED so you can see. Notice the Y coordinate is 13.3961.. this will put it 20 meters behind the first F14. Load up Wake and you'll see the new fighter.

On a per map basis

Doing the same thing above but only doing it in the map itself (without having to edit Objects.rfa) is straight forward. Just ObjectTemplate.Active Nimitz and add the same code as above. You can do this in your map's ObjectSpawnTemplates.con. For example, add this code at the end of your ObjectSpawnTemplates.con in Wake Conquest:

Code:
rem ***** New F14 ******
ObjectTemplate.Active Nimitz
ObjectTemplate.addTemplate Nimitz_F14Spawner
ObjectTemplate.setPosition 1.0203/21.70/13.3961
ObjectTemplate.setRotation -1.482/0/0

If you do this on a per map basis, then all the spawners defined in ObjectSpawnTemplates.con is fair game as well (it doesn't hafto be the nimitz vehicle spawners). On the other hand, if you directly edit the Objects.rfa, then you can only use vehicle spawners that are defined in objects.rfa (your not restricted to the Nimitz spawners tho... for example, you could addTemplate the Shokaku vehicle spawners to the Nimitz as well if you wanted).

cron

©2009
No materials may be duplicated under any circumstances.