Jump to content
Official BF Editor Forums
Sign in to follow this  

Making a Basic Helicopter

Recommended Posts

I will be posting to this thread in several parts, as I figure out how to make a working helicopter. I'm using Maya 6.0.1 and Photoshop CS. I may go back and change things as I go along, if I learn that something doesn't work the way I want it to. You may also find different ways of doing things, and some of these instructions are duplicated elsewhere. I'm just showing how I work. I'll fill in this Table of Contents as I go along:

0. Preparation

0a. Folders

0b. Placeholder Textures

1. Modeling

1a. Visible Mesh

1b. UV Layout

1c. Projectile Collision Mesh

1d. Soldier Collision Mesh

1e. Vehicle Collision Mesh

1f. Collision Mesh Finalization

2. Basic Texturing

2a. Collision Meshes

2b. Visible Meshes

2c. Transparency

3. Basic Heirarchy & Organization

3a. Proper Object Location

3b. Mesh Grouping

3c. Cockpit

4. Engine & Control Setup

4a. User Control Input Definitions

4b. Player Control Object Setup

4c. Main Engine Setup

4d. Rotorhead Setup - Part 1

4e. Rotorhead Setup - Part 2

4f. Rotorhead Setup - Part 3

4g. Tail Rotor Engine Setup

5. Stabilization

5a. Ground Stabilization

5b. Forward Motion Stabilization

5c. Roll Stabilization

6. Fixed Weapons

6a. Weapon and Projectile Components

6b. Projectile Specifics

6c. Visual Effects

7. Heat Sources

7a. Helicopter Heat Target

7b. Adding Barrels in Maya

7c. Custom Flare Launcher

8. View-controlled Objects

8a. Additional PCOs

8b. Copilot Setup

8c. View-based Rotation

9. Working Rotor Blades

9a. Adding LOD-Changing Rotors

9b. High-Speed Rotor Setup

9c. Animated Rotors

9. Conclusion

Share this post

Link to post
Share on other sites

0. Preparation

0a Navigate to your bf2editorRawDataObjectsVehicles folder and add a folder named Air if it isn't already there. Open the Air folder, and add another folder with your helicopter's name. In my case, it's VehiclesAirOH58D. Create two folders here, named "meshes" and "textures" minus the " of course.

0b Your Maya mesh should be saved in meshes. Your textures should be in textures. For now, open up Battlefield 2modsbf2Objects_Client.zip and copy the textures from vehiclesairahe_ah1ztextures to your textures folder. You can always replace these later with your own custom textures.

Share this post

Link to post
Share on other sites

1. Modeling

It is a very good idea to put some thought into what you want your helicopter to do. In my case, I'm making an OH58D Kiowa Warrior, a lightweight armed scout helicopter. I plan on having it be a two-player vehicle. Player one is the pilot (obviously) and will control a .50 caliber machine gun. Player two is the copilot, and will control a Mast Mounted Sight and a number of Hellfire missiles.

1a So! Modeling. My helicopter has 4 parts for now: the Fuselage, the Main Rotor, the Tail Rotor, and the Mast Mounted Sight. Each is a single mesh. Total poly count is about 5500. These parts will form my visible meshes. I won't tell you how to make your model; that's up to you.


Make sure that your polygon normals face in the right direction. This means they face out. Turn off Double Sided in your Render Options for each part to see the difference. Also, you don't need to triangulate just yet (despite the fact that mine is triangulated). Note that I've modelled it so that Forward is positive Z. This is important; if you have it negative Z, your helicopter will be backwards! Also, I positioned it so that my origin will also be my center of gravity for this model.

1b Lay out your UVs at this point, as it may become difficult to get them the way you want them later. I tried to make mine recognizable and useful. You'll be able to keep this UV set later when you do the whole dnyUVPanel thing...


Notice on my UV layout that I have separated all my glass panels from the fuselage. This way, I can paint an alpha transparency map without hitting my fuselage. Also, you may notice several parts are overlapped. This works fine, and is strongly recommended for parts that repeat or share a common texture. I decided not to overlap my fuselage because I want to display different textures on each side. If you look at BF2's Cobra helicopter, though, you'll notice the texture is the same on both the left and right sides. It's fine either way, just depends on what you need.

It's a good idea to take some snapshots now. Save them for texturing later.

1c Now that the visible mesh is done, you'll need to build collision meshes. First up is to optimize your meshes to make a col0 projectile collision mesh for each object.


Feel free to look up EA's "Tutorial 6: Building the Car" tutorial for lots of info for considerations when doing this. In my case, I want players to be able to shoot the pilot and copilot out of their seats through the open doors on the sides. You'll notice there is a basic cockpit. Also, I figured it really wasn't important to know when you're hitting the cage on the .50, and people can't hide behind it, so I removed most of the cage. I also removed most of the small details, such as lights and the tips of rotors, intakes, etc. Note the reduced poly count - about 1300. I could conceivably reduce this even more, but I think it's okay for now.

1d Next up is col1, the Soldier Collision Mesh. This will only be made for the main Player Control Object, all the separate moving parts won't need one, and in fact can't use them. I further reduced details, trying to think of what could hit a player and what couldn't.


-edit- After sorting out how to do working rotors, I discovered a few things. First, rotors only have a projectile collision mesh, and won't detect collisions with anything else. So, the main collision meshes need to account for this. I added a flattened cone to cover the main rotor's outline, with a peak covering the Mast Mounted Sight. Since the rotor collision mesh covers most of the top of the helicopter, remove all detail up near it, such as antennas and the IR jammer just aft of the engine. Don't forget, the collision mesh needs to be one piece.


1e Finally comes col2, the Vehicle Collision Mesh. This one is very basic. Most things that collide with the helicopter will destroy it outright (dang suicidal pilots) so it's not too important to know if something hit the edge of the windscreen versus hitting the nose of the helicopter.

-edit- Don't forget to put in a rotor collision mesh part too.


1f Once your collision meshes are complete, select each of them and go to Edit PolygonsTextureAutomatic Mapping. Your UV layout simply needs to exist for these meshes; don't worry about making it look pretty. Also, if you haven't already, Triangulate all of your collision meshes; they won't work if you don't.

Share this post

Link to post
Share on other sites

2. Basic Texturing

2a Each of your Collision Meshes needs to have a texture type the editor recognizes. In my case, I copied another tutorial and gave all of them a new Lambert material named light_armored_vehicle. You can of course use any other material type the editor recognizes and apply them to specific polygons individually (I think) but this is fine for now.

2b Select each of your visible meshes. They should already have their UVs layed out nicely. Open the dnyUVPanel from the command line, make sure that your visible meshes are selected (their UV layout should be visible in the panel), and click the [...] button by Assign. Navigate to C:Program FilesEA GAMESBattlefield 2mayaCGFX6.0 and select BundledMesh.fx and click Open. This shader is used for all the dynamic non-player visible meshes. The other two are for static objects and player skins.

