Lesson 3: Creating your first Weapon

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.


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.

Back__Home__Next