User Tools

Site Tools


ofp:modeling:brsseb_lesson3

This is an old revision of the document!


Lesson 3: Creating your first Weapon

Creating your first Weapon by Brsseb

Preparing for the lesson

Hello, and welcome back. Its time to make our first weapon in OFP. Yes, thats right. A step by step tutorial that covers the most of it; from modelling the gun itself to getting it ingame.

So, what skills do you need then. Lets see:

  • OFP (daahhh), O2 and Bulldozer
  • Basic understanding of the O2 interface
  • Having fully understud stuff from lesson1 (like creating LODs, selections etc)
  • Also, if you made it through lesson 2, this should be an easy lesson.
  • PBOTool and TexView

Ok, thats the most important things. Lets have a look at the model we are making:

The weapon

The gun we are going to make is nick-named “Stalker” and its a sniper rifle from Browning. Here, have a look:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_b_1.jpg

Cool, isnt it? Well, it aint going to appeal to everyone, but its the gun we`re going to make. Why this one, you say? Well, first of all we got a great side-shot of the gun on their page, its mostly black (makes texturing-screwups easier to hide:) ) and most of all, it looks pretty cool!

So, here is what you need to do to get started:

  • Go to where Bulldozer is installed and make a folder named “stalker”.
  • Download the texture files here and extract them to the folder.

When you`re ready to start, go to next page.

Placing vertrices

First we must create the actual gun model. Do this:

  • Fire up o2 and Bulldozer and save the new file as stalker.p3d in the stalker folder you made earlier.
  • Activate front view, press “A”, click RMB (right mouse button) and select “load Texture”. Find your Stalker folder and load the “blueprint.paa” file.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_1.jpg Load the texture we are going to use as reference

  • The draw a box about, say 80% of the grid background. Then hit RMB and select “Correct Aspect” to ensure that the image dimensions are of the right scale. Also select “Horizontal Mirror” from the same menu so that the gun is pointing left.
  • Hit F4 to leave texture mode. The front view should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_2.jpg

Now me must model the side shape of the gun. We do that by outlining the gun profile with vertrices. That means we use “insert” at various points around the model. Later we will create faces on these vertrices. Lets start with the back, shall we:

Zoom in on the rear gun part and start placing vertices using your cursor and the “insert” key. Start somewhere and work your way around the shape. Excatly where to place each vertex is not something you can learn just like that, it comes with modelling experience. Trial and error, that is. Here is how it could look like:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_3.jpg

Note that there are few vertrices at the strait points and more vertrices where there are more round and soft shapes. Remember that we are dealing with polygons and therefore there are only straight lines between points. So we need to have many vertrices where the model is supposed to have a round shape.

Now lets have a look at the middle section (leave out the trigger area and the scope right now). Here is my suggestion:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_4.jpg

Doesnt look too back, does it? The main shape is there, at least, Note that we are not going any more left right now, the front section (muzzle etc) will be made of a small cylinder structure later. The same goes for the scope; later.

Now for the hard trigger area. This is the roundest shape on side view and therefore need many vertrices to look good. Remember that the area between vertrices will be filled with faces, so we need an inner and an outer vertrice ring, like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_5.jpg

Ok, so it aint perfert. Its sometimes hard to imagine how the vertrices will look once we have made faces, but dont worry. its easy to move them later. And we havent made the actual trigger yet, we`ll do that later.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_c_6.jpg What it should look like so far

When you`re happy with your vertrices (If you aint, move them, add some or delete some to get the right shape), move on to the next step. And dont worry of some are a bit outside the background texture, “blueprint.paa” is only for reference, we use another one for the actual texturing.

Making faces