Select your fuselage, and open up the Attribute Editor (Ctrl-A). Navigate to the cgfxShader1 tab, and look at BundledMesh Parameters. You need to concern yourself with the diffuseTexture, normalTexture, and colorLUT fields. Click the folder icon by diffuseTexture, navigate it to your RawDataObjects...Textures folder, and select something in there with a _c.dds ending. Do the same for normalTexture, except use whatever has a _b.dds ending. Do the same for colorLUT, but point it to C:Program FilesEA GAMESBattlefield 2mayaCGFX6.0cgfx_texturesSpecularLUT_pow36.dds instead. These are placeholders for now. Later, you can add your own textures.

2c In order to have semitransparent glass, you'll need to do one more step. Go to Select by Component Type mode, and select each of the polygons that make up your cockpit glass. Open up dnyUVPanel again, and hit "Assign" to assign a new cgfxshader to these polygons. Rename the new material to "alpha" and assign whatever textures you wish to use (thanks to Rexman for clarifying this). I used the same texture map for the glass as I did for the rest of the helicopter, to keep things simple.

Essentially, changing the name to alpha tells the editor to use the texture's Alpha channel as transparency, instead of the default specular. Visit this thread for more in-depth information: http://bfeditor.org/forums/index.php?showt...=asc&highlight=

Share this post

Link to post
Share on other sites

3. Basic Heirarchy & Organization

Once you have your visible mesh built and layed out, it's time to start putting things together.

3a Everything needs to know exactly where it is, and have nothing modifying it. So! Delete all your history, turn on Grid Snapping, and get ready to move objects around. In my case, I decided to write down the coordinates for each part since I like to work with numbers. However you do it, whether numerically or by snapping to a temporary locator, remember where your parts go. For example, my Tail Rotor's center point is located at about -.02 .2 -6.3 (xyz) relative to the origin. In order for the editor to put your object together properly, it needs to know how far your separate pieces are from the origin.

Move each piece to the origin and Freeze Transformations; then move it back to where it's supposed to be. This way, you make sure you have the correct coordinates. Do this for any visible and collision meshes which do not have their control point at 0,0,0.

3b Your fuselage should be your Player Control Object. This object will be the top of the heirarchy in the Editor, and will be the basis for everything you do in the game. It's collision meshes should be grouped and parented to it. Same goes for the other parts and their collision meshes. Then, parent your sub-objects (rotors and sight) to your Player Control Object. Again, see "Tutorial 6: Building the Car" if you have questions about this.

Now that you have a basic heirarchy, it needs to be named to follow the editor's conventions. I figured out what component types things should be by looking in the editor and comparing. It's best if you do this renaming in the Outliner, so you actually rename the right components and can enter long names. Note the double underscore that offsets the component type at the end of each name, and rename your stuff accordingly. Then, select your Player Control Object (PCO) and group it. Name the new group lod0. Group it again, and name it geom1. Create a locator at the origin, rename it root_bundledmesh, and parent geom1 to it.

3c The game will want you to provide it with a cockpit, so select geom1 and duplicate it. Rename it to geom0, open it up, and erase all the stuff under your PCO. The reason for this is, you won't need to collide with anything while you're sitting in it. The game will base collisions off of geom1's collision meshes.


You will also want to create a geom2 group. This will serve as your wreck. It isn't necessary for testing in the editor, but you should add one if you want to test in-game at this point. If you do, make sure it has a col0, col1, and col2 mesh along with the visible mesh, and follows the same heirarchy as the other geoms.

Share this post

Link to post
Share on other sites

4. Engine & Control Setup

Up to this point, you can pretty much figure everything out from the tutorials and a quick glance over the existing models. However, setting up the helicopter so it actually flies is a bit trickier. Let me know if I miss anything, since there's a lot to this.

If you prefer to do this the easy way (and therefore not know why your object behaves as it does) feel free to simply copy the heirarchy from an existing helicopter. Create the nodes, organize and name them the same way, and do a lot of Inherit Properties. If you prefer to know how things go together, read on.

-Note- Unless I say otherwise, for section 4, anything with this setup "ObjectNameWordAnother Word = Something" means ObjectName's Tweaker, section "Word" field "Another Word," with the input value of "Something." Except I'll be referring to my setup. And if I don't mention a field, leave it at it's default.

4a One of the biggest bugaboos for me was getting my control scheme to work properly. Make sure your Primary Control setup in the actual game is set to it's default for whatever you're working on; helicopters, in this case. The Editor *seems* to rely on your current control scheme from BF2. This means if you have mapped P as your fire key, it'll be your fire key in the editor. I had a joystick as the primary input in Helicopter controls and couldn't fly them in the editor. Changing to the default control setup made them work in the editor

Here's my heirarchy, by the way. Don't worry about all the fancy Dampers and other Thingamabobs just yet.


4b Once you've checked your control scheme, fire up the Editor, load your mod, and Import your helicopter. Go ahead, turn on Physics and Input, see what happens. Nothing. Except maybe it rocks a bit, then settles. This is good. First thing you need to do is set up your PCO.

My PCO is called oh58d. So, here we go:

oh58dDefaultNetworkableInfo = BasicInfo -BasicInfo allows the PCO to transfer any input it receives from it's Player to anything in it's heirarchy.-

oh58dPhysicsHasMobilePhysics = true

oh58dPhysicsHasCollisionPhysics = true

oh58dPhysicsPhysicsType = Mesh

oh58dPhysicsMass = 2500 -This is arbitrary. I picked this because 2500 kg seems reasonable for this helo-

oh58dHudVehicleCategory = VCHelicopter

oh58dHudControlsCategory = VCHelicopter -this setting tells the PCO which control set to take inputs from-

At this point, you still shouldn't see anything different, except if you switch to Soldier mode and shoot it, it won't fly away like a piece of paper.

4c In order for this puppy to fly, it needs an engine. Rightclick on your PCO, and select Add New Child from the popup menu. For Object Type, choose Engine. Name it oh58d_MainEngine. This object needs to stay at your origin/center point/center of gravity, or else you may experience unanticipated off-axis thrusts.

As for settings, this one's fun:

oh58d_MainEngineDefaultNetworkableInfo = BasicInfo

oh58d_MainEnginePhysicsHasMobilePhysics = true

oh58d_MainEnginePhysicsHasCollisionPhysics = true

oh58d_MainEnginePhysicsPhysicsType = Mesh

oh58d_MainEnginePhysicsEngineType = Helicopter

oh58d_MainEnginePhysicsTorque = .1

oh58d_MainEnginePhysicsDifferential = 0

oh58d_MainEnginePhysicsNumberOfGears = 1

oh58d_MainEnginePhysicsGearUp = 0.7

oh58d_MainEnginePhysicsGearDown = 0.3 -the Gear settings have to equal 1-

oh58d_MainEnginePhysicsPropRotAxis = 2 -this means it provides thrust on the Z axis, aka Forward. As far as I can tell, this and the following AoA settings determine how much forward thrust this engine gives based on your Angle of Attack-

