Deployable M2 w/ M3 tripod

Ask questions, discuss ideas, get answers
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Deployable M2 w/ M3 tripod

Post by Coroner47 »

I was thinking of what other weapon systems i could make like the deployable mortar in DC 0.7 today. Well i came up with this Browning M2 .50 cal kit deployable unit!! :twisted: It works very well for spawn camping!!

I was also thinking of how to make a automated sentry gun ... & figured i could add a ai only forced spawn to a stationary gun w/ a "SeatObject" that would hide the soldier body. I will try this tomorrow!!!

Here's a vid of the deployable M2
http://www.youtube.com/watch?v=9M5AdMzOkJU

Here's a pic of the unit in-game
http://www.filefront.com/15239877/Deployable-M2.jpg/

Here's some info on the M2 & M3
http://www.inetres.com/gp/military/infantry/mg/M2.html
Image
Pray hard, die fast
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Deployable M2 w/ M3 tripod

Post by fo0k »

I was also thinking about the sentry gun and a bot controlling it the other day.. can you prevent them from exiting?
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Ive been messing around with this automated sentry gun idea all day. I finally discovered that you can use ...

Code: Select all

ObjectTemplate.hasRestrictedExit 1
ObjectTemplate.setSoldierExitLocation 0/0/0 0/0/0
which, say on a humvee, causes the exit location to be inside the vehicle ... preventing the soldier from exiting. But for some reason after pressing "E" to exit the vehicle a few times, you will eventually exit the vehicle!! :shock: Its buggy!! :?

Also, the only way i can see it possible to not have the soldiers body visible, is to put him inside something or drop the seatobject way below the ground. Anybody got any ideas??
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 »

Great idea. How about eliminating the seat animation altogether so there is no visible soldier (ala the Hanomag driver - only an entry is required), and make the gun's AI unit plugin equipmentType 11 which is Landingcraft Fixed. Then a bot will only exit the weapon if it comes in contact with a Landing Zone.
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Ok Wow POTAmatt!!! That worked perfectly! :D :twisted: Only one problem left to fix. How can i force a bot to spawn immediatly on the gun / pco? Currently im using this...

Code: Select all

rem *** Used for Automated Sentry Gun attempt ***
ObjectTemplate.create SpawnPoint Deployable_M2SoldierSpawn
ObjectTemplate.setSpawnRotation 0/0/0
ObjectTemplate.setSpawnPositionOffset 0/0/0
ObjectTemplate.setSpawnPreventionDelay 0
ObjectTemplate.setSpawnId 0
ObjectTemplate.setGroup 64
ObjectTemplate.setEnterOnSpawn 0
ObjectTemplate.setAIEnterOnSpawn 1
ObjectTemplate.setSpawnAsParaTroper 0
... but im think there's someway to "ObjectSpawner" a soldier & have him EnterOnSpawn. Im just not seeing it tho.

Here's a vid of the test sentry gun in action. http://www.youtube.com/watch?v=3h5ufgSz3mM
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 »

Hey, that is sweeeet! There's always a way to get the bots to do our evil bidding. The video looks great. I gotta make me one of those. I'm not certain i understand your question though, but if i did, you've already got it as is. ObjectTemplate.setAIEnterOnSpawn 1 means the bot will spawn and enter the vehicle only if the seat is not already taken. If it's already taken, he won't spawn there. A value of 0 means he'll spawn there at that point, but will have not entered the seat. He can then enter it or split. That's dangerous because now you've got a mobile spawn point and everybody will start spawning in standing next to the weapon. Same goes for ObjectTemplate.setEnterOnSpawn 0, but that's for human players. I hope that answers it for you. If not let me know. Matt
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Well what happens is. When i deploy the bot-omated sentry gun, it takes about 5-10secs for a bot to spawn on it. Therefore making it kinda useless for that initial time. Also, i remember having problems with the bots not spawning on it when the action shifted to another part of the map.
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 »

Sounds like good news in that the spawner works. Unfortunetely you can't predict when someone is gonna get killed and when they're gonna use that spawnpoint. Why not just heat it up so any bot will seek it out and enter it. Also, do you have the bots deploying them? If not, post your AI code for both the deployable and the actual weapon and we'll get them doing so. It's just a matter of tweaking their AI object and weapon templates.
Coroner47
Posts: 213
Joined: Tue Nov 24, 2009 5:11 am
Location: Canada

Re: Deployable M2 w/ M3 tripod

Post by Coroner47 »

Ok here's my AI codes for the gun PCO. Oh and uh :oops: i didn't add any AI for the handfirearm, cause i figured the bots would just be dropping sentry guns all over the map. I don't know if it would be possible for them to deploy the gun in a usuable way.

I tried to heat up the PCO for the AI and make the AI use it better. Im not sure exactly what these settings do tho "aiTemplate.degeneration" & "aiTemplate.allowedTimeDiff".

