Jump to content

AI planes not using specified weapons?


EasyEB

Recommended Posts

I'm having trouble getting AI planes to use specified weapons when scripting.

 

If I load say an AI F-16 with Mavericks and GBU-12s and I specify weapon type "14" (GuidedBomb (LGB + TvGB + SNSGB) and give it an attack command, it still uses the missiles first until it runs out of them.

 

Anyone know why, or if there is a workaround?

Link to comment
Share on other sites

I've not tested myself and probably it's not the same value, but during an event hit handler the value returned by event.weapon:getName() for a gbu12 (if I've noted correctly...) is : 16793344, and I used detection of this value to trigger other thing.

But it's probably not a valid weapon flag I've not tried for an attack task "weaponType".

Link to comment
Share on other sites

  • 2 weeks later...

For exemple :

 

if event.id == world.event.S_EVENT_HIT then

MA_out(' ' .. event.target:getName() .. ' Got Shot by ' .. event.initiator:getName() .. ' with ' .. event.weapon:getName() .. '!', 10)

if event.target:getName() == CoCenter and event.weapon:getName() == 16793344 then

local Target = mist.utils.makeVec3(unitPosition, land.getHeight(unitPosition))

trigger.action.explosion(Target, 10000 )

end

mist.removeEventHandler(BombStaticID)

end

 

It's just something I used for testing and kept noted somewhere - although I'm not 100% sure it was gbu12 that I used. Maybe another one but principle is the same. But is the value valid as weapon flag ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...