Jump to content

Tasking AI to attack a specific coordinate - how to?


Recommended Posts

Posted

What I want to archive:

The player designates a target by using the available targetting system (Shkval, TGP) and give the coordinates to an AI unit as coordinate for an attack.

Example: I target a tank with my Shkval. Then I call in the AI via comms F10 menu. The AI is an F-16 which drops a JDAM at the coordinates my Shkval is looking at - and kills the tank.

Or: I target a group of artillery pieces with my TAD. Then I call in the AI via comms F10 menu. The AI is a group of artillery units some clicks away which starts to fire a barrage at about the point where my TAD is looking at.

 

Tasking the AI to attack a coordinate should be easy by some lua scripting. But how do I get access to the Shkval or TAD? If that is all impossible, maybe I could let the player create a mark point or target point - could I access those via scripting?

Posted

The only access to where the TAD, Shkval, TGP are looking is with the export lua environment I think, not the mission scripting lua environment.

 

Smoke rockets (ie weapons) would be the most efficient way to accomplish the same sort of thing with just the scripting engine. Track where it hits and assign AI to target that location.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

I don't have code for that lying around. But I'd do it like the following:

 

You need to use an event handler to track whenever rockets are fired and send that data to a function to track the rockets last known position. You then use the last coordinate of the known position (where it impacted), with another function to create the tasking for AI using whichever task you want (http://wiki.hoggit.us/view/Part_2#Main_Tasks) and then assign the task to the group you want.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

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