AI / Objects.con for "Deployable_M2" PCO

Code: Select all

rem *** Plugins ***
aiTemplatePlugIn.create Unit Deployable_M2Unit
rem aiTemplatePlugIn.equipmentType 13
aiTemplatePlugIn.equipmentType 11
rem aiTemplatePlugIn.setStrategicStrength 0 4
rem aiTemplatePlugIn.setStrategicStrength 1 6
aiTemplatePlugIn.setStrategicStrength 0 15
aiTemplatePlugIn.setStrategicStrength 1 15
aiTemplatePlugIn.setHasExposedSoldier 1
aiTemplatePlugIn.setUseNoPathfindingToGetToObject 1

aiTemplatePlugIn.create Armament Deployable_M2Armament

aiTemplatePlugIn.create Physical Deployable_M2Physical
aiTemplatePlugIn.setStrType LightArmour

aiTemplatePlugIn.create ControlInfo Deployable_M2Ctrl
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
rem aiTemplatePlugIn.pitchLookAhead             1.0
rem aiTemplatePlugIn.rollLookAhead              1.0
aiTemplatePlugIn.pitchLookAhead             3.0
aiTemplatePlugIn.rollLookAhead              3.0
aiTemplatePlugIn.yawLookAhead               1.0
aiTemplatePlugIn.lookVerticalLookAhead      1.0
aiTemplatePlugIn.lookHorizontalLookAhead    1.0
aiTemplatePlugIn.throttleScale              1.0
rem *** Angle in radians ***
rem aiTemplatePlugIn.pitchScale                 1.0
rem aiTemplatePlugIn.rollScale                  1.0
aiTemplatePlugIn.pitchScale                 5.0
aiTemplatePlugIn.rollScale                  5.0
aiTemplatePlugIn.yawScale                   0.0020
aiTemplatePlugIn.lookVerticalScale          1.0
aiTemplatePlugIn.lookHorizontalScale        1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -100/-70/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 100/50/0

rem *** AITemplate ***
aiTemplate.create Deployable_M2AI
aiTemplate.addType ITUnit
aiTemplate.addType ITGround
aiTemplate.addType ITFixed
aiTemplate.degeneration 20
rem aiTemplate.degeneration 180
aiTemplate.allowedTimeDiff 3
rem aiTemplate.allowedTimeDiff 7
aiTemplate.basicTemp 10
rem aiTemplate.basicTemp 120
aiTemplate.commonKnowledge 0
aiTemplate.addPlugIn Deployable_M2Unit
aiTemplate.addPlugIn Deployable_M2Physical
aiTemplate.addPlugIn Deployable_M2Armament
aiTemplate.addPlugIn Deployable_M2Ctrl
and thanx for all the help!!
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 »

Having bots use the deployables are simple enough. You can limit their range and effectiveness or have them throwing weapons all over the place. It's just a matter of tweaking the plugins. I use it all the time for mortars and such and can be a lot of fun. What you've got so far looks good, but their are a few things to point out. There are many with the belief that aiTemplatePlugIn.setStrategicStrength has a max value of 9. They may be right. I'm under the impression that it's greatest importance is for the bots to determine who to shoot first. That, for example, a bot with a bazooka will target a tank with a StrategicStrength of 9 before firing at a jeep with a StrategicStrength of 4. The aiTemplate.degeneration value tells the bots how long before they can forget that target and reassess. A plane's value is set low because there's no sense in bots staring at it after it's already flown out of range. AiTemplate.allowedTimeDiff is how often that vehicles information is refreshed. Soldiers are set to a low value of 0.5, so every half second his information is updated, so the lower the value, the more up to date he is concerning his surrounding targets. Probably the 2 biggest things you can do to get them in the weapon is to increase the aiTemplate.basicTemp (i see you had that set to 120 temporarily, so that should help) and set it's relative strength against infantry, lightarmor, etc. in the weapons template. So if this weapon is more useful against infantry as compared to anything else on the map, make it's value higher. Start with something like this and then tweak to your liking:

weaponTemplate.create DeployableM2
weaponTemplate.burst 1
weaponTemplate.indirect 0
weaponTemplate.minRange 1.0
weaponTemplate.maxRange 450.0
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry 15.0
weaponTemplate.setStrength LightArmour 9.0
weaponTemplate.setStrength HeavyArmour 0.0
weaponTemplate.setStrength NavalArmour 0.0
weaponTemplate.setStrength Submarine 0.0
weaponTemplate.setStrength Air 1.0

If you really want to get them in the weapon on a specific strategy, add this to that particular strategy or all strategies:
aiStrategy.setTreeModifier TTNFriendGroundFixed 2.0
That modifier will double the value of the temperature of anything flagged with 'aiTemplate.addType ITFixed'. A value of 3 will triple it, etc. You'll never get the bots out of the weapon at that point. LOL.
Give it a shot and let me know how it works out. Matt
Post Reply