Author Topic: Locking zoom rather than variable zoom  (Read 504 times)

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Locking zoom rather than variable zoom
« on: 23-11-2017, 21:11:27 »
Evening,

I'm trying to see a further distance when using the gun sights on a tank (test is PzIVF2). So I added the lines of text starting: rem ---BeginComp:DefaultZoomComp --- to the tank's .tweak file and then added an extra ObjectTemplate.zoom.addZoomFactor, in this case 0.05. When I loaded up FH2 and tried this out, yes the sights did zoom in with the Alt-Fire function, but this also fired the tank's secondary weapon (machine gun). It looks like both the secondary gun and the scope function are hard-coded to be the same key and there's no way round this. So then I thought I'd just remove this line of text from the .tweak file: ObjectTemplate.zoom.addZoomFactor 0. I asssumed that by doing this, I'd be left with a tank that was always zoomed in on the scope, so to speak. But when I loaded up Bf2 again, I still had to zoom in to get the increased zoom and of course that meant that the machine gun went off when I right-clicked.

Does anyone know the best way round this? Is there really a way to lock a gun's zoom function to the maximum zoom?

Thanks again to anyone who can help here.

Mark

Offline Hjaldrgud

  • Jr. Member
  • **
  • Posts: 1.071
  • BF2 Enthusiast
    • View Profile
Re: Locking zoom rather than variable zoom
« Reply #1 on: 23-11-2017, 22:11:41 »
Check out Alpha Project this mod has zoom on right mouse button and MG on a number button.

"Generous and brave men live the best" -Hávamál

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Locking zoom rather than variable zoom
« Reply #2 on: 24-11-2017, 21:11:09 »
I've had a look at my AP copy and I see what you mean.  Look's like their tanks have the mg listed as ItemIndex 3 to make a separate weapon out of it.  However, I'll admit I'm not very good with code so wasn't sure how to replicate this on FH2's PzIVF2 tank, as I couldn't see a unique entry for the mg34.

If you don't mind, I've pasted below any instances within the PzIVF2's tweak code, where the mg is listed.  Would you know which section I should be editing to make the mg a separate weapon?

"
ObjectTemplate.activeSafe RotationalBundle PZIVF2_hullmg
ObjectTemplate.modifiedByUser "jbp"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
rem -------------------------------------
ObjectTemplate.addTemplate S_PZIVF2_hullmg_RotationRpm
ObjectTemplate.addTemplate Tank_HullGunnerCamera
ObjectTemplate.setPosition 0.0209/0.147/-0.6
ObjectTemplate.addTemplate Coaxial_MG34_Main
ObjectTemplate.setPosition 0.017494/0.012903/0.363406
"



"
ObjectTemplate.addTemplate S_PZIVF2_cannon_base_RotationRpm
ObjectTemplate.setPosition -0.507886/0/0.433987
ObjectTemplate.addTemplate Coaxial_MG34_Cam3
ObjectTemplate.setPosition 0.3701/0.00324/0.4152
ObjectTemplate.addTemplate Tank_GunnerCamera
ObjectTemplate.setPosition -0.42738/-0.0185/-0.50001
ObjectTemplate.addTemplate PZIVF2_cannonHE
ObjectTemplate.addTemplate FlareFireCameraSwitch_alt
rem -------------------------------------
ObjectTemplate.setMinRotation 0/-20/0
ObjectTemplate.setMaxRotation 0/10/0
ObjectTemplate.setMaxSpeed 0/36/0
ObjectTemplate.setAcceleration 0/36/0
ObjectTemplate.setInputToPitch PIPitch
ObjectTemplate.rememberexcessinput 1
"



"
ObjectTemplate.activeSafe PlayerControlObject pzivf2_hullmgpco
ObjectTemplate.modifiedByUser "jbp"
ObjectTemplate.setNetworkableInfo BasicInfo
rem ---BeginComp:VehicleHud ---
ObjectTemplate.createComponent VehicleHud
ObjectTemplate.vehicleHud.hudName "KILLMESSAGE_VEHICLE_PZIVF2"
ObjectTemplate.vehicleHud.miniMapIconLeaderSize Medium
ObjectTemplate.vehicleHud.vehicleIconPos 60/18
ObjectTemplate.vehicleHud.useSelectionIcons 0
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
"

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Locking zoom rather than variable zoom
« Reply #3 on: 27-11-2017, 18:11:09 »
Hello there,

as a final update to this question, turns out I needed to head to tank cameras via vehicles_server and change FoV settings, now things are looking pretty beautiful inside the tank and out! Thanks also for the AP heads up.