Now its about time to make the vertrices do their job. Lets start with the rear gun section. Making faces is easy, you select 3 or 4 vertrices and hit F6 to make a face. If you have read some basic o2 tutorials, you`ll know that every face has a “face normal” or a “direction”. That means that a face is normaly only viewable from one side, the direction of the face normals (little blue lines poking out from each vertex). I assume you already know a little about this (if not, find a o2 interface tutorial or any 3d tutorial that deals with polygon modelling).

You should also heard that o2 supports faces created with 4 vertrices and not just 3 as in big-shot programs like 3dsmax. That way we can use less faces than normaly and still use 3-vertex faces when needed. We will select 4 or 3 vertrices and create faces on them using F6. Be careful to not overlap faces, that can make your model flicky and look bad ingame.

I`ll show you how to make your first face:

  • Zoom in on the rear gun section. We`ll start with a 4-vertex face.
  • Select the 4 vertrices as indicated on picture below:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_1.jpg

  • Hit F6 and a face should be created.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_2.jpg

Now we must make sure that the face is “facing” the right way. When I did this, my face direction was going from me in front view, not towards me as I wanted. So I had to reverse the face direction to make it the right way. Remember the trick I talked about in lesson 1, to see if the face is facing you? Go With the face selected, go to menu “View→Fill solid faces”. Now, if the face is filled red, you know that it is facing towards you, but it if seem do disapear (it will go black and be hard to spot due to our black texture), it is facing the wrong way. To reverse the face direction, hit “W” key. Remember to make all faces face the same way during the rest of the page.

Now we have our first face. Note that we need to use a 3-vertex face just below our first one, since there are only 3 vertexes in that area. Select them using F4 (vertex select mode) and hit f6 again. Now o2 is pretty smart and it should face in the same direction as the last one, but check it out with the “Fill Solid faces trick” anyway.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_3.jpg

Now , work your way around the rear part and create faces between the vertrices. Use 4-vertex faces where you can and 3-vertrex-faces where you have to. Make sure all is facing the right way and that noone overlaps eachother. You can delete a face without deleting the vertrices. Just select the face (F4 and all vertrices in the face) and delete it by hiting “D”-key.

Here is how it could look like when done:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_4.jpg

Another great way to ensure all faces are in the desired direction is using the 3d view with “Face Culling” turned on (View→Face Culling or “F” key). When face culling is on only the faces that are pointing in the camera direction are drawn.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_5.jpg 3d view with selected faces with face culling on. Since all faces are shown, they are facing the right way

Let me show you why this feature is so great for searching out wrong-pointing faced. I will now select one of the faces and reverse it. Se what happened in the 3d view:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_6.jpg 3d view with selected faces with face culling on. There is now a hole it our structure, which means one of the faces are the wrong way

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_7.jpg 3d view with selected faces with face culling on. If we now move the camera and have a look at the back, we find our AWOL face again. As you can see, this is a much better and faster way to find bad faces compared to the “Fill Solid face”-trick I told you about earlier

Now if you have understod the above, applying faces to the rest of the model should be easy. Just be careful, take it slow to make sure all faces are the right way and that noone overlaps eachother. Here is some pics of how it should look like:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_8.jpg tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_d_9.jpg

Lets move on, shall we

Applying depth

So, our basic model is shaped up. Hey, it even looks like a gun, right now. But that only in front view (and finnaly, if you`ve been wondering why we have been using front view for our side shape, its because thats the way it is done with weapons. Dunno why. If we dont do this, the gun will be pointing in the wrong direction when someone tries to use it ingame). Right now its just completely flat. Lets do something about it:

  • Select the whole structure using Ctrl+A (or F2 on any vertex).
  • Activate left view without loosing the selection (Alt + LMB).

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_1.jpg

  • Now hit Ctrl+C to copy the structure. Then hit Ctrl+V to paste the new copy. It will be at the same spot as the original.
  • Lock the x-axis and move the copy a bit to the right using RMB.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_2.jpg

  • Note that the copy`s faces are the same way as the original, to the left that it. But we now want them to point the other way, so with the copy selected hit W to reverse its faces.
  • Now it should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_3.jpg Front and 3d view with both structures selected. Note that here is faceculling turned OFF just to show up everything in a single picture

Now we must patch the two sides togehter. That means selecting 4 and 4 vertrices and making faces. The easiest way to do so if using the 3d view. The hardest part in this is placing the camera right and selecting the right vertrices. I`ll help you with the first one:

  • Position the camera as in the picture below and select the highllighted vertrices.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_4.jpg 3d view with face culling turned off

  • Hit F6 to create the face. Then make sure that the blue lines are pointing out of the structure like in pic below. Use W tor reverse the face normals if not.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_5.jpg 3d view with face culling turned off

