Table of Contents

Lesson 5: Creating your first Gunboat

Creating your first gunboat by Brsseb

Preparing for the lesson

Ok, the lessons is back and now its time to build a boat. Since boats are very easy to do (if you have done a car, you will notice boats are much less work), so for this lesson to contain anything usefull, I have decided to build a gunturret on the boat. Such gun setup is quite useful and is used on all addons that have some sort of fixed machinegun (helicopter gunships, fixed gun positions, etc). Here is what you need:

As always, I have supplied a standard 3d model fo you to download and use. If you have made your own boat model and want it into ofp, then use that one when following the tutorial. But in all screenshots and explanations I assume you are using my demo model.

Ok, lets move to next page and have a look at the tutorial model…(drumroll…)

The tutorial model

Hey, its not too shabby now is it? Ok, so its a pretty basic 3d model but as allways it does the job.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_b_1.jpg The model we will we working with in this tutorial. (note that since I use M113 gunner proxy, this wont show up in Bulldozer as in picture. Dont worry though, it works ingame)

First thing you must do is download the model.You can get the ZIP Brsseb_lesson5_start.rar from bottom of this page.

Put the “gunboat” folder with content in the bulldozer dir and open it in o2. As you can see I have made the basics for you: The model has basic textures, a driver, gunner and four cargo proxys. I also have made glass for the cockpit and the gun model is done with textured muzzleflash ready (note: read tutorial 3 if you have not been into gun making before).

pmc.editing.wiki_images_brsseb_brsseb_lesson5_b_2.jpg Basic Geometry LOD

As you can see, Geometry LOD is all done (because this was learned in lesson 1, remember?). For Fire Geometry, i just duplicated the content in Geometry just so that we have it. But this is not important for this lesson anyway. Also, Hitpoints is missing. We dont do that either, waste if time. For more info about fire geometry and hitpoint lod, see tutorial 4 (helicopter). All were explained there.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_b_4.jpg LandContact LOD

The landcontact lod speak for itself. Note that the wheight of the ship and the placement of the landcontact has much to say on how deep the ship will go in the water. Here I have come up with a good placement of the vertices that makes the boat lie nicely in the water.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_b_3.jpg Memory LOD content

Nothing revolutionary in Memory LOD either right now. Just the basic “zamerny” vertex (aiming point for enemy AI) and four vertices indicating get in/out positions for gunner, driver and the passengers. All learned in lesson 2.

So, lets get started, shall we? Move on!

The Gun LOD setup - "0.000" LOD

Lets do the hardest part first and get it over with: making the gun work properly. We need to some work in “0.00” lod and place out some vertices in Memory LOD. We want the gun to turn up, down and rotate to each side. Just like turrets do.

Go to “0.00” LOD and do this:

pmc.editing.wiki_images_brsseb_brsseb_lesson5_c_1.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_c_2.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_c_3.jpg

Ok, one more thing and we can move on to Memory LOD. As with all gun addons, ofp engine will like to know what the muzzleflash structure is so that it its displayed properly.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_c_4.jpg

When you have doublechecked that all the names are right (wrong named selections is a VERY common bug, thrust me!), then move on.

The Gun LOD setup - Memory LOD

Go to memory LOD and zoom in on the gun like before. If you have done lesson 3, you will already be familiar with this but there are some more selection names to learn. We must define the bullet path, define what is the up and down movement axis, and what is the left and right axis.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_1.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_2.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_3.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_4.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_5.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_6.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_7.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_d_8.jpg

Phew, lot of stupid selection names there. Tripplecheck them to make sure they are all right before moving on!

Adding details to ship

There are some small things left to do before we can say to have a nice little boat in our hands. Lets add some lights and other detail to make it look better:

pmc.editing.wiki_images_brsseb_brsseb_lesson5_e_1.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_e_5.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_e_2.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_e_3.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_e_4.jpg

Ok, nice. So now we have some lights for nighttime driving and a working radar. Not bad, eh? And so easy. Next we will check out the config, so brace yourself newbie. Remember you are much bigger than it and its more affraid of you than you are of it..no, thats snakes and stuff, configfiles are mean man-eating beasts..?!..(kremt), anyway…