oh58d_MainEnginePhysicsDefaultAngleOfAttack = 6.6

oh58d_MainEnginePhysicsMaxAngleOfAttack = 16 -how far forward you pitch before it's at maximum thrust-

oh58d_MainEnginePhysicsAttackSpeed = 12 -how much forward pitch for it to reach normal cruising thrust-

oh58d_MainEnginePhysicsHorizontalDampAngle = 0.001

oh58d_MainEnginePhysicsHorizontalDampAngleFactor = 0.01

You'll notice that this engine has no direct Player Input. Instead, the amount of thrust from this engine varies based on your pitch! Pretty useful, actually.

Switching to Input mode at this point still won't do much for you. Sorry, but you've no way of tipping the helicopter yet!

4d In order to change your pitch or bank, you need to set up a heirarchy. Have a look at mine so you know what we're doing; there are three parts to this mechanism.

RotorHead1 and RotorHead2 do something funky with your Pitch inputs. You'll notice a slight difference in their Acceleration fields. From what I can tell, these two elements combine to give your helicopter that forward rocking motion during horizontal acceleration. You know, when a helo pitches down to go forward, it also descends slightly before leveling off. These two RotationalBundles combine to give you that effect. I've illustrated where they are, as well as the perceived pivot based on their locations.


Rightclick your PCO, and select Add New Child, of type RotationalBundle. Name it oh58d_RotorHead1.

Move this object so it's about 10 meters below your object. This'll allow it to work with the next RotorHead to pitch and bank your helicopter.

Here are it's settings:

oh58d_RotorHead1DefaultNetworkableInfo = BasicInfo

oh58d_RotorHead1RotationMinRotation = 0/-6/-3

oh58d_RotorHead1RotationMaxRotation = 0/6/3

oh58d_RotorHead1RotationMaxSpeed = 0/50/50

oh58d_RotorHead1RotationAcceleration = 0/-1000/1000 -you'll notice this gets reversed in RotorHead2, which gives that nice Helicoptery Floaty feel. And makes you run into the ground if you suddenly pitch too far forward at low altitude-

oh58d_RotorHead1RotationInputToPitch = PIPitch

oh58d_RotorHead1RotationInputToRoll = PIRoll

oh58d_RotorHead1RotationAutomaticReset = true -this simply returns the rotations to neutral when you're not giving input-

4e Rightclick on oh58d_RotorHead1 and select Add New Child. Again, this is a RotationalBundle. Name it oh58d_RotorHead2. This one stays at the origin. Use the same settings as RotorHead1, even the Inputs, with the following exception:

oh58d_RotorHead2RotationAcceleration = 0/1000/-1000 -this is the reverse of RotorHead1-

4f Now your controls are in place, and it's time to create the engine for vertical thrust. Rightclick RotorHead2, Add New Child, type is Engine, and name it oh58d_rotor. Nesting this object under a RotationalBundle which receives control inputs essentially makes this into a vectored thruster. Leave it at the origin.

It's pretty! But, it's facing the wrong way. Rotate it so that it's Z axis (the Blue one) faces up about 85 degrees. Not quite vertical; it's easier to control with a teensy bit of forward thrust instead of straight up. See my picture if you're lost:


Now that you have it oriented to give vertical thrust, it's time to give it some power. Here are it's settings:

oh58d_rotorDefaultNetworkableInfo = BasicInfo

oh58d_rotorPhysicsHasMobilePhysics = true

oh58d_rotorPhysicsHasCollisionPhysics = true

oh58d_rotorPhysicsPhysicsType = Mesh

oh58d_rotorPhysicsEngineType = Helicopter

oh58d_rotorPhysicsTorque = 250

oh58d_rotorPhysicsDifferential = 400 -given my helicopter's light weight, this is actually rather overpowered-

oh58d_rotorPhysicsGearUp = .99

oh58d_rotorPhysicsGearDown = .01

oh58d_rotorPhysicsPropRotAxis = 2 -this gives thrust on the Z axis, which is currently pointing almost straight up-

oh58d_rotorPhysicsHorizontalSpeedMagnifier = 1.5

oh58d_rotorPhysicsDefaultAngleOfAttack = 2

oh58d_rotorPhysicsMaxAngleOfAttack = 12

oh58d_rotorPhysicsAttackSpeed = 5 -think of these three AOA settings as your collective. The greater the AOA, the greater the angle on the blades, and the greater the thrust they put out until they can't give any more. This means it gives a default of a little thrust, quickly increases to nominal, but takes a while to push to max-

oh58d_rotorPhysicsHorizontalDampAngle = .1

oh58d_rotorPhysicsHorizontalDampAngleFactor = .001

oh58d_rotorRotationMaxRotation = 0/0/150

oh58d_rotorRotationMaxSpeed = 0/0/1

oh58d_rotorRotationAcceleration = 0/0/10

oh58d_rotorRotationInputToRoll = PIThrottle

oh58d_rotorRotationAutomaticReset = true -setting this to false will let you set your throttle and leave it. True makes it return to neutral as soon as you let go-

Now, should you have the urge to go to Input mode and turn on Physics, you should be able to get your lil' baby in the air. It'll go up and down as well as roll side-to-side. One thing yet remains, however.

4g The tailrotor! Yes, it's needed for Yaw! This one's fairly simple, since it's only one engine. So! Rightclick the PCO, select Add New Child, type is Engine, name is 0h58d_TailRotor_Engine. Move this one along the Z axis until it is about the same place as your visible tailrotor. It also needs to have it's Z axis sticking out to the side, so rotate it 90 degrees so the Blue vector points out the side. Either one, doesn't matter.


Now, to give it inputs and thrust, use these settings:

oh58d_TailRotor_EngineDefaultNetworkableInfo = BasicInfo

oh58d_TailRotor_EnginePhysicsHasMobilePhysics = true

oh58d_TailRotor_EnginePhysicsHasCollisionPhysics = true

oh58d_TailRotor_EnginePhysicsPhysicsType = Mesh

oh58d_TailRotor_EnginePhysicsEngineType = Helicopter

oh58d_TailRotor_EnginePhysicsTorque = 40

oh58d_TailRotor_EnginePhysicsDifferential = 35

oh58d_TailRotor_EnginePhysicsPropRotAxis = 2

oh58d_TailRotor_EnginePhysicsPureRotational = true

oh58d_TailRotor_EnginePhysicsSpinWhenNoEngineInAir = 0.4

oh58d_TailRotor_EnginePhysicsDecreaseAngleToZero = true

oh58d_TailRotor_EnginePhysicsNoEffectAtPerpSpeed = 60

oh58d_TailRotor_EngineRotationMinRotation = 0/0/-100

oh58d_TailRotor_EngineRotationMaxRotation = 0/0/100

oh58d_TailRotor_EngineRotationMaxSpeed = 0/0/500

oh58d_TailRotor_EngineRotationAcceleration = 0/0/2000

