
Debug mode was often used by Battlefield 1942 creators when the game was still in development: making changes "on the fly" allowed them to quicker balance the gameplay, make improvements, and of course fix bugs.
To enable debug mode, we need a special file named "Battlefield 1942 Community Debug". Until some time ago, it could be downloaded from the game's official website, but the link is dead know, so here is a link to the site that has it, just scroll down to community..etc.After downloading and unpacking it, move the bf1942_r.exe file to your Battlefield 1942 directory (most commonly C:\Program Files\EA GAMES\Battlefield 1942), while mod_r.dll goes to Mods\bf1942. Then all you need to do is run bf1942_r.exe and load a (coop) map, just like in "casual" bf.
Unfortunately, the Debug version won't allow to play Internet games, but playing over LAN works fine. However, techniques described below will cause a multilayer game to crash. They work perfectly in singleplayer (with bots) though.
How to make a missile launcher Mustang?
Load any map in coop mode. (It's OK if there are no Mustang spawns.)
Press tilde (a key to the left of 1) to open the console.
In the console type the following code. Pressing the up arrow will recall the previous line, saving you a lot of typing. Commands are case insensitive.
ObjectTemplate.active Mustang
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
ObjectTemplate.setRotation 0/0/180
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
ObjectTemplate.setPosition -5/0/0
ObjectTemplate.setRotation 0/0/180
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
ObjectTemplate.setPosition 5/0/0
ObjectTemplate.setRotation 0/0/180
Game.SpawnObject Mustang
Let's analyze this code line after line:
ObjectTemplate.active Mustang
In BF1942 every object has it's own template. All spawned vehicles are based on their respective object templates. By using "Active" command, we tell BF, that we want to edit Mustang's template.
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
This line adds a Katyusha_Ramp_Rot object to the Mustang template. As the name suggests, it's a missile launcher from Katyusha. From now until the next Active or addTemplate call, every setPosition and setRotation commands will affect this single launcher we just added to the Mustang.
ObjectTemplate.setRotation 0/0/180
This command rotates our launcher bottom up (180* degrees around Mustang's length axis). In result, the missiles end up below the hull and not above it. The setRotation instruction takes 3 parameters, separated by '/' character.
The first number is the angle through which we want to rotate our object to the left hand or to the right hand side. (Negative numbers rotate to the left hand side.) [Yaw]
The second number is the angle through which we want to rotate our object to the top or to the bottom (Negative numbers rotate to the top) [Pitch]
The third number is the angle through which we want to roll our object. (Negative numbers roll to the left)
Don't worry if you don't understand everything, it will come clear as soon as you start playing with the code.
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
Here we add another launcher to our Mustang. Note that every object we add takes position 0/0/0 by default. This position is usually the exact center of the vehicle we add to.
ObjectTemplate.setPosition -5/0/0
Move that launcher 5 meters (~16.5 ft) to the left, so it ends up under the left wing. The setPosition command also takes 3 parameters:
The first number is the distance by which we want to move our object to the left hand side or to the right hand side. (Negative number smove to the left)
The second number is the distance by which we want to move our object to the top or to bottom. (Negative numbers move to the top)
The third number is the distance by which we want to move our object to the front or to the back. (Negative numbers move to the back)
ObjectTemplate.setRotation 0/0/180
Rotate the second launcher bottom up, so it's missiles end up under the hull.
ObjectTemplate.addTemplate Katyusha_Ramp_Rot
ObjectTemplate.setPosition 5/0/0
ObjectTemplate.setRotation 0/0/180
The next 3 commands add the third launcher to the Mustang, move it 5 meters to the right and rotate it bottom up.
Game.SpawnObject Mustang
The last line spawns the Mustang exactly where you are standing. The rotation of your character is also copied to the new vehicle, so don't look at the sky or at your feet, or the Mustang will spawn sitting on it's tail or on it's nose respectively.
By using just these 4 commands, you can mod any vehicle from any mod to the way you like. Of course BF supports a whole lot of other commands, which regulate everything, beginning from Willy's engine torque, through HP of the US submarine, ending with rate of fire of the AA-Gun. If you are interested, you can read the list of all commands here.
Lastly, here's a list of some interesting objects, that you can add to any vehicle by the addTemplate command. (Of course there are more, you can find them by opening the mods/bf1942/archives/objects.rfa file with WinRFA and look up vehicle declarations)
Katyusha_Ramp_Rot - Katyusha missile launcher
B17BombRack - B17 bombs
B17_MG1_FB - B17 machine gun
AA_Allies_GunBarrel - AA-Gun barrel (just the barrel: it doesn't rotate, but shoots)
DefgunGunBarrel - Defgun barrel (see above)
DefgunTurret - Defgun turret (it does rotate)
T34-85GunBarrel - Barrel of the haevy T-34
T34-85Tower - Tower of the heavy T34 (MG included)
YamatoFatTurret - Yamato turret (Caution, it's Huge!)
YamatoFatCannon - Yamato barrel (Yamato is the Japanese Battleship)
Ill get some more codes soon