The configfile from hell`s older brother

Ok, configfiles in these tutorials are just getting bigger and bigger. As always, I will just give you an overview of the content and there is nothing you must do other than to read and hopefully learn something. Dont complain, I dont teach C++ programming. So dont send me anymail with something like “what the f00k is a class?” in the topic.

Lets walk though the whole file together and Ill explain some stuff on the way. Watch and learn.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_f_1.jpg Part 1 of the config

So far only the usual stuff; some basic defines, the CfgPatches class (used to declare the addons we have made), and the CfgModel class where we lay out which subclasses our addon belong to. See that our addon is a “Ship” (class gunboat: Ship {}).

pmc.editing.wiki_images_brsseb_brsseb_lesson5_f_2.jpg Part 2 of the config

Here is the start of the gunboat class where we define all the stuff needed for our ship. The usual stuff are there: model, editor name, nr of passengers, does it have a gunner, etc. Some values are pretty strait forward and easy to see what they do. Note that we dont have a commander, so we say hasCommander=false and DriverIsCommander=true so that our driver is the ships boss. Also see that ofp deal with two sorts of ships, SmallShips and BigShips. Our ship is a big one, as you see at the top.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_f_3.jpg Part 3 of the config

Here is basically two things, one clas called TransportWeapons that contains all the weapons onboard the ship. This feature is v1.75+ only, and it enables the vehicle to start with weapons inside just like an ammo crate. The weapons and ammo onboard are defined in this class.

Then there is the class Reflector. It just controls settings about our frontlooking spotlight. Experiment with the settings and see what happens.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_f_4.jpg Part 4 of the config

Then the rest of the file. The 3 topmost attributes are boring, so we will consentrate on the TurretBase class. Basically it holds the settings for the turret. Here the selections are defined (osa hlavne, etc), the sound it makes when moving, and most important the values for min/maxElev, min/maxTurn. As you can see, with the current settings the gun can move 5 degrees down (minElev) and 60 degrees up (maxElev). So a total of 65 degrees of movement range up and down.

Same for the horizontal movement, it has -135 degrees from the left to +135 degrees on the right. So 135 in each direction and a total movement range of 270 degrees (3/4 of a full circle). Not hard if you didnt sleep in the math classes at school ;).

And thats the config, not that hard to understand now was it? Hope not. Well, lets do some final preperations and test the ship ingame!

Finishing the model

The model is almost done and ready to be compiled. But first, we need the view LODs for the driver, gunner and the passengers. To not waste much time, jsut select the “0.00” lod, rightclick the name and hit duplicate 3 times. Then change the 3 copies to “View Pilot”, “View Cargo” and “View Gunner”. If you have read lesson 4, you know that its good to delete some parts of the ship in those lods to save hardware power, but I wont do it on this simple model. See lesson 4 for more info about this.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_g_1.jpg Make sure you have the 3 View lods in order. Just copy “0.00” lod for all of them

Then its compiletime! So open Pbotool and compress the gunboat folder, putting the “gunboat.pbo” file under addons in ofp folder. The boat should now be found under West→Armored→My first gunboat.

pmc.editing.wiki_images_brsseb_brsseb_lesson5_g_2.jpg

pmc.editing.wiki_images_brsseb_brsseb_lesson5_g_3.jpg The final boat

Test the gun to make sure you have done it all right. You can dowload the final PBO Brsseb_lesson5_done.rar from below.

And that concludes the lesson. Hope you have learned something. Got many requests on how to do a turret and I hope this helps. Remember that this turret setup can be used on many vehicles (choppers, fixed gun positions on land etc). And please make some boats. Ofp got lots of tanks, weapons, vehicles, but we need some more boats!

Cheers!

Download OFP.Brsseb_Lesson/ Torrent Magnet from below:

magnet:?xt=urn:btih:40aac3407210ddb8ffcee06cdb009c0b099ccdce&xt=urn:btmh:122046986f756bcebf9744dc9f81bc3fc736a54e164113ec62e18c827a4a06271364&dn=OFP.Brsseb_Lesson&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a6969%2fannounce

Notes

This tutorial was written by Brsseb in ofp.gamepark.cz/_hosted/brsseb/, it was posted here with his permissions, thank you Brsseb!