adding grapplinghook to sniper kit - SP only

Suggestions and feedback pertaining to Project Reality Single Player.
Post Reply
HalCerro
Posts: 5
Joined: 2015-01-04 12:09

adding grapplinghook to sniper kit - SP only

Post by HalCerro »

Hello,

As I can only play PR in local coop mode I find myself needing to tweak it to my preferences, sort of...
What I need is a way to add the grapplinghook to a sniper kit.
Should be possible, the only question is what file/files do I have to edit?

Thank you in advance!
Just can't help but love PR now that it's standalone! Good work you guys! :thumbsup:
M42 Zwilling
Retired PR Developer
Posts: 613
Joined: 2012-06-10 11:27

Re: adding grapplinghook to sniper kit - SP only

Post by M42 Zwilling »

Find your PR install, go to mods/pr/content/objects_common_server.zip/kits/[desired faction name]/[name]_sniper_sp.con, and add this line where you see the rest of the items addTemplated:

Code: Select all

ObjectTemplate.addTemplate nsrif_grapplinghook
The order doesn't matter really. :) So you might end up with something like this in that section:

Code: Select all

rem -------------------------------------
ObjectTemplate.addTemplate kni_kabar
ObjectTemplate.addTemplate USPIS_92FS
ObjectTemplate.addTemplate ussni_m40a3
ObjectTemplate.addTemplate tripflare
ObjectTemplate.addTemplate hgr_smoke_signalpurple
ObjectTemplate.addTemplate nsrif_grapplinghook
ObjectTemplate.addTemplate binocular
ObjectTemplate.addTemplate medikit_dressing
rem -------------------------------------
Image


"How many posts have there been about how much better PR was back in 0.X? The fact is that if we played the older versions we would start to remember the shortcomings, but we tend to hold onto the good memories tighter than the bad ones." - Murphy
qs-racer
Posts: 335
Joined: 2010-02-07 10:25

Re: adding grapplinghook to sniper kit - SP only

Post by qs-racer »

I bump the thread to ask how too choose the number of field dressing. For example if here we want the sniper have 5 field dressing ?
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: adding grapplinghook to sniper kit - SP only

Post by Mineral »

medikit_dressing as you can see in zwillings post is the 'weapon' name of the field dressings in slot 9. You need to find a folder of the same name in the content/objects_weapons_server.zip/handheld/. In there you find already 2 other variants you can use called medikit_dressing_3 and medikit_dressing_6. Opening those same named .tweak files with a text editor would show you the difference between the 3 variants being in the line(nr 34) 'ObjectTemplate.ammo.nrOfMags X' which defines the amount of field dressings.

So pick one of the 3 variants or edit the one of your choosing in that line. Then use that variant in your kit file as zwilling shows.
Image
HalCerro
Posts: 5
Joined: 2015-01-04 12:09

Re: adding grapplinghook to sniper kit - SP only

Post by HalCerro »

Thanks Mineral. Will do that! :)
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: adding grapplinghook to sniper kit - SP only

Post by Fastjack »

Be carefull,

make your sniper kit as pickup kit.
I don't know if you want to select the sniper kit in the menue selection screen, if yes bots spawn also with this kit and bots dont like field dressing on itemindex 9.
HalCerro
Posts: 5
Joined: 2015-01-04 12:09

Re: adding grapplinghook to sniper kit - SP only

Post by HalCerro »

Thank you Fastjack, I appreciate your help and if you can tell me how to do that, that would be great!

I have more problems with bots sniping ME from the far side of the map with a pistol than I have with them being "mad" at me for "fouling" up their kits.
Besides, I've only added the grapplinghook to the 2 US sniperkits anyway.
(Btw, it works pretty nicely actually, thanks again Mineral! :D )
BlackGus
Posts: 152
Joined: 2012-05-19 20:59

Re: adding grapplinghook to sniper kit - SP only

Post by BlackGus »

Its posible replace M9 by M4 eotech? (Sniper kit) like this:

ObjectTemplate.addTemplate kni_knife
ObjectTemplate.addTemplate usrif_m4eotech
ObjectTemplate.addTemplate ussni_m24
ObjectTemplate.addTemplate tripflare
ObjectTemplate.addTemplate hgr_smoke_signalpurple
ObjectTemplate.addTemplate binocular
ObjectTemplate.addTemplate medikit_dressing