oh58d_TailRotor_EngineRotationInputToRoll = PIYaw

oh58d_TailRotor_EngineRotationAutomaticReset = true

There you go! Now, you should have a flyable (if ungainly) helicopter!

-Note- If it doesn't seem to work at first when you Enable Physics and switch to Input, try hitting Reset Vehicle Position once or twice. Since there are no sound effects yet, it can be difficult to tell when the engine's simply spinning up versus when it's ignoring you.

-Note- I figured out another use of the Rotorhead1/Rotorhead2/Rotor setup. The greater the distance between Rotorhead1 and Rotorhead2 (assuming Rotorhead2 stays at the Origin) the more responsive your horizontal control inputs are! The farther out it is, the farther Rotor gets moved from the origin and the greater the amount of off-center thrust it applies. Try it out; move RotorrHead1 down maybe 30 meters, return RotorHead2 to the origin, and fly it around. Huge difference in control response!

Share this post

Link to post
Share on other sites

5. Stabilization

There are two part systems which help stabilize your helicopter. The first is Dampers (spring objects) for your ground contacts, and the second are Wings, which in this case provide a little lift and drag to point you in the right direction, like feathers on an arrow.

5a Damper objects are covered pretty well in Tutorial 6: Building the Car. Suffice it to say, you'll probably want one at each corner of your landing skids, slightly below the bottom of the skids. The box defined by these four dampers at the corners will be what you land on. Pretty simple. It's made even easier by the Wizard (Object Editor panel on the right, scroll down, there it is). Select "Helicopter" from the drop-down menu, click Run, and go to the bottom entry, Utils. Expand it, select the one that says "Adjust Strength/Damping..." and hit Execute. Make sure all your dampers are selected, click OK, and enter new values. 5 damping and 5 strength works just fine.

This'll keep your helicopter from bouncing crazily or jittering in case of improper ground collision detection.

5b Far more important to a functional helicopter is some way of creating drag. Ever wonder why helicopters have tails? Same reason arrows do; to keep them pointed in the right direction at speed. Well, there are also some other characteristics of drag and real-world aircraft that we need to simulate for a satisfying (or at least predictable) flight experience. Without this setup of Wings, your helicopter behaves a lot like those Lunar Lander games that were popular back on the old Atari arcade systems, never moving in exactly the direction you think it should.

A system of 4 Wing objects is sufficient to stabilize your helicopter in flight. Two of them are oriented vertically, simulating drag from the fuselage and vertical stabilizer, while another two are set up essentially like wings on an airplane, angled slightly up at the tips. This creates a V shape which stabilizes the helicopter. Take a look at the picture:


The first Wing is centered at the origin, and rotated 90 degrees to the side, so it's Y axis points directly left or right. Create it by rightclicking the PCO, selecting Add New Child, type is Wing, name is oh58d_BodyWingVertical or somesuch. You've probably caught on to this by now. Rotate it into place. It only has two settings to deal with:

oh58d_BodyWingVerticalPhysicsWingLift = 10

oh58d_BodyWingVerticalPhysicsFlapLift = 0

WingLift is fairly arbitrary. Too high a number will overpower it, though, making the helicopter essentially snap to whatever direction it's moving. You want some correction, but too much will make it tough to control. Also, since these wings are not control surfaces, there's no need to give them networkInfo, inputs, rotation settings, etc. If you did have them as control surfaces, you'd want a little lift in FlapLift, since when an aircraft extends flaps, it gets a little more lift. But these are stationary, so no FlapLift.

Create another Wing and call it oh58d_Rudder. Again, turn it 90 degrees so Y points left and right, then move it back to the vertical stabilizer at the rear of the helicopter. For now, use the same settings as BodyWing has. You may wish to slightly increase the WingLift setting to make it correct a bit more quickly. Tweak it and see what works for you.

5c That takes care of directional stabilization; the other part of in-flight stabilization is the vertical orientation. You don't want your helicopter rolling all over the place, since it'd crash pretty quick that way. Hence the need for the other two wings.

Create another Wing, and name it oh58d_WingR (for Right). Move it out a meter or two to the right side and down a little. Rotate it so that the Y axis points about 5 degrees back in toward the center of your helicopter, and give it these settings:

oh58d_WingRPhysicsWingLift = 4

oh58d_WingRPhysicsFlapLift = 0

Then, create another Wing for the left side, and duplicate it's settings. Place it in a location which mirrors WingR, and mirror it's rotation too. This creates a V shape which stabilizes the helicopter's roll component.

If you want to make your helo more stable, simply increase the WingLift and/or rotation of both WingR and WingL. Keep in mind, too much lift will actually make it go up at high speeds, like an airplane, which isn't necessarily something you want in a helicopter.

Share this post

Link to post
Share on other sites

6. Fixed Weapons

This was another tricky part for me, but fortunately it's straightforward. My little Kiowa is supposed to have a fancy .50 caliber machine gun fixed to the left side. That's what the boxy thingy and the cage are in all the screenshots. This .50 is controlled by the pilot. I intend to use it to snipe unsuspecting people who think it's too cute to hurt them ;). Seriously though, this process is the same for any simple (non-IK) vehicle-mounted weapon system in the game. You can parent the weapon object to a RotationalBundle with PIMouselook controls mapped to the rotations and have a turret, or leave it forward-mounted, or just about anything.

