IPB

Welcome Guest ( Log In | Register )

Locking zoom on vehicle sights, A question on zoomfactor tweaks
mft004
post Nov 22 2017, 02:11 PM
Post #1


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



Hello,

I'm trying to see a further distance when using the gun sights on a tank. 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 Bf2 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 agian to anyone who can help here.

Mark
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 11)
CaptainSquid1213
post Nov 23 2017, 03:30 AM
Post #2


Private
**

Group: Soldiers
Posts: 31
Joined: 20-July 15
Member No.: 10,746



Check this out: http://www.battlefieldsingleplayer.com/for...showtopic=19315
Go to the top of the page
 
+Quote Post
mft004
post Nov 23 2017, 01:50 PM
Post #3


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



Many thanks Squid, I'll probably try the 2nd idea from that thread first.

Out of interest given your skill in finding the right old thread, would you know of any threads that address my other question on vehicle speed?

Mark
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Nov 23 2017, 08:52 PM
Post #4


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,465
Joined: 31-December 03
From: Home
Member No.: 48



Moving to "Advanced Topics" due to the modding nature of the thread.


--------------------
Go to the top of the page
 
+Quote Post
Fastj@ck
post Nov 24 2017, 12:14 PM
Post #5


Major
****

Group: Soldiers
Posts: 288
Joined: 24-August 08
From: Germany
Member No.: 5,523



QUOTE
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


Not all is hardcodded so there is hope biggrin.gif

In BF2nilla,
the mainweapon (cannon) is tweaked as primary weapons (FireInput PiFire= left mouse button),
the coax mg's on the tanks are tweaked as secondary weapons (FireInput PiAltFire = right mouse button),
the SmokeLaunchers are also secondary (passive) weapons (FireInpit PiFlareFire = X),

You could also tweak it different like giving the cannon 2 different ammotypes like HEAT or AP shells. That is handled via ItemIndexes in the tweaks of the vehicle.
ItemIndexes means they are selectable = 1, 2, 3, 4, 5, etc. Parachute it the 9. I think you get what i mean.
You can also tweak the coax as a selectable weapon like giving the coax's ItemIndex 3. When you use that method, you can zoom with Rightclick without firing your coax.

When you want to keep the coax as Rightclick you have to think out of the box. Check CaptainSquid link.

When you want zoom with Rightclick and the coax's as secondary you need hardcore out of the box thinking.
I dont know if that works but.....

Weapons can have a FireInput and a AltFireInput. The coax uses the FireInput PiAltFire
ObjectTemplate.fire.fireInput PiAltFire
ObjectTemplate.fire.altFireInput WHATEVER YOU HAVE FREE like X but than you have no SmokeLauncher as passive weapon on X or you could tweak the SmokeLauncher so that it is a selectable weapon with FireInput PiFire.

You can add to the coax a IgnoreFireButton option to keep the rightclick only for zoom.
ObjectTemplate.fire.ignoreFireButton PiAltFire.

Maybe it works ......

QUOTE
Out of interest given your skill in finding the right old thread, would you know of any threads that address my other question on vehicle speed?

List of Important .....

This post has been edited by Fastj@ck: Nov 24 2017, 04:58 PM
Go to the top of the page
 
+Quote Post
mft004
post Nov 24 2017, 02:06 PM
Post #6


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



Excellent stuff Fastjack. I love the idea of making the mg a separate weapon; any time delay wouldn't be a problem because I'd be camping most of the time smile.gif

But I've got a problem; I'm pretty bad at editing these tweak files in the right place. I've pasted below any instances in my tank's tweak file, where the mg is listed. Would you know which lines I should be changing to make the mg a weapon in its own right? If it helps, I've also attached the whole tweak file for the tank (a beautiful PzIVF2)



"
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
"
Attached File(s)
Attached File  pzivf2.txt ( 44.62K ) Number of downloads: 4
 
Go to the top of the page
 
+Quote Post
Fastj@ck
post Nov 24 2017, 04:53 PM
Post #7


Major
****

Group: Soldiers
Posts: 288
Joined: 24-August 08
From: Germany
Member No.: 5,523