Do the same thing for the whole model! Yes, its hard and boring work, but its really good modelling practice. Make sure to select the right vertrices, its so easy to select the wrong ones if you are in a bad camera position. Use the other views combined with the 3d view as a guide. Afterwards use Bulldozer and the face culling trick in 3d view to look for leaks (faces pointing inwards of missing).

In the end, it should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_6.jpg 3d view with face culling turned off

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_7.jpg Bulldozer view

And, yes, one more thing. After you`re done, select the whole thing using Ctrl+A. Then, in left view, lock the x-axis and move the whole shape to the left. Try to place it so that the middle red line on the grid is in the center, like in picture below.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_e_8.jpg

Phew, that was a lot of work, dont you think? Well, im glad to tell you that the hardest bits are over. If you made it so far, you should be fine in the next ones too.

Muzzle and scope

Our gun is now really 3d, but its missing something, mainly the front section. We will make this one now out of a standard cylinder. Lets go:

  • Activate left view and hit F8 to create a cylinder shape. Use 8 in the “Segments Radius” and 3 in “Segments Z” .Hit ok.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_1.jpg

Now in 3d view you`ll see the cylinder. Its pointing in the right direction but needs some scaling down.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_2.jpg

Head for front view, and use RMB to move the cylinder to this position:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_3.jpg

Lock the x-axis using x-key. Select each colum of vertrices using F4, and move them so that the result looks like pic below.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_4.jpg

  • Now, select the two rightmost colums of vertrices, be careful not so select vertrices from the main gun structure. Choose Points→Transform3d→Scale from the menu. Leave the x-axis as 1 and try to find a decent value for the y and Z box (whatever the value, z & y must be the same value, or the cylinder will look squeezed). I cant give you an exact value, since your model might not be of the same scale as mine. But for me something around 0.1 for y and z worked fine.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_5.jpg

  • Do the same thing with the last two colums of vertrices, but keep their y & z scale valuse a bit higher, since the muzzle is bigger in the front. For me, z and y values of .12 worked fine.

In the end, it should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_6.jpg

Now we must create the scope and we use the same proccess as above. We create a cylinder with several divisions and resize each and everyone of them. We also need two boxes for the scope supports beneath it.

  • Activate left view, hit F8 and type enter the values below:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_7.jpg

  • Go to front view and move the cylinder structure like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_8.jpg

  • Then, like we did with the muzzle, lock the x-axis, select and move each colum so it eventually looks like below.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_9.jpg

  • Still same thing as before, use 3d scale to get the right look and feel of the scope. Your values are not the same as mine, so experiment a little with the y and z value. Dont touch the x-value though.

The scope should end up like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_10.jpg

Then we need the two blocks right below the scope to hold it in place. This should be easy for you to make now and you could make them by outlining the shape with vertrices, making faces, adding depth and fill in the gaps with new faces again. Just like we did with the main weapon profile in the start. Here are the ones I made:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_11.jpg tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_12.jpg The two structures for the scope. (Note: Moved them away from the weapon just to show them better on picture)

Anything more then? Yes, the trigger itself. It dowesnt show up on our picture, so we`ll just do some free-hand modelling. After all, this is just a tutorial and the model we are making are of pretty low-polygon quality. Here is how the one I made look like:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_13.jpg tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_14.jpg The trigger structure. (Note: Moved away from the weapon just to show it better on picture)

You`ve done it. The model is finished!

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_f_15.jpg

Now lets do some texturing, shall we?

Texturing