6a The first step is to create another node, parented to the PCO (if it were for a turret, I'd parent it to the turret controller nodes). Add New Child of type GenericFireArm, and name it oh58d_50Cal. -Edit- This node will generate your projectile (unless you use a MultiFireBarrel component; more on that in another section) so it needs to be located where you want your projectile spawned. By default, the projectile will be spawned in this node's +Z axis, so make sure it's alligned with your visible barrel. -End Edit- Before you start entering settings for it, be aware it's going to want a ProjectileTemplate. Now maybe I'm blind, but I couldn't find any projectiles aside from an M203 template, which this is not.

So! The first setting, oh58d_50CalFireArmProjectileTemplate = New Projectile. In the New Projectile dialogue box, enter a name like oh58d_50Cal_Projectile. Click OK, then click Reload Object in the Object Editor tool panel on the right side. Your new projectile should appear under the weapon, displaying with a little green arrow. Back to oh58d_50Cal for the moment, there are more Tweak sections to add. (just so you know, there are other projectiles available... in the Missile category. My first attempt made me a minigun that fired Hydra rockets - killer! Find these projectiles by clicking oh58d_50CalFireArmProjectileTemplate and navigating to c:program filesea gamesbattlefield 2objectsweaponsarmamentmissiles and picking whichever suits your fancy)

If you're copying settings from an existing weapon, you may get really confused (as I did) by the fact that the Fire, Ammo, and Deviation components (among others) don't have an obvious counterpart in the Add Component popup menu. Rightclick in the Tweaker, and in that massive list, select Add SingleFireComp Component. This is "Fire." Then, do the same with Add DefaultAmmoComp Component. This is "Ammo." And finally, to make it so your weapon isn't a laser beam, use Add SimpleDeviationComp Component to get "Deviation" in your Tweaker for the .50.


oh58d_50CalFireRoundsPerMinute = 450 -600 seemed a bit much for a .50, you may think otherwise however-

oh58d_50CalAmmoAutoReload = true

oh58d_50CalDeviationMinDev = 0.1 -greater numbers mean your shots hit a broader area and are less accurate. Tweak as you feel appropriate, but add a little-

That's it for your GenericFireArm settings. Of course, you can play around with the magazine size, heat, and so on, but the default settings work just fine.

6b Next up, you need to get your Projectile working properly. Since this is a bullet, not a missile, you can't simply add it by clicking the ProjectileTemplate field as I discussed earlier. Instead, you have to build it yourself. You could use Inherit Settings to duplicate an existing projectile; they DO show up with this if you navigate to the weapon you wish to copy and select WeaponName_Projectile. I'll assume by now you've caught on to how to copy settings from existing objects, and simply point out a few useful fields in the projectile.

oh58d_50Cal_ProjectileProjectileDamage is obvious. It's how much damage each individual projectile does. Why is the minigun so darn powerful? It fires 900 rounds per minute, EACH of which does 75 damage. That adds up quick!

oh58d_50Cal_ProjectileProjectileTracerInterval is the ratio of rounds fired to tracer rounds fired. 0 means no tracers, 1 means every round is a tracer, 3 is every third round, and so on.

oh58d_50Cal_ProjectileProjectileTracerSizeModifier controls how big your tracer looks.

Go ahead and mess around with making Über-DeathRays and Rocket Launchers of Doom +5 if you want. We're moving on.

6c The final touch to our fixed MG is making it actually look like it's firing! I added two components; a muzzle flash and a shell ejection effect.

To add the muzzle flash, rightclick on oh58d_50Cal and Add Existing Child (no need to reinvent the wheel here). Navigate to objectseffectsweaponsmuzzleflashesemitters and select e_muzz_minigun. Click OK, and position the node at the muzzle of the 50 caliber machine gun. Be aware, just like everything else in this game, it expects the Positive Z axis to be forward. Align the Z axis with the barrel if you need to.

The shell ejection effect, unlike the muzzle flash, actually interacts with any projectile collision mesh it contacts. Shells and links will bounce off parts and stay on the ground. Nice little touch. To add it, Add Existing Child and navigate to objectseffectsweaponsshellejectionsemitters and select e_shellejection_50cal. Position this node at the ejection port of the .50. Mine is actually positioned a little outside and below the port, because this effect spawns shells which simply drop. I didn't want them getting hung up on the inside of my collision mesh.

At any rate, you should have a pretty fancy looking machine gun by now. You may not be able to see the tracers if you enable Input and press Fire; they're there, though. Load it up on a map via the Level Editor, switch to Vehicle Camera, pick an outside view, and fire away. Pretty!

Share this post

Link to post
Share on other sites

7. Heat Sources

Next up, other people need a way to lock onto the helicopter while it's in flight. Every airborne vehicle in Battlefield 2 has both a heat source as a target, and a system of countermeasures to break missile locks.

7a The heat source is really simple to add. Rightclick your PCO, select Add Existing Child, and navigate to objectsweaponscommontargetobjects and select HeatObject. Then, position this node at the end of your helicopter's exhaust pipe.

7b I decided to make my flare launcher a bit different from the common one in BF2, since frankly I don't like the "ring of fire" it makes. Instead, I decided to make a launcher which fires two flares down and back, two up and to the sides, and two in between the others.

Now, you could create a system of a GenericFireArm and six RotationalBundles parented to it, pointing the +Z axes in the directions you want your flares to deploy (the order they deploy in goes top to bottom in the Resource list; top one goes first). I decided to make it easier for myself by setting this up in Maya first.

So, open up the helicopter model in Maya, and create a cube. Scale it down a bit so it's easy to position, freeze transformations and place it about where you want your flares to originate. I put them just below the exhaust port, near the real-world countermeasure device on a Kiowa. Name it oh58d_FlareLauncher__GenericFireArm in the Outliner. Then, duplicate this object, rename it oh58d_FlareLauncher_Barrel1__RotationalBundle, and rotate it so it's +Z axis points where you want the flare to shoot off to. Parent it to the Launcher, then repeat for each barrel you want to add. Remember to rename them with _Barrel2__ and so on, not Maya's default of tacking the number after RotationalBundle (The editor looks at it and asks "What's a RotationalBundle5? I only know of RotationalBundle!"). Once you have the barrels oriented the way you want, parent the Launcher to your PCO, save, and go back to the editor.

Import the mesh back into the editor. Don't worry about it resetting all your work to this point; the .Tweak file retains it's settings, and adds any new nodes it finds in the import.

7c Setting up the launcher is about as complex as the .50 caliber machine gun in part 6, with a few changes. First up, select oh58d_FlareLauncher, and add a DefaultAmmoComp component, a SimpleDeviationComp component, and a MultiFireComp component in it's Tweaker. These will show up as Fire, Ammo and Deviation (Yes, several different components share the same name, and can be a bit confusing. Examples: MultiFireComp and SingleFireComp both display simply as "Fire" in the Tweaker. If you need to know what any type of component really is, rightclick and look at the top of the popup menu where you add components. There are Remove entries for each actual component type. Useful for learning how things work).

Now add a projectile. In FireArm, click the ProjectileTemplate field, select New Projectile, and accept the default name. We'll come back to it in a bit. For now, here are some settings for FlareLauncher:

oh58d_FlareLauncherFireArmVelocity = 10 -slow, since flares are not high-speed projectiles-

oh58d_FlareLauncherFireRoundsPerMinute = 1800 -fast, to kick out all the flares almost at once-

oh58d_FlareLauncherFireFireInput = PIFlareFire

oh58d_FlareLauncherFireBurstSize = 6 -this is how many flares one button press kicks out-

oh58d_FlareLauncherAmmoAutoReload = true

oh58d_FlareLauncherAmmoMagSize = 6 -6 flares out, magazine size 6, has to reload flares after every burst-

oh58d_FlareLauncherAmmoNrOfMags = -1 -Infinite-

oh58d_FlareLauncherAmmoMinimumTimeUntilReload = 5 -five seconds, then the new flares cycle in-

oh58d_FlareLauncherDeviationMinDev = 6

Okay! Launcher set. But it needs barrels. Rightclick on each FlareLauncher_Barrel and select Make Barrel. They'll change icons.

Next up is the projectile. Since someone else already did the work to make it pretty, this is just a bunch of copying. Expand oh58d_FlareLauncher_Projectile, rightclick it and Add Existing Child. Navigate to objectsweaponscommontargetobjects and select HeatObject_Flare, then press OK. This will make the flares present false heat targets. Next, it needs a visible effect. Rightclick, Add Existing Child, navigate to objectseffectsvehiclesmisc and select e_flare_decoy. Next, rightclick the Projectile again, Inherit Settings, and find one of the Flare_Projectile objects from another aircraft to copy.


Share this post

Link to post
Share on other sites

8. View-Controlled Objects

There are all sorts of view-controlled objects in BF2. Helicopter chin turrets and sensors are one good example, tank turrets are another. They're actually pretty simple to set up, even with their own geometry!

8a Since I initially only had one PCO in my object, I need to go back to Maya to add a Copilot PCO to parent my Mast-Mounted Sight to, since I want it to look where he looks.

Add a new polygon cube, scale it down to keep things clean, freeze it's transformations and call it oh58d_CoPilot__PlayerControlObject. It can stay at the origin. Then parent oh58d_MastMountedSight__RotationalBundle to it, and parent oh58d_CoPilot__PlayerControlObject to oh58d__PlayerControlObject so the copilot will go where the pilot goes. Save, and go back to the editor.


8b Now, import your Maya mesh again and open it in the Object Editor. Find your copilot PCO in the Resources list and change the following settings:

oh58d_CoPilotDefaultNetworkableInfo = BasicInfo

oh58d_CoPilotHudVehicleCategory = VCHelicopter

oh58d_CoPilotHudControlsCategory = VCLand -the copilot doesn't fly but does need lots of weapon controls-

Also, you'll want to give them a camera and entrypoint, so select the copilot PCO, find the Object Editor's Wizard panel, select Helicopter, and click Run. Then, in the "Errors" section, select the options to add a camera and entrypoint. oh58d_CoPilot_Camera and oh58d_CoPilot_EntryPoint will work fine. Position these nodes as you see fit.

8c Now that your copilot can control stuff, we need to give him (or her, yes, chicks rock as copilots. They do terrible things with missiles :) ) something to do. For now, simply getting the Mast-Mounted Sight to follow their view will be sufficient. Expand the copilot PCO and select oh58d_MMS. It needs to be set to receive rotational input based on where the copilot looks. Here's how:

