Post tutorial 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 600 2=auto 0=single 1=yes
rem ---EndComp ---

For fire chars add another

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.


Thanks! Now i have a bazooka with 50 rounds lol

Reply Good karma Bad karma+2 votes
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.