CTD at 15% :(
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Post by Mineral »

No. Kit item index. Every weapon is assigned an index in its tweak. So it can only go into a specific slot.
Image
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: adding grapplinghook to sniper kit - SP only

Post by Fastjack »

You can add the M4eotech only, if you have M4eotech on a different itemindex. Make a clone from the M4 with another itemindex.

Tweakfile : usrif_m4eotech_idx2

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2005/2/14 17:21]
GeometryTemplate.setSubGeometryLodDistance 1 0 14
GeometryTemplate.setSubGeometryLodDistance 1 1 20
GeometryTemplate.setMaterialReflectionScale 0 0 0 0.35
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 8
ObjectTemplate.activeSafe GenericFireArm usrif_m4eotech_idx2
ObjectTemplate.creator DSU-1 :d su
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.cullRadiusScale 10
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\usrif_m4eotech.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\usrif_m4eotech.tga
ObjectTemplate.weaponHud.hudName "killed"
ObjectTemplate.weaponHud.guiIndex 210
ObjectTemplate.weaponHud.altGuiIndex 3620
ObjectTemplate.weaponHud.deviationFactor 1
ObjectTemplate.weaponHud.disableOnSprint 0
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.roundsPerMinute 900
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.addFireRate 1
ObjectTemplate.fire.fireInCameraDof 1
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 9
ObjectTemplate.ammo.magSize 30
ObjectTemplate.ammo.reloadTime 6.25
ObjectTemplate.ammo.reloadWithoutPlayer 0
rem ---EndComp ---
rem ---BeginComp:SoldierBasedRecoilComp ---
include ../../common/recoil.con "assaultrifle" "us" "m4" "ironsight"
rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp ---
include ../../common/deviation.con "assaultrifle" "carbine"
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_m4eotech
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.aiTemplate ar_aimpoint_ai
rem -------------------------------------
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Fire1P
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Fire1P_Outdoor
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Fire3P
ObjectTemplate.setPosition 0.005/0.032/0.483
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_BoltClick
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_TriggerClick
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_SwitchFireRate
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Reload1P
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Reload3P
ObjectTemplate.setPosition 0.005/-0.03/0.018
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Deploy1P
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Deploy3P
ObjectTemplate.addTemplate S_usrif_m4eotech_idx2_Zoom
ObjectTemplate.addTemplate e_Muzz_M16_2
ObjectTemplate.setPosition 0.005/0.032/0.383
ObjectTemplate.addTemplate e_shellejection_556
ObjectTemplate.setPosition 0.0251001/0.038/0.0133211
ObjectTemplate.setRotation -5/0/0
ObjectTemplate.addTemplate e_rifle_Prone
ObjectTemplate.addTemplate e_rifle_from_prone
rem -------------------------------------
ObjectTemplate.animationSystem1P objects/weapons/handheld/usrif_m4eotech_idx2/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P objects/weapons/handheld/usrif_m4scope/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate 556_45_r
ObjectTemplate.keepProjectiles 5
ObjectTemplate.velocity 884
ObjectTemplate.itemIndex 2
ObjectTemplate.delayToUse 2.65

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Fire1P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/stereo/m4_fire_indoor.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Fire1P_Outdoor
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/stereo/m4_fire_outdoor.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Fire3P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/mono/M4_fire_03.wav"
ObjectTemplate.loopCount 0
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.9/1/
ObjectTemplate.position 0.004/0.029/0.512
ObjectTemplate.minDistance 15
ObjectTemplate.halfVolumeDistance 15

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_BoltClick
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/mono/m4_boltclick.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.8
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_TriggerClick
ObjectTemplate.modifiedByUser mdo
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/mono/ar15_trigger.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_m4eotech_idx2_SwitchFireRate
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/mono/m4_fire_rate_switch.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.39
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Reload1P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m203/sounds/M16_reload_new.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_m4eotech_idx2_Reload3P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m203/sounds/M16_reload.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.48
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.position 0.005/-0.03/0.018
ObjectTemplate.minDistance 2
ObjectTemplate.halfVolumeDistance 4

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Deploy1P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m203/sounds/m4_deploy_1p.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.4
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Deploy3P
ObjectTemplate.modifiedByUser jsa
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/handheld/usrif_m4/sounds/mono/m4_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.4
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 0.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_usrif_m4eotech_idx2_Zoom
ObjectTemplate.modifiedByUser nfe
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/weapons/common/sounds/ironsights/AR_aim.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 0.35
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
confile: usrif_m4eotech_idx2

Code: Select all

GeometryTemplate.create BundledMesh usrif_m4eotech_idx2

ObjectTemplate.create GenericFirearm usrif_m4eotech_idx2
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator TUNIT-PC:Tunit
ObjectTemplate.geometry usrif_m4eotech

include usrif_m4eotech_idx2.tweak
M42 Zwilling
Retired PR Developer
Posts: 613
Joined: 2012-06-10 11:27

Re: adding grapplinghook to sniper kit - SP only

Post by M42 Zwilling »

Yeah, you shouldn't edit your PR install like this unless you only ever play on local like the OP. If you want to do that, backup your files so you can swap them back when you play online or setup a separate pr_edit (I think there's a tutorial for that in Community Modding). Here's my unedited objects_common_server.zip, swap it out for the one you changed and see if that fixes the file verification: https://www.dropbox.com/s/jtdtnjnn5bnhegc/objects_common_server.zip?dl=0

As for the crashing, feel free to post the .con file you edited and I'll take a look. :)
Image


"How many posts have there been about how much better PR was back in 0.X? The fact is that if we played the older versions we would start to remember the shortcomings, but we tend to hold onto the good memories tighter than the bad ones." - Murphy
Post Reply

Return to “Coop & Singleplayer”