Jump to content
Official BF Editor Forums
Sign in to follow this  
D_Lusted

Bots and TV Guided Missiles

Recommended Posts

I've tried everything I know to get the bots firing the TV Guided Missiles from the Attack Choppers....

I've done this in the AH1Z weapons.ai....

rem * TV Guided Missiles*

weaponTemplate.create AHE_AH1Z_TV_Guided

weaponTemplate.indirect 0

weaponTemplate.minRange 30.0

weaponTemplate.maxRange 200.0

weaponTemplate.setStrength Infantry    0.01

weaponTemplate.setStrength LightArmour 9.0

weaponTemplate.setStrength HeavyArmour 10.0

weaponTemplate.setStrength NavalArmour 0.0

weaponTemplate.setStrength Helicopter  7.0

weaponTemplate.setStrength Airplane    0.01

weaponTemplate.fireRate 60

weaponTemplate.allowedDeviation 4.0

And I've done this to the AH1Z.tweak...

rem ---EndComp ---

ObjectTemplate.floaterMod 0

ObjectTemplate.hasMobilePhysics 0

ObjectTemplate.material 56

ObjectTemplate.aiTemplate AHE_AH1Z_TV_Guided

rem -------------------------------------

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Fire1P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Fire1P_Outdoor

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Fire3P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_BoltClick

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_TriggerClick

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_SwitchFireRate

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Reload1P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Reload3P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Deploy1P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Deploy3P

ObjectTemplate.addTemplate S_AHE_AH1Z_CoGunner_HellFireLauncherTV_Zoom

rem -------------------------------------

ObjectTemplate.projectileTemplate agm114_hellfire_tv

ObjectTemplate.velocity 75

But, after testing, they still just fire the chain gun...

I have searched both here and Battlefield SinglePlayer Forum, but I still cannot find an answer for this....

Is it that that bots cannot us the PIAltFire function?

Share this post


Link to post
Share on other sites

No. Bots can use the PIAltFire no problem. But i'm missing that statement in your weapons.ai file.

It could also help to have the weapon 'indirect' , but i'm not sure about this.

Share this post


Link to post
Share on other sites

I basically copied the Rockets AI to changed it to the TV Guided Missiles...

Then added the template for the use to the actual weapon....

What statement is missing?

Share this post


Link to post
Share on other sites
' date='May 16 2006, 06:32 PM' post='39454']

No. Bots can use the PIAltFire no problem. But i'm missing that statement in your weapons.ai file.

It could also help to have the weapon 'indirect' , but i'm not sure about this.

But the thing is the tv guided missile isn't "PIAltFire"

Share this post


Link to post
Share on other sites

I recently learned that bots don't handle the TV guided stuff. You need to change the targeting system to 'LaserGuided' if the bots should use it.

There's also a hardcoded stuff with the fire button. Bots are only using the PIFire and not the PIAltFire to launch a laserguided, no matter what you try.

The guys from Allied Intent (KeithW) and clivewil pointed this out.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites
' date='Sep 11 2006, 05:53 PM' post='49966']

I recently learned that bots don't handle the TV guided stuff. You need to change the targeting system to 'LaserGuided' if the bots should use it.

There's also a hardcoded stuff with the fire button. Bots are only using the PIFire and not the PIAltFire to launch a laserguided, no matter what you try.

The guys from Allied Intent (KeithW) and clivewil pointed this out.

Well, i've gotten the bots to use the PoE:2 tv guided missiles. (both the millian and kornet). Though, they don't guide it very well.

Edited by Cold Fussion

Share this post


Link to post
Share on other sites

Is this topic still active? If so i would like to know, if bots can be set to use laser guided missle's witch is mentioned here

http://bfeditor.org/forums/index.php?showtopic=14306&hl=tv+guided+missle00

Then can I replace the tv guided missile with the laser guided missile on my helicopters?

Edited by BF1942Veteran

Share this post


Link to post
Share on other sites
Is this topic still active?

