Hi captains!
I'm writing some scripts in order to make a full-authority autopilot for F-18 in BVR combat. The project consists of an auto controller so the aircraft will fly to anywhere on any given altitude and speed automatically. Using the instructions in Export.lua I realized some demos successfully. It's an awesome aircraft to be guided by the classical cascaded PID controller.
However I did meet some trouble in Lua programming. For example, if I want to lock an arbitrary aircraft, I need to first read the position of the target on my MDI screen, then control my TDC to cover that target and lock it. The second step is easy by using the function GetDevice(arg_device):performClickableAction(button_arg,arg_value) to perform (almost) any action I want, but I don't know how to read the position of the target in first step as well as the TDC. BTW, some instructions in" \Eagle Dynamics\DCS World OpenBeta\Scripts\Export.lua" don't work for F-18(but only work for old LockOn aircraft), ex.
LoGetNavigationInfo() (args - 0,results - 1( table )) -- information about ACS
LoGetSightingSystemInfo() -- sight system info
from which I am supposed to get the info like STT/RWS mode, the xy position of TDC on the screen etc. Without those, the autopilot cannot be "full-auithority". I referred to Helios which is a great tool but the output is a full screen not a precise value of an element.
I found something in "\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Cockpit\Scripts\Multipurpose_Display_Group" which seems like the graph rendering scripts for drawing all those lines and dots in the screen. But maybe it's not a good idea to change the code inside the mode?
The project haven't been open-source yet but it will (if I succeed!!!).