Help - Search - Members - Calendar
Full Version: T72 Main Gun Elevation Change?
Battlefield SinglePlayer Forum > Main > BF42 and BFV Discussion > AI Editing and Mod Support
warpossum
Can anyone tell me how to decrease min vertical elevation of the T-72 tank?

I've played around in the Object.con with the rotational bundles and any setting I can find that has "rotation" or even "camera" in it with no noticeable results. I've also searched through the archives, although with little luck since "T72" is fewer than four letters long (and therefore not a valid search term). I'm a hair's breadth from just yanking the thing off of my map.

BTW, I'm using an in-map tweaks file ala FourCentsShy. I'm hoping this can be done by dropping a couple of lines in somewhere.

Thanks.
Dnamro
If you said which game/mod you were working on, I could go right there and pull up the code for you. Anyway, I am using the BFV T72 code as an example, because tank turrets are coded very similar in the Battlefield Series.

Take a look at the code for the turret:

CODE

rem *** T72Turret ***
ObjectTemplate.create RotationalBundle T72Turret
ObjectTemplate.networkableInfo T72TurretInfo
ObjectTemplate.attachToListener 1
ObjectTemplate.loadSoundScript Sounds/T54Tower.ssc
ObjectTemplate.geometry ve_T72_turret_m1
ObjectTemplate.hasCollisionPhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate T72GunBase
ObjectTemplate.setPosition 0/0.3/1.175
ObjectTemplate.addTemplate T72MG_PCO1
ObjectTemplate.setPosition 0/0.75/-0.199
rem -------------------------------------
ObjectTemplate.maxSpeed 20/0/0
ObjectTemplate.acceleration 1000/0/0
ObjectTemplate.inputToYaw c_PIMouseLookX



rem *** T72GunBase ***
ObjectTemplate.create RotationalBundle T72GunBase
ObjectTemplate.networkableInfo T72GunInfo
ObjectTemplate.attachToListener 1
ObjectTemplate.loadSoundScript Sounds/T54GunBase.ssc
rem -------------------------------------
ObjectTemplate.addTemplate lodT72Cockpit
ObjectTemplate.addTemplate T72GunBarrel
ObjectTemplate.setPosition 0/0/-0.104
ObjectTemplate.addTemplate T72Camera
ObjectTemplate.setPosition -0.461/0.432/0.07
ObjectTemplate.addTemplate Driver_MG
ObjectTemplate.setPosition -0.367/-0.091/0.08
rem -------------------------------------
ObjectTemplate.minRotation 0/-20/0
ObjectTemplate.maxRotation 0/0/0
ObjectTemplate.maxSpeed 0/15/0
ObjectTemplate.acceleration 0/1000/0
ObjectTemplate.inputToPitch c_PIMouseLookY


First of all, you need to understand that most weapon systems are controlled by two rotational bundles.

The first one is in T72turret and it controls the left and right rotation of the weapon. But where is the code for the min and max rotation? It's not needed because it's unlimited. I know this because of this line:

CODE

ObjectTemplate.inputToYaw c_PIMouseLookX


( Yaw and the X axis are the horizontal rotation)

However, if you wanted the turret rotation to 90 degrees left or right you would add these lines:

CODE

ObjectTemplate.minRotation -90/0/0
ObjectTemplate.maxRotation 90/0/0



Now the T72 Turrent is linked to the T72GunBase which controls the up and down rotation (vertical rotation). Which is set in these lines:

CODE

ObjectTemplate.minRotation 0/-20/0
ObjectTemplate.maxRotation 0/0/0


The middle numbers are the vertical rotation settings. Try these settings to start and play with the numbers until you find the limits that you like:


CODE

ObjectTemplate.minRotation 0/-40/0
ObjectTemplate.maxRotation 0/45/0


If playing with bots don't forget to change the AI to match:

CODE

aiTemplatePlugIn.create ControlInfo T72Ctrl
aiTemplatePlugIn.driveTurnControl           PIYaw
aiTemplatePlugIn.driveThrottleControl       PIThrottle
aiTemplatePlugIn.aimHorizontalControl       PIMouseLookX
aiTemplatePlugIn.aimVerticalControl         PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl      PIMouseLookX
aiTemplatePlugIn.lookVerticalControl        PIMouseLookY
aiTemplatePlugIn.throttleSensitivity       -1.0
rem aiTemplatePlugIn.pitchSensitivity           0.021817
rem aiTemplatePlugIn.rollSensitivity           -0.021817
aiTemplatePlugIn.pitchSensitivity           0.21817
aiTemplatePlugIn.rollSensitivity           -0.21817
aiTemplatePlugIn.yawSensitivity            -2.5
rem aiTemplatePlugIn.lookVerticalSensitivity    0.021817
rem aiTemplatePlugIn.lookHorizontalSensitivity -0.021817
aiTemplatePlugIn.lookVerticalSensitivity    0.21817
aiTemplatePlugIn.lookHorizontalSensitivity -0.21817
aiTemplatePlugIn.throttleLookAhead          1.0
aiTemplatePlugIn.pitchLookAhead             1.0
aiTemplatePlugIn.rollLookAhead              1.0
aiTemplatePlugIn.yawLookAhead               1.0
aiTemplatePlugIn.lookVerticalLookAhead      1.0
aiTemplatePlugIn.lookHorizontalLookAhead    1.0
aiTemplatePlugIn.throttleScale              1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale                 5.0
aiTemplatePlugIn.rollScale                  5.0
aiTemplatePlugIn.yawScale                   0.0020
aiTemplatePlugIn.lookVerticalScale          1.0
aiTemplatePlugIn.lookHorizontalScale        1.0


rem *** CHECK NONAI OBJECT.CON FOR THESE VALUES  << Thanks devs for the reminder!
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -360/-40/0  <<<<  change this line to match
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 360/45/0   <<<< change this line to match


For the AI -360 and 360 represent unlimited horizontal rotational movement and -40 and 45 are the limits of the vertical rotational movement.
warpossum
I'm working on a map for straight BFV v1.21 No real bells and whistles.


These are the lines I've been working with.
CODE

rem *** T72GunBase Tweaks***
ObjectTemplate.active T72GunBase
rem -------------------------------------
ObjectTemplate.minRotation 0/-20/0
ObjectTemplate.maxRotation 0/10/0


It's good to know that I've been in the right ballpark. I went right back to it and it still didn't work (at first). So with newfound confidence I started looking for other errors. It turns out I'd futzed my init.con and my tweaks file wasn't loading. I was assuming my coding choices were wrong, so I wasn't looking into it that far back.

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.