oh58d_MMSPhysicsHasMobilePhysics = true

oh58d_MMSPhysicsHasCollisionPhysics = true -remember it has a projectile collision mesh-

oh58d_MMSPhysicsPhysicsType = Mesh

oh58d_MMSRotationMinRotation = -80/-30/0

oh58d_MMSRotationMaxRotation = 80/30/0 -this gives a decent field of view, 160 degrees horizontal, 60 vertical-

oh58d_MMSRotationMaxSpeed = 50/50/0

oh58d_MMSRotationAcceleration = 5000/5000/0 -high acceleration means it follows exactly where the copilot looks-

oh58d_MMSRotationInputToYaw = PIMouseLookX

oh58d_MMSRotationInputToPitch = PIMouseLookY

Now, if you turn on Input and Switch Position to oh58d_CoPilot, hit the spacebar to focus on the helicopter, hold left control and move your mouse, the MMS should follow your inputs. At this point, you could add a laser target designator to it, or a sniper rifle, or whatever you want, and it'll (more or less) hit whatever you look at! You could also split this system into two parts, one for X rotation and one for Y.

Share this post

Link to post
Share on other sites
Please mention that you should add collision to the rotors! I find it very disturbing that helicopters can fly into buildings...

Ah! That's one thing I forgot. Rotors don't have Vehicle or Soldier collision meshes, which I noticed this morning as I was working on making animated rotors. So, my next update will include a change to the oh58d_PlayerControlObject's col1 and col2 to add a placeholder rotor blade at the top. Expect it tonight.

Share this post

Link to post
Share on other sites

9. Working Rotor Blades

For some reason, the rotors were a bit tricky for me. I had to go back and make several changes to my model, although nothing was too serious.

9a First thing to do is go to your RawDataObjectsVehiclesAirOH58D folder, and add a folder named oh58d_MainRotor and another folder named oh58d_TailRotor. Then, go to Meshes and copy OH58D.mb into the two new folders. Open up the original (in the meshes folder) and delete the objects oh58d_MainRotor and oh58d_TailRotor as well as their descendants. You'll need to create these as entirely separate objects, with separate Maya files.

You'll also want a transparent spinning blade texture. For now, just copy one from ahe_ah1z's Textures folder, paste it in your helicopter's textures folder and rename it something like oh58d_MainRotor_c.dds. If your helicopter has different numbers of blades on the tail and main rotors, create a second duplicate with the name oh58d_TailRotor_c.dds too. You can create new textures later.

Open the copy of OH58D.mb in the oh58d_MainRotor folder. The rotors need to have a geom0 segment for their stationary and spin-up elements, and a geom1 segment for the full-speed blurry-blade object. So! Delete everything except the main rotor and it's collision mesh, and separate them. Your scene should only have these two objects, and your cgfx light. Position the rotor and collision mesh at the origin, facing up like normal. Freeze their transformations. When you attach the main rotor to the helicopter, you'll manually adjust it's position, but you want to make sure it doesn't run into funny rotation problems.

Now that your rotor and col0 are alone, create a normal heirarchy for them. Select col0, group it, name the group nonvis_, parent the group to oh58d_MainRotor__Rotor, group again, name the group lod0, group again, name this group geom0, and parent them to a locator named root_bundledmesh.

9b Next up, select geom0 and duplicate it. It should take the name geom1 by default. This group will be the high-speed rotor, and is essentially a square with a texture map and a cylinder or two for the spinning drive shaft.

Hide geom0, and open up geom1 all the way down to nonvis_. Delete nonvis_ and col0. They won't be needed. Add a new cube to the scene. Scale this cube from the top view so it's edges match the diameter of the blades. The top and bottom faces of this cube will hold the texture for the spinning blades, which will be made later. Delete the edges of the cube, and scale the top and bottom faces nearly together, then move them to line up with the center of the rotor blades. Before you combine this mesh with oh58d_MainRotor (which is now just a driveshaft), UV unwrap it so both the top and bottom faces form a simple square from 0 to 1 in both U and V in the dnyUVPanel. This way, your square spinny-blade texture will map properly on them.

Make sure the blade squares are selected, and hit Assign in the dnyUVPanel. This should apply a new cgfxShader to them. Redirect this new cgfxShader's diffuseTexture and normalTexture to the placeholder oh58d_MainRotor_c.dds that you recently duplicated, and rename the material to "alpha." This tells the editor to use the Alpha channel of whatever texture you apply as transparency, rather than defaulting to using it as a specular map (again, thanks to Rexman for posting this clarification).


With the texture applied, select both the rotor square and oh58d_MainRotor__Rotor, and combine the meshes into one. Change it's name back to oh58d_MainRotor__Rotor, and parent it back under geom1lod0. Then, parent it's nonvis_ back to it. Save this object in the oh58d_MainRotor folder as oh58d_MainRotor.mb. Your full heirarchy and mesh should now look something like this:


