How to Clone a Weapon

Cloning A Weapon (and Modding It A Little)

By kay

This tutorial will show you how to clone a weapon in BF2. The example will be the "chpis\_qsz92", the Chinese standard Sidearm.

Step #1 - getting the necessary files:

Open "/mods/bf2/objects\_server.zip", look for the weapon you want to mod in "/weapons/handheld/" and copy the folder called "chpis\_qsz92" to your working directory.

Step #2 - cleaing up the workspace:

Remove the subdirectories called "ai"﻿, "Animations" and "meshes" as well as the files called "AnimationSystem1p.inc", "AnimationSystem3p.inc" and "Weapon.desc".

Step #3 - naming the weapon:

Rename the files "chpis\_qsz92.con" and "chpis\_qsz92.tweak" to something else, since I'm building a flaregun, I called them "deecyne\_flaregun.com" and "deecyne\_flaregun.tweak".

Step #4 - naming the weapon cont'd:

Go up a directory and change the name of the directory (which is: "chpis\_qsz92") to the name of your ".con" and ".tweak" files, then change back into the directory and make the files \*writeable\*.

Step #5 - changing the weapon's templates:

Now open up the "deecyne\_flaregun.con" file in a text editor and change this:

ObjectTemplate.create GenericFireArm chpis\_qsz92

to

ObjectTemplate.create GenericFireArm deecyne\_flaregun

and

include chpis\_qsz92.tweak

to

include deecyne\_flaregun.tweak

now, remove the following line:

GeometryTemplate.create BundledMesh chpis\_qsz92

Step #6 - saving your changes:

Save the file and close it. Then open "deecyne\_flaregun.tweak".

Step #7 - tweaking your weapon:

The changes you will have to make to the "deecyne\_flaregun.tweak" depend on the things you want to accomplish. I'm trying to make a flaregun, so my changes would be:

ObjectTemplate.ammo.nrOfMags 8

ObjectTemplate.ammo.magSize 15

to

ObjectTemplate.ammo.nrOfMags 2

ObjectTemplate.ammo.magSize 45

as well as:

ObjectTemplate.itemIndex 2

to

ObjectTemplate.itemIndex 1

Since I'm not using a knife, I'm utilizing the empty slot for the flaregun, you might need to adjust the \*itemIndex\* to your needs.

These are just a few settings, you might need / want to change a lot more, maybe the damage or deviation, killmessage - it's all in there and waiting to be modded.

Step #8 - changing the projectile:

Since this is a flaregun, we'll have to adjust the projectile that gets fired by the weapon:

ObjectTemplate.projectileTemplate chpis\_qsz92\_Projectile

becomes:

ObjectTemplate.projectileTemplate deecyne\_flaregun\_Projectile

and

ObjectTemplate.create GenericProjectile chpis\_qsz92\_Projectile

becomes:

ObjectTemplate.create GenericProjectile deecyne\_flaregun\_Projectile

Step #9 - adjusting the damage:

It's a flaregun and, while these weapons are able to inflict damage in real-life, this version won't be able to:

ObjectTemplate.minDamage 8

ObjectTemplate.damage 20

gets changed to:

ObjectTemplate.minDamage 0

ObjectTemplate.damage 0

Step #10 - changing the sound settings:

Next step is to change the sound file template name to the one we use for the weapon, the easiest thing to do is to use the "search & replace" function of your text editor and replace:

S\_chpis\_qsz92\_

with

S\_deecyne\_flaregun\_

Don't forget to save the file in the meantime!

Note on Steps #11 - #13:

You only need to follow the next few steps if you want your weapon to have a different projectile. If you just wanted to clone a weapon, you're done now and should move to step #14.

Step #11 - modding the projectile (appearance):

This section isn't yet done. Currently, the following is planned:

\* discuss how to change the projectile's appearance

Step #12 - modding the projectile (speed):

\* discuss how to change the projectile's speed

Step #13 - modding the projectile (timetolive):

\* discuss how to change the projectile's timetolive

Step #14:

Finally, save all the open files, close them, then put them into "/mods/yourmod/objects\_server.zip/Weapons/handhelds".

Attach your new weapon to a kit (make sure to use the right name) and fire up the game to see how the weapon works for you.

final words and modded files:

A huge "thank you" goes out to Harry from #bfeditor on irc://irc.gamesurge.net/ who helped me with just about everything.