Now we must put some cool textures over our basic gray color. All textures are in the zipfile you downloaded at the start and should now rest in your stalker-folder. Lets go:

  • In front view,select all (Ctrl+A) so that everything is red. Hit A, RMB and choose load texture. Load the one called “stalker_tex.paa”. Also, RMB and choose “Horizontal Flip” to make it face the right way.
  • Now, comes the hard part of scaling the texture so that it fits our model pretty accurate. Use Ctrl+Shift+Up/Down/Left/Right keys to scale it. Remember to RMB and choose “Correct Aspect” from time to time so that the texture doesnt get deformed. I know its hard, and it would have been easier if we had cut the texture in pieces, but try anyway. And remember this is a tutorial so there is no need to get it absolute right. I eventually was satisfied with this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_1.jpg

When you`re happy, with everything selected hit “B”-key and the texture should be applied to your gun model. Check it out in Bulldozer. Not bad, eh?:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_2.jpg

So, its not going to win a beautycontest, but it doenst look too bad for a tutorial model. At least not that bad, anyway. I think it looks pretty cool. One thing though, it could need a better front and rear for the scope, some glass-looking texture. There is one in your stalker-folder so lets apply it now:

  • In front view, RMB click and choose “unload texture” to remove the texture. We`re done with that one. Now, zoom in on the scope front, hit F4 and select the scope front colum like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_3.jpg

  • Activate left view without loosing selection (Alt+RMB), hit A key, RMB and load the texture named “scope_glass.paa”
  • Draw the texture box around the scope face. Use Correct Aspect to ensure right image dimensions.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_4.jpg

  • When you`re happy with your texture placement, hit B to apply it to the scope. Check it out in Bulldozer and try again if you messed it up. This is my result:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_5.jpg

Now do the same thing to the other end of the scope. Just follow the same steps as above. Select the rear scope vertrice colum using F4 in the front view, go to left view and scale the glass texture so it fits the smaller scope end nicely. Then applying it with B and check out in Bulldozer.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_6.jpg

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_7.jpg

Here is my result.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_g_8.jpg

And that way texturing, my friend. Now the hard modelling is over, just some simple LOD stuff and the making of a basic config-file for weapons left. Go go go!

Memory LOD

As in all ofp addons, we need to sort things out in LODs. But for guns we only need one, the MemoryLOD. And it contains only 4 vertrices! Simple stuff, really. Lets begin:

  • Create a new LOD and change it to “Memory LOD” by RMB and choosing “propeties”.
  • Go to front view and zoom in on the barrel like picture.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_h_1.jpg

  • Place a vertex on the center of each end of the barrel. They must be on the same height (or the gun will not shoot strait), so make only one, lock x-axis and drag-copy the next one using RMB+Shift and move. The result should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_h_2.jpg

  • Then, remember in many of the LODs in Lesson 2 we selected and named single vertrices and called them names using czech words?. Well, do that now and call the vertrices the names on the picture above. “Konec hlavne” means end of barrel and “usti hlavne” means start of barrel. If you dont know how to save selections, see lesson 2.

Now the gun can fire right. But we also need to indicate where the gun should spit out the empty cartridges. Just like the barrel, we need a start and stop position since the cartrides are “shot” out of the gun. Their placement isnt all that important, so I just give you a 4-view picture of how I positioned them. Save each of them as selections named as in picture. “Nabojnice” means cartridge-case in english.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_h_3.jpg

Finally, we need the 5th and last named selection called “zbran”, which simply means weapon. The selection consist of all four vertrices, so just hit Cltr+A in Memory LOD and name the selection “zbran”.

Here is the selections you should have made in this part:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_h_4.jpg

Thats all the LODs we need for a weapon addon. No kidding. Move on.

The muzzle flash

Well, ok so we werent all done with the modelling stuff. I guess I lied a bit there. But this is very simple.

If you dont already know, the flash that occurs when firing most guns in OFP is no fancy special lightingeffect or anything. Nope, its just a simple model with transparent smoke-textures on it that occur the split-second the weapon is fired. Disappointed? Dont be, because its easy to make and looks good enough anyway.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_1.jpg Have a look in your stalker-folder and check out the two textures flash_side.paa and flash_front.paa.

Lets get this over with quickly, then:

  • Go back to the “0.000” LOD.
  • Activate the top view and then find “create-plane” on the menu. Hit ok. Just after you hit OK on the dialog, hit F6. The blue lines (indicating face direction) should go away and the plane is now a double sided face. It is now viewable from both sides, check it out in Bulldozer and 3d view with Face culling on and then off. Cool, eh?
  • Now move the plane along the x-axis in top view (using lock x-axis), make it a bit more like a rectangle. Then, in front view, lock the y-axis and move it upwards. It should look like this in front and top views:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_2.jpg

  • Now we apply the flash_side.paa to the plane. Since this is a double sided plane, teh texture will be viewable from both sides. Activate top view, zoom in on the plane and hit “A” key. RMB click and choose Load texture. Load flash_side.paa and drag teh texture around the plane. Make sure that BOTH sides on the plane are select, not just the one. Do that by making sure that both sides are grey in Bulldozer. If one is red like the rest of the gun, use F2 and select one of the plane vertrices. Then apply the texture using “B” key.
  • Check it out in Bulldozer. It should look like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_3.jpg

  • Now that we have one horizontal muzzleflash plane, we could need a vertical one. This time we simply copy the one we made and rotate it.
  • Select the flash plane, Ctrl+C to copy and Ctrl+V to paste. Then on the menu find Transform3d→Rotate.. and rotate the new copy 90* on its X-axis (if you have the front-view active, that is). The result:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_4.jpg

We need one other muzzle flash, a circle for the flash_front.paa so that the flash is visible when looking strait at the firing gun (aka getting shot at).

  • Activate the side view and find create→circle on the menu. Make the “Segments Radius” from 10 to 6 and hit ok. Move and resize the circle so that it looks like this in 3d view:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_5.jpg 3d view with face culling OFF

  • But we need doublesided faces, so with the cricle selected, press “D” do delete all faces on the circle so that only the vertrices are left, like this:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_6.jpg 3d view with face culling OFF

  • Now we must make two doublesided faces by using F6 twice (!) on each face. In Select the 4 upper vertrices and hit F6 twice.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_7.jpg

  • Then select the bottom 4 vertrices and hit F6 twice to make the lower face.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_8.jpg

  • If you`ve done everything right, you should see a roundish-looking shape at the barrel end with both sides visible in Bulldozer.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_9.jpg

