====== OFP Brsseb 3D Modeling Tutorial ====== [[https://www.pmctactical.org/forum/viewforum.php?f=43|OFP Forum]], [[:ofp|OFP Home]], [[ofp:file_formats|OFP File Formats]], [[ofp:tools|OFP Tools]], [[ofp:missions|OFP Missions]], [[ofp:modeling|OFP 3D Modeling]], [[ofp:terrain|OFP Terrain]] **Operation Flashpoint (OFP)** aka ArmA: Cold War Assault (CWA) ====== 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: * OFP (daahhh), O2 and Bulldozer * Basic understanding of the O2 interface * Having fully understud stuff from lesson1 (like creating LODs, selections etc) * Note that it says "lesson", not tutorial. That means that the info in this lesson assume that you have learned some stuff from the other lessons. You must have done at least 3-4 of the previous lessons to get something out of this. * NOTE: if you have done the gun LOD setup from lesson 3, this tutorial will be alot easier! * PBOTool and TexView or similar program 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. {{ https://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). {{ https://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. {{ https://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. {{ https://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: * In left view, zoom in so that you see the whole gun in picture, like this: {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_c_1.jpg }} * Press F2, and select all of the structures like in picture. make sure to select this right. Name this selection "OtocHlaven" ("Turn-barrel" directly translated). This is the part that will move up and down. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_c_2.jpg }} * Next, for the left and right moving part, select these structures and name them "OtocVez" {{ https://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. * Select the muzzleflash structure (both vertical and horizontal plane and the front flash). Name this selection "Zasleh". {{ https://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. * Zoom in like this to have a clear picture. Do this in the other views since we will need all four view to position the vertices right. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_1.jpg }} * Using the picture below, place a single vertex and name it "gunnerview". I wont go in detail about this one, but its used to tune how gunner looks in 1st person. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_2.jpg }} * As with all gun addons, we need to define the gun barrel so that the bullets come out properly. Insert two vertices (make sure they are strait) and name them the labels on the picture: {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_3.jpg }} * New we need to define where the gun shoots out the empty cartridges. Its defined in similar manner to the gun barrel, just with different seleciton names. Use topview and sideview to make the two vertices. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_4.jpg }} * Then its the axis for the up and down movement. Its just two vertices placed in the spot where we want the gun to turn around. See the picture for details. Make and select the two vertices and call them called "osa hlavne". {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_5.jpg }} * Then for the axis for the left and right movement. In left view place two vertices right on top of each other (place on and drag-copy one down with y-axis locked to get them properly aligned). Name them "osa veze". {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_6.jpg }} * Now for some reselecting. Select both usti/konec hlavne, both nabojnice-vertices, and the gunnerview vertex. Name all 5 vertices "OtocHlaven". {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_d_7.jpg }} * Now, select the same again, but this time also take the two "osa hlavne" vertices with you. Name all 7 vertrices for "OtocVez", like in picture. {{ https://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: * Go to memory lod, zoom in on the mast and add three vertices on it like in picture below. The one at the top is the white light strobe ("bily pozicni blik") and the other two are the red and green ones ("cerveny pozicni" and "zeleny pozicni"). {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_e_1.jpg }} * Also, for these lamps to work, we must also have a normal spotlight on the ship. No problem, since a forward pointing spotlight lighting up the deck and gunnerview is always handy for nightmissions. So we just add two vertrices in memory lod, in side view as in picture and name them. Then we have a nice little lamp to turn on and off at night. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_e_5.jpg }} * Just as we can define where the bullet can come out on guns, we can define where the exhaust will come out on vehicles. Place two vertices and name them like on picture: {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_e_2.jpg }} * It would also be nice to have your radar working. To do that we need to make an axis in Memory lod for the spinning radar structure and name it "osa radaru". {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_e_3.jpg }} * Ofp engine also needs to know which structure to spin around the axis, so go to "0.00" lod and select the radar block. Name it "radar". {{ https://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. {{ https://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 {}). {{ https://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. {{ https://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. {{ https://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. {{ https://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. {{ https://pmc.editing.wiki/images/Brsseb/Brsseb_lesson5_g_2.jpg }} {{ https://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 [[http://ofp.gamepark.cz/_hosted/brsseb/|ofp.gamepark.cz/_hosted/brsseb/]], it was posted here with his permissions, thank you Brsseb!