Lesson 5: Creating your first gunboat

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 f*** is a class?" in the topic.

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


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 {}).


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.


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.


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!

Back__Home__Next