Now we need to texture it. Thats easy, aint it? You`ve done it many times before. Just select the circle using F2, hit “A”, load the flash_front.paa, draw around circle in side view then apply it using B-key. Routine, isnt it?. Soon second-nature, I hope. Well, anyway, this is the final result:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_i_10.jpg

Ok, almost done with our model now..hang in there. We need two simple named selections in our primary LOD, “0.000”. OFP needs to know what parts are the gun model and what parts are the muzzle flash. So select all the muzzle flash parts (3 structures, two planes and a circle), and name them “zasleh” (“flash”) in the named selection window. Then you need to select all the other parts; muzzle, main gun body, two scope holders and scope, trigger, hmm..anything else?..no. Name that selection “zbran” (weapon).

And if everything is done correctly, you are now finnished with the model! Great job. Look trought the previous steps and make sure everything is right. And check that the texture paths are right (we learned how in lesson 1). Ok, done?. Configfile next, then.

The weapon config file

Only one obstangle away from testing our model in-game. Now that has to be good thing, doenst it?. Well the bad thing is that our configfile is on the wrong side of “very confusing” for a any beginner. So, as Ive done before, I will lay out the configfile and explain only some key attributes and leave the class-inheritance stuff for you do learn from an other tutorial. In fact, you could just move on to the next step if you want, but I advice you to read this and at try to get an overview of what is going on in the configfile.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_j_1.jpg Snippet from the most important part of the config-file. There are more stuff in the configfile, but only the above is the interresting parts right now

If you have some ObjectOrientet programming experience, you`ll see that Ive inherited (aka “stolen”) most of the M21 sniper rifle and changed some key attriutes. The ammo is regular sniper ammo and both the gun and ammo have the same name (so if you are to add the gun and ammo to a person in the editor you would write this AddWeapon “Stalker”; this AddMagazine “Stalker”;. The displayname is “Stalker Sniper Rifle” and Ive also prepared a small photo of the gun for the ingame journal on the map screen called “photo.pac”.

Then Ive also made a civilian equipped with the gun. He is called “Stalker Hunter” and carries the rifle with 4 magazines. There are 20 bullets in each magazine, just as the M21.

Ok, enough config-file now. Lets just leave it alone and test our model ingame instead. Roll on.

Finishing up

Ok, lets do this. Its time to test it ingame! Run PBOTool, select the stalker-folder and save it as stalker.pbo in the OFP addons folder. Then start up OFP. Go to the editor and find the civilian called “Stalker Hunter” on the Civilian→Man list. Then come back to the lesson after testing.

You`re back, huh? What? Something is wrong, you say? The gun is bigger than an airplane? Like this, for example:

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_k_1.jpg Now THIS would be fun in multiplayer. But its more like “Big Bertha” than “Stalker”…

Well, thats right. Its not scaled right yet. Hey, at least it is pointing in the right direction! And it works, doesnt it? With sound, cartridge shootout, muzzle flash and proper scope? Not bad, eh?

You need to use the 3d scale tool in o2 to make it the right size (remember when scaling to tick on the checkbox “Apply to all LODs” so that the vertices in Memory LOD follows the rest of the model). Normaly this is just trial and error. Scale it down a bit, compile and test it. It it still too big, do the same thing again. Im not sure how big the thing is in real life, maybe the web site can give you a clue. Just remember that each grid square is 1 meter.

One thing you can do to help you, is to “merge” a p3d file of an other sniperrifle, like the M21 or the Dragunov. That will make it easier to scale your own model. Also, it will give you a hint on how the model should be placed to rest nicely in the hands of a soldier. Note that you cant load up the M21 model from your OFP copy since the developers have crypted their files. But they didnt lock up the model files from the first single player demo of OFP. So if you want a p3d model of, say, the M21 sniper rifle, go to my links-page for clues on where p3d`s from the demo can be downloaded.

You can also merge usermade models, other sniper rifles downloaded from the net. Just use PBOTool to unpack them and have a look at their p3d file. When you`re done scaling and moving the gun into position, remember to move both the gun in “0.000” LOD AND the 4 vertrices in Memory LOD). Thats trial and error too, im afraid (if you havent downloaded any demo or unofficial addon p3ds, that is).

Here is how my model looked like in the end. Pretty cool, I think.

tactical.nekromantix.com_images_wiki_brsseb_brsseb_lesson3_k_2.jpg

One thing, though. You have noticed that we only have one model LOD, “0.000” in our model. Normaly we have at least 3 different models, one more detailed than the other. This is to compensate for the different hardwaresettings and the distances the model is viewed from. No point in having the machine draw small details, like the heavy-polygon trigger area when the gun is view from a distance far away. This is very important to know if you are to release any addons. Look at other addons and see how its done, because since this is just a simple tutorial Im not going to cover this here. Its not that hard and you should be able to figure this out for yourself.

But now its time for you to feel proud because you just made your first weapon in OFP! As usual, you can download the final model here. And I welcome any feedback on my lesson on hotmail.com (or via MSN directly, I`m online almost every day).

That concludes lesson 3. Happy sniping.

Notes

This tutorial was written by Brsseb in here, it was posted here with his permissions, thank you Brsseb!

ofp/modeling/brsseb_lesson3.1209887309.txt.gz · Last modified: 2008-05-04 07:48 (external edit)