Jump to content

Set AI Wingman to attack naval target


Bunny Clark

Recommended Posts

Alright, I'm building a mission where a pair of Hornets need to attack armed speedboats with Mavericks. One of them is the player, so that's fine, but I'm trying to get the AI wingman to actually be of any use.

 

Ordering him to "attack ground targets" results in him telling me he can't do that.

 

I tried setting the waypoint to attack the ships, but that's not an option.

 

I tried making a search and engage area, set to naval units, but when I order him to engage mission targets he says "roger" and then flies the waypoints without attacking the targets he flies over at all.

 

How can I get him to actually shoot at the ships?

Link to comment
Share on other sites

Set the hornet group task/role to Anti-ship Strike or CAS, your wingman should engage the speedboats automatically.

 

 

However, if you want your wingman to start the attack run at a specific moment, you can do the following:

 

- Set the hornet group task/role to something that ignores ground/sea targets, like CAP, Reconnaissance, etc. , this way your wingman won't engage out of turn.

 

- Run the following script at the appropriate moment using a DO SCRIPT trigger (required fields marked in red. Don't remove the quotation marks!):

 

 local Boat_Killer = Unit.getByName("[color="red"][i][u]Unit name[/u] of the hornet [u]wingman[/u] in ME[/i][/color]")
local Boat_Group = Group.getByName("[color="Red"][i][u]Group name[/u] of the speedboat group in ME[/i][/color]")

local Engage_Boats = { 
   id = 'AttackGroup', 
   params = { 
     groupId = Boat_Group:getID(),
     weaponType = 2956984318,
     expend = "One",
     attackQtyLimit = true,
     attackQty = 1,
    } 
   }
  
 Boat_Killer:getController():setTask(Engage_Boats)

 

- Don't equip the hornet wingman with AGM-65F mavs, the AI doesn't seem to fire them at speedboats. Use AGM-65E mavs instead.


Edited by Hardcard
Link to comment
Share on other sites

Hi Habu

 

weaponType is an internal weapon enumerator that the DCS API uses to select weapons for tasking.

 

It's explained here

 

In this case, I decided to use a combo enumerator, which includes any AG weapons (laser mavs are included in the ASM group):

2956984318 = AnyAGWeapon (BuiltInCannon + GUN_POD + AnyBomb + AnyRocket + AnyASM)

[color="Blue"]-- I could've used the following enumerator as well:[/color]

3221225470 = AnyWeapon (AnyBomb + AnyRocket + AnyMissile + Cannons) 

 

I've recently learned that, when dealing with tasks, the DCS API doesn't use the "typical" weapon type values that can be obtained using methods like Object:getTypeName()

 

Instead, it uses weird internal enumerators, which are basically numbers... problem is that those enumerators don't seem to be accessible via known scripting methods (at least the ones I know)

 

 

Fortunately, I found an alternative way to reveal these "hidden" enumerators (other than checking the enumerator list from the Hoggit Wiki, that is :D):

 

1- Program the task(s) using ME alone (set all the task options to the values you want to know the enumerators for)

 

2- Save the mission

 

3- Open the .miz file using winzip / winrar / 7zip, etc.

 

4- Grab the unformatted file named "mission" and extract it

 

5- Turn it into a lua file

 

6- Open it with your lua editor

 

7- Find the task identifier, all the relevant internal enumerators should be there, indexed in the task table


Edited by Hardcard
Link to comment
Share on other sites

Thanks @Harcard, nice work!

[sIGPIC][/sIGPIC]

Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz   3.70 GHz ROG STRIX Z490-E GAMING
RAM 128 M.2*2 2T total SSD*3 2.5T total
GeForce RTX 3090   Orion2 HOTAS F-16EX  Saitek Pro Rudder

Link to comment
Share on other sites

- Don't equip the hornet wingman with AGM-65F mavs, the AI doesn't seem to fire them at speedboats. Use AGM-65E mavs instead.

 

This seems to be the crux of the issue I'm having, since I've managed to get him to make gun runs on the boats, but never fire his IR Mavs.

 

Wouldn't I need some way to laser designate the boats for the AGM-65Es? Or can the AI guide them with magic?

Link to comment
Share on other sites

@Colmillo

@Habu_69

 

You're welcome, guys.

 

 

Hey, Colmillo... can you send me your rig as thanks? (kind of jealous over here ;) )

 

 

Btw, I'm no master (by any stretch), just a newbie who learns stuff and shares it it with others :thumbup:

 

hahahaha

No problem!!, just wait.. till Bitcoin reach USD150.000

[sIGPIC][/sIGPIC]

Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz   3.70 GHz ROG STRIX Z490-E GAMING
RAM 128 M.2*2 2T total SSD*3 2.5T total
GeForce RTX 3090   Orion2 HOTAS F-16EX  Saitek Pro Rudder

Link to comment
Share on other sites

I assumed the hornets were equipped with their own laser pointer (ok, they need the AN/AAS-38 "Nitehawk" pod for that).

 

But, hey, you can always add a predator drone to the mission and have it lase the boats on command.

 

Can AI Hornets equip pods that human controlled planes can't use? As far as I know Hornets can't lase anything for themselves yet until some targeting pods get released later in early access.

 

There's already a Predator in the mission, making it lase for the wingman may not be too hard? At the very least, it's another thing for me to learn how to do!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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