Now, do the same for the tail rotor as you just did for the main rotor. The only difference, is you can leave the tail rotor on it's side like normal. It doesn't have to face up to work. Save it as oh58d_TailRotor.mb.

9c With that out of the way, your rotors should be ready to import as new objects in the BF2 editor. Open it up, and import them. (While you're at it, also import oh58d.mb; we removed several components from the Maya file, and that needs to be reflected in the editor) They'll show up in the Resources bar in the same place as oh58d. To make them rotate properly, they need settings in both their own .Tweak files and in oh58d's .Tweak file.

First up, open oh58d_MainRotor in the editor. It will need to receive input from an engine in order to spin. We'll use oh58d_Rotor, but you could try it with oh58d_MainEngine or even _TailEngine if you really felt the urge. Here are the settings it'll need to function:

oh58d_MainRotorFlagsSaveInSeparateFile = true

oh58d_MainRotorDefaultNetworkableInfo = BasicInfo

oh58d_MainRotorDefaultGeometry = oh58d_MainRotor -this lets the node effect this piece of geometry. Yes, it refers to itself-

oh58d_MainRotorPhysicsHasCollisionPhysics = true

oh58d_MainRotorPhysicsPhysicsType = Mesh

oh58d_MainRotorPhysicsChangeLodAt = .20 -this number tells the rotor when to change from the low-speed mesh to the high-speed textured rotor. Higher numbers mean it spins faster before changing, lower is slower. This value depends on the RotationSpeedMod setting and your choice of engine-

oh58d_MainRotorPhysicsEngineName = oh58d_Rotor -this is the engine which, when active, will spin up the blades-

oh58d_MainRotorPhysicsRotationSpeedMod = -0.5 -this is a multiplier for how much of the engine's rotation reaches the blades. In my case, they spin too fast the wrong way with a value of 1, hence the negative .5-

oh58d_MainRotorPhysicsRotationSpeedModBlur = -.05

oh58d_MainRotorPhysicsRotationAxle = 0 -depends on the orientation of your rotor, but it's combined with the engine's direction vectors. Change this if it spins on the wrong axis-

The tail rotor is essentially the same. Map it's EngineName to oh58d_TailRotorEngine, and tweak the rotation speed settings after positioning it 'til you like how it spins.

Okay! That's it for your rotors. Now, open up oh58d, rightclick and Add Existing Child. Select oh58d_MainRotor. It should appear with it's pivot at the origin/center of gravity. Do this again, and add the tail rotor. Switching to Input mode at this point should cause the blades to spin up, despite the fact that they're probably in the middle of your helicopter.

I ran into a lot of trouble getting the rotors in the right place since the editor wouldn't let me reliably position and rotate pre-made objects, so I ended up tweaking their positions manually in Battlefield 2modsMyModObjectsVehiclesairoh58dmeshesoh58d.tweak by finding the line saying ObjectTemplate.addTemplate oh58d_mainrotor and adding the following lines directly beneath it:

ObjectTemplate.setPosition 0/0.7/0

ObjectTemplate.setRotation 0/0/0.

The next line down should be for the tail rotor, so add Position and Rotation entries as necessary to position it properly.

These settings are where the rotors were when I made the whole helicopter, back in Section 1. While the Rotation entry isn't necessary in this case, I've included it in case you want to add something with a rotation other than that with which it was made. Save your .tweak file.

After restarting the editor, you should be able to load your helicopter and find the rotors properly positioned. Switching to Input mode should make your rotors spin like you want them to, and away you'll go! If you're like me, at this point you'll load up the Level Editor, add your helicopter to it, switch to Vehicle mode, and blast the crap out of everything you see. Wheee!

Share this post

Link to post
Share on other sites

9. Conclusion

That about does it for a basic helicopter in Battlefield 2. It still needs a Wreck mesh, textures, a few tweaks to the pilot animations and exit settings, and sounds to work in-game, but those are fairly simple tasks. The wreck's just a beat-up duplicate of the base object, textures are already in place (they all have placeholders. Just replace the textures and import the meshes again), pilot animations are fairly simple to add in the Animation editor, and sounds are just an exercise in inheriting settings from other helicopters. Of course, you might also want to add Hellfires, change collision mesh material types to add glass, light armor, rubber or whatever, and any of a number of other customization options. For now, you should be able to figure out how to do most of this by looking at preexisting objects and stuff in the editor (which is exactly what I did to figure all this out) and by asking intelligent questions in the forums.

So! Hopefully your helicopter (or dropship, or zeppelin, or Chitty-Chitty-Bang-Bang) has given you a good start. If I have time and energy in the few days I have before classes start again, I'll add appendices to this tutorial to cover any new, cool helicopter-related stuff I learn. Regardless, feel free to ask for help any time!

Share this post

Link to post
Share on other sites

Just a little rectification, when doing a turret , sometimes (i haven t find out yet why, maybe when you have a camera set in your zoom component)your genericfirearm rotate so that the bullet will it what you are aiming at.

A good example is the cobra copilot machine gun, the camera is about 1 meter above the gun but the bullet actually hit where your crosshair is.

Share this post

Link to post
Share on other sites

Okay, I feel really dumb because I can't figure this out & I've spent 2 days tweaking every possible value in the editor I think could possible have an effect in addition to searching here for an hour & 1/2.

I understand the helictopers are basically a big vectored thrust engine but how can I tweak the helicopters so that they fall quicker? Using the AH1Z as an example, do I need to change the rotation of the ahe_ah1z_Rotor from 0/-86/0 to something like 0/-76/0 and then lower the overall inertia? I'd like for my helicopter (it's an AH6..will be when I'm done) to be less "floaty" and more agile (sorta like in DC).

Share this post

Link to post
Share on other sites

You dont need to change that.. I would think angle of attack settings... on rotorhead2. Try changing the default angle of attack to a lower value.

If not this.. Could be the Rotorhead1 / rotation/ acceleration value and the rotorhead2 value that is opposite that one. Just my guesses tho.

Share this post

Link to post
Share on other sites
I understand the helictopers are basically a big vectored thrust engine but how can I tweak the helicopters so that they fall quicker? Using the AH1Z as an example, do I need to change the rotation of the ahe_ah1z_Rotor from 0/-86/0 to something like 0/-76/0 and then lower the overall inertia? I'd like for my helicopter (it's an AH6..will be when I'm done) to be less "floaty" and more agile (sorta like in DC).

Yes, the helicopters do feel a bit squishy in BF2. However, changing the rotation like you suggest will only alter the engine's thrust; it will not change how quickly that thrust is delivered or changed. Also, the DefaultInertiaModifier variables don't do much for me. Since I assume you're going for a more "crisp" feel to the control inputs, here are a few things to try:

To get your horizontal movements sharper, increase the rotational max and mins of ahe_ah1z_Rotorhead and ahe_ah1z_Rotorhead2. The larger the values (absolute values, so bigger positives and bigger negatives, not just positive) the farther the engine moves from the center of gravity, and the more extreme your control input effects. Also, the Acceleration channels of these components can increase or decrease control responsiveness.

To make the helicopter less "floaty" when moving up, change the Acceleration value of ahe_ah1z_Rotor. The common acceleration on this component is quite low, so it takes a while for the rotor to reach maximum thrust. Increasing the acceleration a little makes it feel a little less heavy, while increasing the acceleration to something ridiculous like 5000 makes it extremely crisp and responsive.

To make the helicopter less "floaty" going down is a bit trickier. Ahe_ah1z_Rotor seems to produce a minimum amount of vertical thrust even when idling, which can be useful when floating in to a landing. One possible solution is to make it so the engine can provide downward thrust; this way, when the player needs to drop fast, they slam the throttle all the way down and drop like a stone, but the helicopter won't simply fall out of the sky if they just leave it in hover. To do this, experiment based on these settings:

ahe_ah1z_RotorPhysicsCanReverse = true (now you can get positive and negative thrust, based on your MaxRotation and MinRotation settings)

ahe_ah1z_RotorRotationMinRotation = 0/0/-20

Leave MaxRotation untouched, but make sure you increase your Acceleration component; if you don't and the helicopter builds up any downward momentum from the engine, it'll pancake into the ground. You need to be able to quickly go from negative to positive thrust for this to be controllable.

Finally, you can increase the MinRotation and MaxRotation of your TailRotor_Engine. Since it already accelerates quickly, this'll give it a bit more power to swing the tail around.

Share this post

Link to post
Share on other sites


THANK YOU! THANK YOU!! Your explainations above helped me have a more complete understanding of the helicopter functions. I've got my little bird to be more responsive & less 'boat motion' feel. I'm still working on the deceeration part. I was thinking of addtemplating an (invisible) jet engine that provided just a bit of that negative velocity. I'm not sure this will work but I figured I would at least try and let everyone else know why it did or didn't work.


Share this post

Link to post
Share on other sites

I really don't mean to be ignorant, because I'm just honestly confused. I use 3D Max 7 (yes i know the tutorial is for maya) and I've been using it for about 6 years...i know the program pretty well and modding in general (not so much the coding aspect)...I took a look at your tutorial and got through the first steps easily, but once I get to applying textures, I just get lost (especially once it gets to the specific maya options that Max doesn't have).

