SkullTerror Posted May 2, 2011 Report Share Posted May 2, 2011 (edited) Hello everyone, since I have no computer to work on my mod, i though i'd post a small tutorial concerning some of the basic stuff in the .tweak files of the bf2 guns, this tutorial is meant for people who don't know what a certain code/line means: Well let's get started: Name of the gun: ObjectTemplate.activeSafe GenericFireArm - This line means the name of the gun files, if this name is different than the gun folder, things get messy... This concers crosshairs and other hitmarkers: ObjectTemplate.weaponHud.guiIndex - This is the GuiIndex, this is what you see when you fire your gun from the hip, 0 is nothing, no crosshair, no hitmarker, 52 is the default crosshair. ObjectTemplate.weaponHud.altGuiIndex - This is meant for zooming in, 53 is the default M4 red dot. Fire Type: ObjectTemplate.fire.addFireRate - The type of fire, 0 is semi-automatic, 1 is 3-round burst, and 2 is full-auto, 3 is crash!! Zoom: ObjectTemplate.zoom.zoomDelay - The time it takes until you can fire after you clicked the zoom button, please note, changing this to like 0.2 doesn't have any effect on the length of the zoom in, that lies in the animationsystem.inc! ObjectTemplate.zoom.addZoomFactor 0 ObjectTemplate.zoom.addZoomFactor 0.8 - This specifies how much the screen zoomes in, 2nd line should be there, removing this line removes your ability to ADS. AI ObjectTemplate.aiTemplate - Specifies which weapon.ai the gun uses. Gun kit codes: ObjectTemplate.itemIndex 3 - Specifies where the gun is placed in the kit, default Itemindex for usrif_m4 or rurif_ak47 is 3, uspis_92fs is 2, knife is 1, etc. ObjectTemplate.delayToUse - Specifies the amount of TIME it takes until you can use the gun after you deployed it. Projectile codes: ObjectTemplate.tracerTemplate p_tracer_r - the type of tracer the gun uses. ObjectTemplate.tracerInterval - If this is set to like 2, the gun fires every 2 shots, and so on. ObjectTemplate.minDamage - The minimum amount of damage a gun can make ObjectTemplate.damage - the maximum amount of damage a gun can make ObjectTemplate.damageMandownSoldiers - Specifies if a dead body can be shot or not, 0 is no, 1 is yes that's it Edited May 2, 2011 by SkullTerror Quote Link to comment Share on other sites More sharing options...
Ron230 Posted May 2, 2011 Report Share Posted May 2, 2011 (edited) .....(ms: removed useless full quotation of the first post).... How can i code 3D ironsights? Edited May 6, 2011 by mschoeldgen[Xww2] see above Quote Link to comment Share on other sites More sharing options...
Outlawz Posted May 2, 2011 Report Share Posted May 2, 2011 Can you add more on projectiles and tracers? Can/how they be changed, where to export/find them...? How can i code 3D ironsights? You can't, you need to change the animation and the weapon model. Technically all sights in BF2 are 3D, but the rear part is HUD texture while the front is an enlarged 3D model of the weapon's sight. Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted May 6, 2011 Report Share Posted May 6, 2011 How can i code 3D ironsights? Those are modelled and not coded. Your weapon model should have the ironsight in its geom0 (1P view) Quote Link to comment Share on other sites More sharing options...
Lauryxy Posted May 29, 2011 Report Share Posted May 29, 2011 Nice, but think you were missing a few useful codes: ObjectTemplate.fire.batchSize sets the amount of projectiles fired with one shot. Always used in shotguns. Also needs this in the SoldierDeviationComp: ObjectTemplate.deviation.subProjectileDev so that the projectiles in one batch wouldn't go to the exact same place. ObjectTemplate.fire.burstSize sets the amount of projectiles fired with one burst. ObjectTemplate.zoom.mouseSpeedMod 0.8 changes the mouse sensitivity when a weapon is zoomed. ObjectTemplate.ammo.nrOfMags sets the amount of mags the weapon has. ObjectTemplate.ammo.magSize sets the amount of shots in one mag. ObjectTemplate.ammo.reloadTime sets the amount of time the weapon reloads. Doesn't make the animation faster. ObjectTemplate.heatAddWhenFire sets how fast the weapon gains the heat when it's firing. ObjectTemplate.coolDownPerSec sets how fast the weapon cools down when it's not firing. ObjectTemplate.overheatPenalty Sets the amount of time you can't fire a weapon if it has overheated. ObjectTemplate.distToStartLoseDamage sets the distance after which the projectile starts losing its damage. ObjectTemplate.distToMinDamage sets the distance the projectile has to travel to reach minimum damage(ObjectTemplate.minDamage). Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted May 29, 2011 Report Share Posted May 29, 2011 Note that tons of commands are explained in the BF2 Editor help in /bf2editor/help/commanddescriptions.xls This is an excel spreadsheet - convert it to your favourite format if desired.In the same folder you'll find ObjectEditor_Help.xls with useful comments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.