The year is 2142 and the dawn of a new ice age has thrown the world into a panic. The soil not covered by ice can only feed a fraction of the Earth's population. The maths is simple and brutal: some will live, most will die. In Battlefield 2142, players choose to fight for one of two military superpowers - the European Union or the newly formed Pan Asian Coalition - in an epic battle for survival.

Post tutorial Report RSS How to configure a weapon

How to change weapon reload, recoil and damage amounts.

Posted by on - Intermediate Server Side Coding

Basically, go to the objects folder ([where u installed to]/mods/bf2142 (make a copy of bf2142 folder at this point)/objects; go to the .zip folder weapon_server

Go to the gun you want to edit (armament is all of the explosive missiles(even the sticky nade launcher) edit these for missile changes; common is stuff i have not messed with and dont plan to in the near future; handheld is...all handheld weapons (go figure); and stationary is all stationary objects like turrets, shields, orb strike controllers etc...), and find the .tweak file (i used my modded PAC pistol for this)

Edit the .tweak with notepad and look for

rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.roundsPerMinute 600
ObjectTemplate.fire.addFireRate 2=auto
ObjectTemplate.fire.addFireRate 0=single
ObjectTemplate.fire.fireInCameraDof 1=yes
rem ---EndComp ---

For fire chars add another

ObjectTemplate.fire.addFireRate

For more fire modes (can only have three, the third is burst fire, adn its number is one)

rem ---BeginComp:DefaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.nrOfMags 4=four mags
ObjectTemplate.ammo.magSize 12=twelve round clip
ObjectTemplate.ammo.reloadTime 3.2=time takes (independent of animation)
ObjectTemplate.ammo.reloadWithoutPlayer 1=reload when empty, yes

For ammo chars

rem ---BeginComp:SoldierBasedRecoilComp ---
ObjectTemplate.createComponent SoldierBasedRecoilComp
ObjectTemplate.recoil.hasRecoilForce 1=% of how much recoil (1=100% 0=0% 0.5=50% etc...)
ObjectTemplate.recoil.goBackOnRecoil 0=bounce bacnk or no(like pac sniper)
ObjectTemplate.recoil.recoilForceUp CRD_UNIFORM/0.8/0.5/0=how much
ObjectTemplate.recoil.recoilForceLeftRight CRD_UNIFORM/-0.1/0.1/0=howmuch
ObjectTemplate.recoil.zoomModifier 0.5=how much when zoomed
rem ---EndComp ---

For recoil chars

rem ---BeginComp:SoldierDeviationComp ---
ObjectTemplate.createComponent SoldierDeviationComp
ObjectTemplate.deviation.setFireDev 1.5 0.15 0.2
ObjectTemplate.deviation.minDev 0.5
ObjectTemplate.deviation.setTurnDev 0 0 0 0
ObjectTemplate.deviation.setSpeedDev 0.45 0.1 0.1 0.15
ObjectTemplate.deviation.setMiscDev 4.5 4.5 0.15
ObjectTemplate.deviation.devModStand 1.4
ObjectTemplate.deviation.devModCrouch 1.2
ObjectTemplate.deviation.devModZoom 0.5

For accuracy, i never fully figured out how this worked

rem ---BeginComp:DefaultZoomComp ---
ObjectTemplate.createComponent DefaultZoomComp
ObjectTemplate.zoom.zoomDelay 0.1=time before full zoom
ObjectTemplate.zoom.addZoomFactor 0=base (unzoom, leave alone!)
ObjectTemplate.zoom.addZoomFactor 0.8=how much zoom (smaller=bigger)

For zoom amount

ObjectTemplate.projectileTemplate "as_handgun_Projectile"=what projectile to shoot

For what to shoot ^ that must go with this

rem -------------------------------------
ObjectTemplate.addTemplate "S_as_handgun_Projectile_Looping"=must match with ^
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/1/0/0=no clue
ObjectTemplate.material 38=no clue
ObjectTemplate.minDamage 10=guess
ObjectTemplate.damage 26=guess
ObjectTemplate.distToStartLoseDamage 12=how far before losing dam
ObjectTemplate.distToMinDamage 35=how far to max dam loss

Look for..never mind, everything past ^ is all sounds. be careful tho, i changed a smg to sound like a bogatyr shooting and i could hear it like it was next to me from one side to the other of the map.

Post comment Comments
Pakyuiq
Pakyuiq - - 2 comments

Thanks! Now i have a bazooka with 50 rounds lol

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: