Battlefield Modding

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


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
 

How to Make Vehicles Amphibious

This example will make the Stryker amphibious.

First, look at the BRDM to see how it works. In the Objects.rfa, look at: OBJECTS\vehicles\land\BRDM2\Objects.con

You'll notice under the definition of BRDM2, near the end before definition of lodBRDM2, there are these 4 floater things:

ObjectTemplate.create PlayerControlObject BRDM2
....
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/.97/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/.97/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/.93/2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/.93/2.5

These floaters are defined in OBJECTS\vehicles\land\BRDM2\Physics.con. They are put on each corner of the BRDM to keep it floating.

Now the BRDM also has a water engine and some rudders. You'll see them under the definition for BRDM2Complex. Looking at the objects.con again:

rem *** BRDM2Complex ***
ObjectTemplate.create Bundle BRDM2Complex
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
.....
ObjectTemplate.addTemplate BRDM2WaterEngine
ObjectTemplate.setPosition 0/-.75/-.7
ObjectTemplate.addTemplate BRDM2RudderStern
ObjectTemplate.setPosition 0/-.3/2
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate BRDM2RudderAft
ObjectTemplate.setPosition 0/-.3/-2
ObjectTemplate.setRotation 0/0/-90
.....

These are also defined in the Physics.con file.

OK, good enough. All we need to do is addtemplate these to the Stryker.

The main definition for the Stryker is called just that "Stryker". Now open up a map rfa that you'd like to add this capability to. Then, at the end of ObjectSpawnTemplates.con, put these lines:

ObjectTemplate.Active Stryker
ObjectTemplate.hpLostWhileDamageFromWater 0
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/.97/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/.97/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/.93/2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/.93/2.5

ObjectTemplate.Active StrykerComplex
ObjectTemplate.addTemplate BRDM2WaterEngine
ObjectTemplate.setPosition 0/-.75/-.7
ObjectTemplate.addTemplate BRDM2RudderStern
ObjectTemplate.setPosition 0/-.3/2
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate BRDM2RudderAft
ObjectTemplate.setPosition 0/-.3/-2
ObjectTemplate.setRotation 0/0/-90

By adjusting the x/z/y values for the floaters, you can define how low the Stryker sits in the water, and by adjusting them on the rudder/engine, you can probly affect how the Stryker handles when it turns.

if you wanted to tweak the water engine itself, you could add something like this to objectspawntemplates.con as well:

ObjectTemplate.Active BRDM2WaterEngine
ObjectTemplate.setMinRotation 0/0/-5
ObjectTemplate.setMaxRotation 0/0/20
ObjectTemplate.setMaxSpeed 0/0/20
ObjectTemplate.setAcceleration 0/0/15
ObjectTemplate.setNoPropellerEffectAtSpeed 20

(the values above happen to be the BMP's water engine settings).

however, this will also affect the regular BRDM water engines.

SetMinRotation and SetMaxRotation for the Engine set how fine the control scale is for the engine (basically how many distinct speeds the engine can be at). For example, a SetMinRotation of -100 and SetMaxRotation of 200 means that the total speed is split into 100 different speeds for reversing and and 200 different speeds for going forward (so feasibly you could control the engine in such a way as to be able to go at 200 different speeds but none between them).

SetMaxSpeed, and SetAcceleration control how an engine responds to player input, they do not otherwise change the speed chracteristics of a vehicle in any other way.

not 100% sure about the last one...

One final note (and warning) on this. This only works because for some reason the BRDM2WaterEngine is not in the BRDM2's Network.con file (perhaps the dev's forgot to put it in... it does exist for the BMP). The fact that it doesn't exist allows one to addtemplate the BRDM water engine without causing a client crash. It is unknown how this may affect multiplayer games... feedback on this ssm would be much appreciated.

Some vehicles will still take damage using the procedures above. It may just be that the floaters are too low, in which case, increasing the z axis of the floaters may solve the problem. The M2A3 has this problem. The code below will get the M2A3 to be amphibious:

ObjectTemplate.Active M2A3
ObjectTemplate.hpLostWhileDamageFromWater 0
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/0/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/0/-2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition 2.5/0/2.5
ObjectTemplate.addTemplate BRDM2Floater
ObjectTemplate.setPosition -2.5/0/2.5

ObjectTemplate.Active M2A3Complex
ObjectTemplate.addTemplate BRDM2WaterEngine
ObjectTemplate.setPosition 0/-.75/-.7
ObjectTemplate.addTemplate BRDM2RudderStern
ObjectTemplate.setPosition 0/-.3/2
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate BRDM2RudderAft
ObjectTemplate.setPosition 0/-.3/-2
ObjectTemplate.setRotation 0/0/-90

Notice the floaters were dropped down to 0 (about a meter less than on the Stryker).

cron

©2009
No materials may be duplicated under any circumstances.