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 |
How to Make Vehicles AmphibiousThis 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:
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:
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:
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:
(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:
Notice the floaters were dropped down to 0 (about a meter less than on the Stryker). |