I'm really dieing to get a VTOL ship im working on in game, and really struggling...I've spent a few hours looking over your tutorial, and im just stuck

Once again I realize this is made for Maya, and yes I DO have a lack of editing in Battlefield (usually had people in staff that did it, and i just never took the time to learn) I'm just struggling trying to translate the information into 3d max terms. I'm actually stuck on this step

2. Basic Texturing  

2a Each of your Collision Meshes needs to have a texture type the editor recognizes. In my case, I copied another tutorial and gave all of them a new Lambert material named light_armored_vehicle. You can of course use any other material type the editor recognizes and apply them to specific polygons individually (I think) but this is fine for now.  

2b Select each of your visible meshes. They should already have their UVs layed out nicely. Open the dnyUVPanel from the command line, make sure that your visible meshes are selected (their UV layout should be visible in the panel), and click the [...] button by Assign. Navigate to C:Program FilesEA GAMESBattlefield 2mayaCGFX6.0 and select BundledMesh.fx and click Open. This shader is used for all the dynamic non-player visible meshes. The other two are for static objects and player skins.

And after this as well

Once again I know it's hard to teach people, especially once youve already explained it. I'm just kinda struggling and hoping I can get some help, thankx

Share this post

Link to post
Share on other sites

I'm sorry if this has been a bit difficult. I've honestly not used Max in at least six years, so I can't give you specific steps for this. However, I will try to explain more in depth what I was doing, without being Maya-specific.

When the BF2 editor imports an object, it uses a mesh's shader to determine how to treat the mesh in the game. The editor recognizes two types of shaders; cgfx shaders and anything else. CgfxShaders are applied only to visible items in the game; anything with a cgfxShader becomes a visible object. Every other shader type is nonvisible. If the shader has a name the editor recognizes as corresponding with a material type in the BF2 engine, the mesh becomes a nonvisible mesh with the properties of the named material.

So, in 2a when I give the Collision meshes a material called light_armored_vehicle, the editor takes the mesh with that shader and imports it as a nonvisible mesh, which uses the material properties of light_armored_vehicle any time something (projectile, soldier or vehicle) collides with it. You can give different materials to different parts of a mesh; the editor still recognizes everything correctly. You can have rubber wheels and concrete wings, for example.

In 2b, you lay out your model's UVs so that you can create a usable texture map. All that the dnyUVPanel plugin does in this case is apply a cgfxShader to your selected mesh. I do not know if this is a necessary step in Max, but I assume it is. At any rate, the mesh with the cgfxshader will be visible in the game, so you'll apply your diffuse and normal maps to this mesh. Anything without a cgfxShader will not need a texture map, since it won't be visible when you import it. CgfxShaders use DirectX compression and code to render visible real-time objects in the game. BF2 has a couple of preset shaders for vehicles, soldiers and static objects.

After this step, it's a matter of applying textures like you would for any other model, except you're using a cgfxShader instead of a Blinn, Lambert, or any of the other more common shader types. If you're still stuck or need some clarification, feel free to point out what's confusing and I'll do my best to help.

Share this post

Link to post
Share on other sites

Just to say thanks for the tutorial, im making a chopper myself, difference is i only work in XSI, so im going to be learning maya as i go, havent exported yet but soon will to maya, based on past experiences, trasfering models from one 3d package to the other is a full time job in itself :P.

thanks again bud, expect me posting stupid questions soon!

Share this post

Link to post
Share on other sites

Where would you suggest I start looking if my chopper is ridiculously hard to control? I've tried playing with your torque settings and such but they don't have much effect as far as I can tell. Here are some qestions you can can answer if you're bored:

1) My model is a much smaller scale than your example; does the actual 3D model have any effect on the relative positions of the rotors? That is, could I take your exact settings, replace your model with a smaller version, and expect it to handle the same?

2) Say I tap my ""Yaw left" control and my chopper goes into a six billion revolutions per minute spin... where would you start looking to narrow the problem down? It seems like moving the "rear rotor" engine along the negative z-axis would make a difference, but it doesn't seem to.

I guess where I'm confused is: could you take a model that is (in game) 3 inches long and make it behave/feel like a full-sized chopper? Does it really matter where the __rotor object is in the editor compared to where the physical rotor is on the model, or is that just a "look and feel" thing?

Share this post

Link to post
Share on other sites

I haven't added a chopper yet, but you might also want to check out the mass and drag in the main mesh.

(i haven t find out yet why, maybe when you have a camera set in your zoom component)your genericfirearm rotate so that the bullet will it what you are aiming at.

There's probably some kind of option in your firearm tagged fireincameradof or somesuch. BF42 and BFV had it too, and it made the guns fire where you pointed the crosshair.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this