Deployable M2 w/ M3 tripod

Ask questions, discuss ideas, get answers
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Deployable M2 w/ M3 tripod

Post by POTAmatt »

Also, here's an old thread for putting together deployable mortars:

http://www.battlefieldsingleplayer.com/ ... 8613&st=30

But in a nutshell, here are some serverside tweaks i did for deployable mortars on DC_Weapon_bunkers.
You could easily modify these for the M2:

Code: Select all


rem *** Add gun ***
weaponTemplate.create mortarHWAI
weaponTemplate.burst 0
weaponTemplate.indirect 0
weaponTemplate.ExitVelocity 999.0
weaponTemplate.UseAimerOnly 1
weaponTemplate.minRange 20
weaponTemplate.maxRange 400
weaponTemplate.weaponActivate PIMenuSelect4
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry     5.0
weaponTemplate.setStrength LightArmour  4.0
weaponTemplate.setStrength HeavyArmour  3.0
weaponTemplate.setStrength NavalArmour  0.0
weaponTemplate.setStrength Submarine    0.0
weaponTemplate.setStrength Air          0.0

ObjectTemplate.active Mortar_weap
ObjectTemplate.aiTemplate mortarHWAI

ObjectTemplate.active mortar_deploy
ObjectTemplate.aiTemplate mortarHWAI

weaponTemplate.active mortarGun
weaponTemplate.burst 0
weaponTemplate.indirect 1
weaponTemplate.minRange 8
weaponTemplate.maxRange 600
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry    12.0
weaponTemplate.setStrength LightArmour  9.0
weaponTemplate.setStrength HeavyArmour  4.0
weaponTemplate.setStrength NavalArmour  0.0
weaponTemplate.setStrength Submarine    0.0
weaponTemplate.setStrength Air          0.0



rem *** Plugins ***
aiTemplatePlugIn.active MortarUnit
aiTemplatePlugIn.equipmentType 13
aiTemplatePlugIn.setStrategicStrength 0 3
aiTemplatePlugIn.setStrategicStrength 1 6
aiTemplatePlugIn.setHasExposedSoldier 1
aiTemplatePlugIn.setUseNoPathfindingToGetToObject 0

rem aiTemplatePlugIn.create Armament MortarArmament

rem aiTemplatePlugIn.active Physical MortarPhysical
rem aiTemplatePlugIn.setStrType LightArmour

aiTemplatePlugIn.active MortarCtrl
aiTemplatePlugIn.driveTurnControl           PINone
aiTemplatePlugIn.driveThrottleControl       PINone
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                   2.0
aiTemplatePlugIn.lookVerticalScale          1.0
aiTemplatePlugIn.lookHorizontalScale        1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -90/-30/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 90/30/0
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Ok... ive been messing around with the settings you suggested & i think i got everything looking good except for the vertical aiming of the ai. It seems to have a problem. The sentry gun aims no problem on the horizontal, but with the vertical the ai seems to slowly track to the target then squeeze off a couple rnds then return to an upwards aiming position then track to the target again.... over & over. Im not sure why. Also, does anybody have any suggestions for a model for a automated sentry gun? I made my own & it looks alright i guess... but as far as I can see there is only 1 real automated sentry out there...
http://www.cosmosmagazine.com/node/1873
... and it can't be deployable by a single human being. Im all for reality!

Here's a vid of the new ... what i now call the " M2 DASG" or "M2 Deployed Automated Sentry Gun". The video shows how the gun doesn't properly aim / track vertically.
http://www.youtube.com/watch?v=PdvXoXAtMZc
Image
Pray hard, die fast
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Deployable M2 w/ M3 tripod

Post by POTAmatt »

The sentry gun aims no problem on the horizontal, but with the vertical the ai seems to slowly track to the target
Does the PCO's X/Y rotations match the AI's X/Y camera rotations in your ControlInfo plugin?

aiTemplatePlugIn.setCameraRelativeMinRotationDeg -100/-70/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 100/50/0
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

I changed the ...
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -100/-70/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 100/50/0
... to match the PCO & ya it seems to have helped. I also dropped the range on the browning to "weaponTemplate.maxRange 50.0" so the gun doesn't go targeting way far off targets.

Also i changed these settings, but i am unsure if they actually made a difference.
rem aiTemplatePlugIn.lookVerticalScale 1.0
rem aiTemplatePlugIn.lookHorizontalScale 1.0
aiTemplatePlugIn.lookVerticalScale 3.0
aiTemplatePlugIn.lookHorizontalScale 3.0

rem aiTemplatePlugIn.lookVerticalLookAhead 1.0
rem aiTemplatePlugIn.lookHorizontalLookAhead 1.0
aiTemplatePlugIn.lookVerticalLookAhead 3.0
aiTemplatePlugIn.lookHorizontalLookAhead 3.0

I think its as good as its gonna get. I'll post the whole thing so everyone can have soon as i addArmorEffects & prevent ppl from using it as a spawn point. :D
Image
Pray hard, die fast
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Got yet another problem. :oops: Not sure if this one if possible to fix tho. Id like to have it so you can only deploy 1 sentry gun per soldier (human). Anybody got any ideas? I tried "ObjectTemplate.NrOfObjectToSpawn 1" & you could still deploy more guns. Id like to prevent spamming of the gun. I like how 2042 kills the previous sentry gun when you place a new one.
Image
Pray hard, die fast
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Here's a link to the completed unit. Objects, animations, textures & meshes. This should be everything one would need to drop this into a mod. You might have to change some of the paths in the object.con & geometries.con files. Feel free to do whatever you like with the code. No credit is necessary. Also, i couldn't figure out a way to limit how many guns can be placed.

http://www.filefront.com/15345561/M2_DASG.rar
Image
Pray hard, die fast
Post Reply