You just converted it into an active one :P

if bots can be set to use laser guided missle's witch is mentioned here

As mentioned in the topic the bots in vanilla ( retail ) BF2 don't use the TV-guided's. You have to apply laser guided targeting systems to the missiles and then the bots start to use them. Bots can't target with a projectile based camera.

Then can I replace the tv guided missile with the laser guided missile on my helicopters?

Yes. Only think about the fire buttons, bots often need to have the alternate fire buttons added to make use of the weapon.

BF1942Veteran
We never had this guided stuff in BF1942 (besides the Wasserfall rocket ). And if you remember from Mimoyecques the bots never used it on that map. Its basically the same in BF2.

Share this post


Link to post
Share on other sites

Thank you mschoeldgen for the info. I've got the laser guided missile on the AH-1Z in my mod and it work's but, I'm now trying to figure out how to get the bot's to use it. I think I may have to disable the machine gun because they will not switch weapons in the co pilot seat.

So I got the helicopter co-pilot AI to shoot laser guided missiles witch is pretty cool but at the cost of disabling the 20mm. If anyone knows how to get the helicopter co-pilot AI to switch between the 20mm and the laser guided missile please let me know thank you.

Edited by BF1942Veteran

Share this post


Link to post
Share on other sites

I'd try to set one weapon to Primary Firebutton and the other to the Alternate Firebutton. I can't tell atm which weapon on what button but thats easily tested. If you now have distinguished AITemplates for each weapon with no range overlaps and different strength against diff. armour it should be good to be operated by bots.

The other way is to use itemIndices to switch over the weapons. Note that this might require a selection icon, though. Best use one of the jets as template for your own code.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

No, guys! I've made bots to select missile by ticking isSelectable in both gun and missile firearm, and using following aitemplates:

weaponTemplate.create AHE_AH1Z_Gun
WeaponTemplate.WeaponActivate PIWeaponSelect1
weaponTemplate.indirect 0
weaponTemplate.minRange 5.0
weaponTemplate.maxRange 300.0
weaponTemplate.setStrength Infantry   30.0
weaponTemplate.setStrength LightArmour 8.0
weaponTemplate.setStrength HeavyArmour 2.0
weaponTemplate.setStrength NavalArmour 20.0
weaponTemplate.setStrength Helicopter  20.0
weaponTemplate.setStrength Airplane	1.0
weaponTemplate.deviationCorrectionTime 1
weaponTemplate.allowedDeviation 1.0

rem * TV guided *
weaponTemplate.create AHE_AH1Z_GunnerHellFire
WeaponTemplate.WeaponActivate PIWeaponSelect2
WeaponTemplate.WeaponFire PIFire
weaponTemplate.indirect 0
weaponTemplate.minRange 40.0
weaponTemplate.maxRange 600.0
weaponTemplate.setStrength Infantry	0.0
weaponTemplate.setStrength LightArmour 30.0
weaponTemplate.setStrength HeavyArmour 30.0
weaponTemplate.setStrength NavalArmour 30.0
weaponTemplate.setStrength Helicopter  0.0
weaponTemplate.setStrength Airplane	0.0
weaponTemplate.allowedDeviation 30.0

The problem i can't solve is making ai use mouse targeting system. But you can change it, my ai will work with LaserGuided.

Share this post


Link to post
Share on other sites

Thank you so much for the help guys. I just want my AI to fire the 20mm and the laser guided missle so it can give me more of a challenge on the battlefield ;)

Although it would make it more easier on you to have AI use tv guided because they have a chance to miss but it's also easier just to use laser guided missile's because i would imagine it would be hard to code bots to use tv guided. :D

Share this post


Link to post
Share on other sites
No, guys! I've made bots to select missile by ticking isSelectable in both gun and missile firearm,

How about reading my reply 'til the end , sashaNar ?

The other way is to use itemIndices to switch over the weapons.
because i would imagine it would be hard to code bots to use tv guided.