What is the FlareFireCameraSwitch_alt?

Is it possible that the tank has already zoom when you press X?
The ObjectTemplate.addTemplate FlareFireCameraSwitch_alt isn't integrated into the tanktweak (it's an seperate template anywhere integrated (maybe vehicle/common folder).
Seems like many template that are used aren't in the tweaks of that tank. I cant find the MG34_main weapon. I believe it's a weapon in the weaponsfolder and only the template get called via the tanktweak.
Go to the top of the page
 
+Quote Post
mft004
post Nov 24 2017, 05:23 PM
Post #8


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



I looked around and I found the files you were asking about (attached - they weren't .txt files originally, they were .con files but I couldn't upload .con files to this reply). What do you think of them?

About your question on the zoom with 'x', you could be right there. But I'm hoping that there's a code somewhere which tells Bf2 what zoom level that should be. Maybe if I could find that code line, I could just set it to an increased zoom and I'd be happy with that.
Attached File(s)
Attached File  FlareFireCameraSwitch.con.txt ( 1.44K ) Number of downloads: 2
Attached File  FlareFireCameraSwitch_alt.con.txt ( 1.45K ) Number of downloads: 2
Attached File  RightClickCameraSwitch.con.txt ( 1.44K ) Number of downloads: 1
Attached File  RightClickCameraSwitch_alt.con.txt ( 1.44K ) Number of downloads: 1
 
Go to the top of the page
 
+Quote Post
Fastj@ck
post Nov 25 2017, 09:14 AM
Post #9


Major
****

Group: Soldiers
Posts: 288
Joined: 24-August 08
From: Germany
Member No.: 5,523



I need to know the settings from CameraID3. The zoom toggles to another camera
Go to the top of the page
 
+Quote Post
mft004
post Nov 25 2017, 10:42 AM
Post #10


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



I've hopefully found those settings via the attached .con file, what do you think of it? It was located in \objects_vehicles_server.zip\Vehicles\Land\Common\ if that sounds right. I've also attached a printscreen of the Common folder in case you were after a different file in there.

Thanks also for your help with this so far, it's appreciated.

This post has been edited by mft004: Nov 25 2017, 10:44 AM
Attached File(s)
Attached File  Common.jpg ( 72.99K ) Number of downloads: 3
Attached File  TankCameras.con.txt ( 13.58K ) Number of downloads: 3
 
Go to the top of the page
 
+Quote Post
Fastj@ck
post Nov 26 2017, 02:46 PM
Post #11


Major
****

Group: Soldiers
Posts: 288
Joined: 24-August 08
From: Germany
Member No.: 5,523



CODE
ObjectTemplate.CVMChase 0
ObjectTemplate.CVMFrontChase 0
ObjectTemplate.CVMFlyBy 0

Sofar i can see, the camera option for the 3rd player views are disabled. You can only cycle between the normal Cam and Nosecam.

CODE
ObjectTemplate.worldFOV 1
ObjectTemplate.insideFOV 1

One of those values must be changed (lowered like 0.8 or 0.5) to get a zoom effect when you press the the KeyInput button.
I still not remember which one of this was but it works like that. When you not press the cameraswitch button the value 1 is used. When you switch the camera all things in the world are shown closer on your screen.
It's like a Distance value, how far you away from the perspective view.

In the excample with the FlareFireCameraSwitch_alt the keybinding is the X-Button. Maybe the Mod your working for has also a zoom cameraswitch with rightmouse button. Depends on how the camera imputs are tweaked and which one is used on the vehicles.

Go to the top of the page
 
+Quote Post
mft004
post Nov 26 2017, 05:43 PM
Post #12


Private
**

Group: Soldiers
Posts: 15
Joined: 21-November 17
From: England
Member No.: 12,426



Fastjack, many thanks again, you're a genius.

I found the tank gunner camera and changed the insideFOV to 0.125 and now I have the zoom by default in the tank scope biggrin.gif biggrin.gif

I also now realise I can change the look of the outside view of the tank by changing other FOV values in the same .con file. Much fun to be had now smile.gif Many thanks again sir.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2017 - 07:00 AM