So, you want to make a new, kickass weapon for TC:E, but you dont know how, well you are lucky, I had to teach myself, and you will learn from my mistakes.

Please pay attention to all that I put down, or you may miss an important step or tidbit. NOTE, THIS IS A LONG TUT, I ADVISE YOU TO COPY AND CREATE LOCAL TEXT FILE FOR REFERENCE

First, this is what you will need to create weapons in TC:E:A modeling program, and the skills to use it. (in this tut, I will refer to steps using 3ds Max and Gmax, ask kilroy for Milkshape 3D help.)A photo editor (for creating texture maps for your model)Notepad, or equivalent7-zip, or similar compress/decompression programs to pack/unpack .pk3 filesAnd sound editing software, such as Audacity, if you will make custom sounds

Now, before we begin, I will explain .gear, .weap, and .spec files.

.gear files can be found in the maps folder
.weap and .spec in the custom/default/weapons folder

.weap files describe to the engine things like what sounds to use, the weapon itself, what models to use, and the like. here is an example of the ak47.weap file:

//readySound "" //firingSound "" // no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing //overheatSound "" reloadSound "sound/weapons/ak47/ak47reload.wav" reloadFastSound "sound/weapons/luger/luger_reload_fast.wav" // some weapons have fast reloads due to the skill system //spinupSound "" // sound started when fire button goes down, and stepped on when the first fire event happens //spindownSound "" // sound called if the above is running but player doesn't follow through and fire switchSound "sound/weapons/misc/silence_off.wav" // allow overriding of weaponswitch sound

As you can see, it is a lot of things to comprehend, so I will explain most of what you need to know.

weaponConfig <tells engine what animation config file to use for this weapon>flashsound <tells what sound to use when firing>flashechosound <tells what faraway sound to use>reloadsound <what reload sound to use>gunViewOffset gunViewAimOffset <these three are the 3d coordinate plane values for the hud weapon placement> <viewaim is for aimed sights, view is for non-aimed>gunViewAnglesdeployMenuShortName <the short and dirty name of your gun>deployMenuDescription <the menu description of your gun, should be short, and contain caliber>deployMenuType <is it a pistol, submachine gun, sniper rifle, palsma cannon, etc?? can be whatever you want>firstperson{model <this is the hand view model and animation your weapon will use>

Now the next part will need a little more in depth description than the rest, and this is important, so pay attention, from Weaponlink on down, you will see some tag names and models

tag_main has to do with mostly the "bulk" of the rifle, such as scopes, receivers, suppressors, basicaly everything except slides and mags. tag_clip has to do with your weapon's mag modeltag_slide has to do with your weapons slide, or "charging handle"

thirdPerson{model <your thirdperson weapon model, should be smaller, and contain all objects>

more on how to use .weap files towards the end of the tut.

now on to .spec filesSpec files basically fill out more information, such as caliber, fire modes, and scope distance, and weither it is suppressed or not.Here is the AK47.spec file

It is actually pretty self explanitory, just set values to one or zero, just like binary, yes or no.

This one is also required to make a custom weapons

Now on to .gear files

this on I will go over a little less, since one example is good enough
when you open it up, you will see a long list of weapons and some variables, and I will explain them, but if you look at the .gear files, you will notice the name, default_gt#.gear, and obj_mapname_gt#.gear the mapname ones are for specific maps, but to simplify things, the default work as well. remember to have 3 in each custom pak file gt2,gt5,gt7.

Here is the ak47 example from the default.gear file

gm_weapon
{
weaponID "TH4" <slot id, there are 27, 1-20, then knives and the like>
weaponFile "ak47" <name of your weap and spec files>
team "terrorists" <which team gets this weapon, specops, terrorists, or both>
slot "primary" <weapon slot, primary, ie rifle, secondary, ie pistol>
requiredSkill 1 0 0 <required AA to be able to get this weapon, 100 is 1, for assualt, 010 is 1 for recon, 001, is 1 for sniper, and so on, usually 1-3>
startClips 3 <number of mags your weapon starts with, keep around 3>
equivalentWeaponID "TH2" <what weapon this one balances out, ie in this case the specops m16>
}

Now that you know your .gear files, you can use your weapon in TC:E.

Now lets go over the process to actually set up your model to use in TC:E.

First, lets look at your nice model, it has a seperate, mag, slide and suppressor, and has an amazing skin-lets say it is and ak47, just for kicks
First thing, look over the default hand view animations in game, and choose the best one for your gun, in this case, the ak47_view
Then, find the ak47.weap and .spec files in the uncompressed pak2.pk3 file, rename them to yourgun.weap and .spec (or whatever, such as your weapon is)
Create a new folder on your desktop (for ease of finding), and name it new_ak or whatever you want, then in that folder create folders named models, custom, maps, scripts (for .shader files, but you will have to look at the quake 3 shader tut to learn about them, even I dont know too much about them, sorry...)
In your models folder create a folder called weapons2, and in that folder create a folder called whatever your weapon is called, this is the folder you will export all your models to, and where your texture and .skin files for your weapon will be located.

In the custom folder, create a folder called default, and in that one create one named weapons, in this folder you will throw your new weap and spec files in.
And in the maps folder, you will put your .gear files.

Alright, lets get to the models themselves,
Now, to get the best results, import the weapon that uses the same view animation as yours, and line up the grips and triggers, then delete the imported model, but save the tags tag_flash and tag_brass, they are important.

do this for your mag, supressor, and slide, then have all of the objects in one model, import the weapon that corresponds, and scale it down to fit.

Now, make sure that you have put all of your textures for your gun in its file in the model/weapons2 folder, then make sure that you apply them to your model, then export the following:

yourgun_view_main (this is the main weapon, firstperson view, mostly receiver, sights, suppressor if you want, (can be seperate file) but NO clip or slide!!) DONT FORGET TAGS!!
yourgun_view_slide (this is the slide model for your gun)
yourgun_view_clip (this is the mag for your weapon)
yourgun (this is the thirdperson view, scaled down, has all objects, ie, slide, mag etc.)

export them as .md3 models, in your models/weapons2/yourgun/ folder

now that you have your models done, lets edit the .weap/spec and .gear files so you can use your weapon.

weap first:

lets say your model is really close to the ak, lets say a galil, so copy the ak spec and weapon files and rename them to yourgun.spec/.weap
open the weap, and change the following

the menu names of your weapon
the models, under the specific tag place and part # (note you can make more parts that use the same tags if you need to)
also you may need to change the flash, sounds, and view angles to fit your weapon, depending on level of customization.

Once you have that filled out, move on to the .spec file
change the caliber if needed
add scope zoom and recticle type if nessessary.
add auto, pump, semi, burst firemodes to fit your weapon.
also remember to change the weapclass to fit your gun.

now do the .gear files, change the name to the name of your weapon's .weap and .spec files, also change AA levels as needed, where the weapon yours replaces) ie, galil replacing ak47

Now that you have all of that done, you can compress your custom pak file (remember to compress the folders INSIDE of the folder on your desktop, ie, models, custom,maps, NOT the file they are in!!)

name it zz_yourgun.pk3, and throw it in your tcetest folder, start tce, press the "~" key in the start menu, type in \sv_pure 0, then \devmap obj_mapname, then once you have spawned, press "~" again, and type in \timelimit 99999999, \give all, and then you will have all the weapons, and until you exit the map to look at your model, also type in cg_thirdperson 1 to check thirdperson view.

That's all there is to it, and if you have any questions, ask, but search first.

~Rang3r1~

Last edited by Rang3r1_v2 on Mon Nov 09, 2009 10:13 pm, edited 1 time in total.