Thats exactly the point - bots are confused by the targetting system where the camera switches to the onboard view ( probably even with a 'postProcessOnGui' ). It can be compared to the torpedo dilemma in BF1942 where we used all kinds of tricks to make the bots fire the PT torpedoes ( or if you remember, the DepthCharges) . When there's no straight line between weapon and target the bots often don't know what to do.

Share this post


Link to post
Share on other sites

Ok everythings cool I got AI to switch between the 20mm and laser guided missile and to reload after every shot if anyone would like to replace the tv guided missile let me know thanks ;)

Edited by BF1942Veteran

Share this post


Link to post
Share on other sites

Ok everythings cool I got AI to switch between the 20mm and laser guided missile and to reload after every shot if anyone would like to replace the tv guided missile let me know thanks ;)

Ok guys can any one help me with the full code to get bots using tv in the ahz?

i cant seem to get it to work

Share this post


Link to post
Share on other sites

bots can't use TV-guided. use a different targeting system. perhaps try wire-guided.

Share this post


Link to post
Share on other sites

bots can't use TV-guided. use a different targeting system. perhaps try wire-guided.

Well thank you but its not sp or coop its multiplayer online, any help there

Share this post


Link to post
Share on other sites

bots are bots. bots can't use TV-guided. use a different targeting system.

Share this post


Link to post
Share on other sites

bots are bots. bots can't use TV-guided. use a different targeting system.

rem *** Weaponory ***

rem * Rockets*

weaponTemplate.create AHE_AH1Z_Rockets

WeaponTemplate.WeaponFire PIAltFire

WeaponTemplate.Weaponactivate PIWeaponselect1

WeaponTemplate.WeaponFire PIFire

weaponTemplate.indirect 0

weaponTemplate.minRange 5.0

weaponTemplate.maxRange 200.0

weaponTemplate.setStrength Infantry 4.0

weaponTemplate.setStrength LightArmour 6.0

weaponTemplate.setStrength HeavyArmour 3.0

weaponTemplate.setStrength NavalArmour 0.0

weaponTemplate.setStrength Helicopter 5.0

weaponTemplate.setStrength Airplane 9.0

WeaponTemplate.WeaponFire PIAltFire

weaponTemplate.fireRate 100

weaponTemplate.allowedDeviation 4.0

weaponTemplate.create AHE_AH1Z_Gun

weaponTemplate.indirect 0

weaponTemplate.minRange 5.0

weaponTemplate.maxRange 200.0

weaponTemplate.setStrength Infantry 10.0

weaponTemplate.setStrength LightArmour 4.0

weaponTemplate.setStrength HeavyArmour 2.0

weaponTemplate.setStrength NavalArmour 0.0

weaponTemplate.setStrength Helicopter 20.0

weaponTemplate.setStrength Airplane 1.0

WeaponTemplate.WeaponFire PIAltFire

weaponTemplate.allowedDeviation 5.0

rem * Laser guided *

weaponTemplate.create RUAIR_SU34Kedge

rem WeaponTemplate.WeaponActivate PIMenuSelect2

rem WeaponTemplate.WeaponActivate PIAltFire

rem WeaponTemplate.WeaponFire PIFire

weaponTemplate.indirect 0

weaponTemplate.minRange 30.0

weaponTemplate.maxRange 500.0

weaponTemplate.setStrength Infantry 0.0

weaponTemplate.setStrength LightArmour 6.0

weaponTemplate.setStrength HeavyArmour 6.0

weaponTemplate.setStrength NavalArmour 3.0

weaponTemplate.setStrength Helicopter 3.0

weaponTemplate.setStrength Airplane 3.0

weaponTemplate.allowedDeviation 15.0

ok ive tryed this but they still dont use the laser can u help me out

Share this post


Link to post
Share on other sites

Ok everythings cool I got AI to switch between the 20mm and laser guided missile and to reload after every shot if anyone would like to replace the tv guided missile let me know thanks ;)/>

can i have the code for that please

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×