Hello Marty, you must make sure to copy your PR mod folder so tat you can still play online in one build and then modify your other one for offline use.
First off, kit modification. go into program files/EA Games/battlefield 2/mods/PR/objects
You will see a load of .zip files, for now you need to open the kits_server.zip
after clicking the kits folder inside of that you will see all of the factions that are currently in Project Reality. For the purposes of this tutorial we are going to modify the Chinese sniper class.
In the ch folder you will see a lot of .con files. These are config files and you can open them in notepad. Find ch_sniper_sp.con and open it.
You will see this:
Code: Select all
ObjectTemplate.create Kit ch_sniper_sp
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.setNetworkableInfo KitInfo
ObjectTemplate.kitType Sniper
ObjectTemplate.aiTemplate Sniper
ObjectTemplate.geometry ch_sniper_kits
ObjectTemplate.geometry.kit 0
ObjectTemplate.geometry.dropGeom 16
ObjectTemplate.sethasCollisionPhysics 1
ObjectTemplate.setCollisionMesh kitcol
ObjectTemplate.cullRadiusScale 100000
ObjectTemplate.timeToLiveAfterDeath 300
rem -------------------------------------
ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate chpis_qsz92
ObjectTemplate.addTemplate RUSNI_SV98
ObjectTemplate.addTemplate tripflare
ObjectTemplate.addTemplate radio
ObjectTemplate.addTemplate hgr_smoke_signalorange
ObjectTemplate.addTemplate SIMRAD
ObjectTemplate.addTemplate medikit_dressing_ch_sp
rem -------------------------------------
ObjectTemplate.createComponent AbilityHud
ObjectTemplate.abilityHud.ammoSound S_Resupply
ObjectTemplate.abilityHud.healingSound S_Heal
ObjectTemplate.abilityHud.repairingSound S_Repair
ObjectTemplate.createComponent VehicleHud
ObjectTemplate.vehicleHud.hudName "HUD_TEXT_MENU_SPAWN_KIT_SNIPER_CH"
ObjectTemplate.vehicleHud.miniMapIcon "Ingame\Kits\Icons\kit_Sniper_outline.tga"
ObjectTemplate.vehicleHud.vehicleIcon "Ingame\Kits\Icons\kit_Sniper.tga"
ObjectTemplate.vehicleHud.spottedIcon "Ingame\GeneralIcons\empty.tga"
ObjectTemplate.vehicleHud.pantingSound S_SprintBreath
ObjectTemplate.vehicleHud.injurySound S_Injury
ObjectTemplate.vehicleHud.vehicleType 7
In the first paragraph you have a set of instructions for your computer. Here it says what the AI should follow if it has this kit, what geometry the kit uses and how long the kit should stay on the ground after it's user dies.
The second paragraph is what we need for this though. Here you can see what the kit has been issued by the devs. Changing this is very easy, but one wrong move and you'll crash PR when you load a map.
In order to make sure you get it right you need to open the weapons folder. Open another window and go to program files/EA Games/battlefield 2/mods/PR/objects and then go into weapons_server.zip
By now you might have noticed that we're only going into the server.zip folders. In case you're wondering the client.zip folders have the more physical side of the mod, with geometries and textures.
Once you're in weapons_server.zip go into weapons/handheld. Here you will see every handheld weapon in PR. For the purposes of this tutorial we are going to change the chinese sidearm to the heckler und koch machinepistole 5, or MP5 for short.
Find the usrif_mp5_a3 folder and have a look inside. You will see two animations files, an animation folder and a .tweak file. The .tweak file is similar to the .con file in that it contains information about the weapon.
First off we need to see if the weapon can be used as a sidearm. Open the .tweak file in notepad, you'll see this:
Code: Select all
rem *** Generated with Bf2Editor.exe [created: 2005/3/24 14:57]
GeometryTemplate.setMaterialReflectionScale 0 0 0 0.4
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe GenericFireArm usrif_mp5_a3
ObjectTemplate.creator MBA-1:mba
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.cullRadiusScale 10
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\USRIF_MP5_A3.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\USRIF_MP5_A3.tga
ObjectTemplate.weaponHud.hudName "killed"
ObjectTemplate.weaponHud.guiIndex 9
ObjectTemplate.weaponHud.altGuiIndex 52
ObjectTemplate.weaponHud.deviationFactor 1
ObjectTemplate.weaponHud.disableOnSprint 1
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.roundsPerMinute 900
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.addFireRate 2
ObjectTemplate.fire.fireInCameraDof 1
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 6
ObjectTemplate.ammo.magSize 30
ObjectTemplate.ammo.reloadTime 7.1
ObjectTemplate.ammo.reloadWithoutPlayer 0
rem ---EndComp ---
rem ---BeginComp:SoldierBasedRecoilComp ---
rem 9mm Low Recoil SMG
ObjectTemplate.createComponent SoldierBasedRecoilComp
ObjectTemplate.recoil.hasRecoilForce 1
ObjectTemplate.recoil.recoilForceUp CRD_UNIFORM/1.4/1.4/0
ObjectTemplate.recoil.recoilForceLeftRight CRD_UNIFORM/-1/1/1
ObjectTemplate.recoil.zoomModifier 1
ObjectTemplate.recoil.goBackOnRecoil 1
rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp ---
rem Short Barrel 9mm Iron Sight Sub Standard SMG
ObjectTemplate.createComponent SoldierDeviationComp
ObjectTemplate.deviation.minDev .25
ObjectTemplate.deviation.setFireDev .7 .7 .012
ObjectTemplate.deviation.setTurnDev 1 .15 .15 .1
ObjectTemplate.deviation.setSpeedDev 1 .007 .007 .008
ObjectTemplate.deviation.setMiscDev 20 20 .15
ObjectTemplate.deviation.devModStand 2.2
ObjectTemplate.deviation.devModCrouch 2
ObjectTemplate.deviation.devModLie 2
ObjectTemplate.deviation.devModZoom .4
rem ---EndComp ---
rem ---BeginComp :D efaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
ObjectTemplate.animation.useShiftAnimation 1
ObjectTemplate.animation.shiftDelay .05
rem ---EndComp ---
rem ---BeginComp :D efaultZoomComp ---
ObjectTemplate.createComponent DefaultZoomComp
ObjectTemplate.zoom.zoomDelay 0.4
ObjectTemplate.zoom.zoomLod 0
ObjectTemplate.zoom.addZoomFactor 0
ObjectTemplate.zoom.addZoomFactor 1.099
rem ---EndComp ---
ObjectTemplate.geometry usrif_mp5_a3
ObjectTemplate.setCollisionMesh usrif_mp5_a3
ObjectTemplate.mapMaterial 0 Collision_Material 68
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.aiTemplate smg_ai
rem -------------------------------------
ObjectTemplate.addTemplate S_usrif_mp5_a3_Fire1P
ObjectTemplate.addTemplate S_usrif_mp5_a3_Fire1P_Outdoor
ObjectTemplate.addTemplate S_usrif_mp5_a3_Fire3P
ObjectTemplate.setPosition 0/0.01659/0.38928
ObjectTemplate.addTemplate S_usrif_mp5_a3_BoltClick
ObjectTemplate.addTemplate S_usrif_mp5_a3_TriggerClick
ObjectTemplate.addTemplate S_usrif_mp5_a3_SwitchFireRate
ObjectTemplate.addTemplate S_usrif_mp5_a3_Reload1P
ObjectTemplate.addTemplate S_usrif_mp5_a3_Reload3P
ObjectTemplate.setPosition 0/-0.03473/0.05681
ObjectTemplate.addTemplate S_usrif_mp5_a3_Deploy1P
ObjectTemplate.addTemplate S_usrif_mp5_a3_Deploy3P
ObjectTemplate.addTemplate S_usrif_mp5_a3_Zoom
ObjectTemplate.addTemplate e_muzz_m4
ObjectTemplate.setPosition 0/0.01659/0.28928
ObjectTemplate.addTemplate e_shellejection_9mm
ObjectTemplate.setPosition 0/0.03982/0.04204
rem -------------------------------------
ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/USRIF_MP5_A3/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/USRIF_MP5_A3/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate 900
ObjectTemplate.keepProjectiles 5
ObjectTemplate.velocity 400
ObjectTemplate.itemIndex 3
ObjectTemplate.delayToUse 2.45
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Fire1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_fire_1p.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.pitchEnvelope 0/1/0.9/1.1/1/1/0/0.98/1.04/
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Fire3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_fire_3p.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.95
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.pitchEnvelope 0/1/0.9/1.1/1/1/0/0.97/1.035/
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.position 0/0.01659/0.38928
ObjectTemplate.minDistance 3
ObjectTemplate.halfVolumeDistance 10
objectTemplate.soundradius 1.5
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_BoltClick
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/uspis_92fs/sounds/mono/bolt_click.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.69
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 0.5
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_TriggerClick
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/uspis_92fs/sounds/mono/trigger_click.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_SwitchFireRate
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/chrif_type95/sounds/type95_firerate.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 0.3
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Reload1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_reload2_1p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.49
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Reload3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_reload2_1p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.49
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.position 0/-0.03473/0.05681
ObjectTemplate.minDistance 2
ObjectTemplate.halfVolumeDistance 4
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Deploy1P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_deploy_1p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.36
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Deploy3P
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_mp5_a3/sounds/mp5_deploy_3p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 0.5
ObjectTemplate.halfVolumeDistance 1
ObjectTemplate.activeSafe Sound S_usrif_mp5_a3_Zoom
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.soundFilename "objects/weapons/handheld/rurif_bizon/sounds/zoom_generic.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
You can see here that a lot goes into making a weapon for PR, but we only need to check a small bit of it. In PR sidearms are in weapon slot number 2, and we need to check that the MP5 fills that slot.
Find the line named ObjectTemplate.itemIndex, and have a look at the number next to it.
Here we have our first problem, so instead of confusing you with the solution we're going to change something else. You saw on that line that the number is 3, not 2. If we were to simply change that it would cause many problems with conflicts in other kits, which can be a very big hassle.
So instead we are going to change the rifle the sniper uses to the MP5. To do this simply change the ch_snip_sp.con file.
Find ObjectTemplate.addTemplate RUSNI_SV98 in the second paragraph and change it to ObjectTemplate.addTemplate+your weapon .tweak name, which in this case is the usrif_mp5_a3.tweak file.
The finished product should look like this:
Code: Select all
ObjectTemplate.addTemplate usrif_mp5_a3
Save this back into that .zip file and there you go, job done. Open your PRSP, reequest the chinese sniper and have fun with your MP5
I hope you understand all of this but if not then please feel free to ask any questions you have here.