Buzzer1977 Posted March 18, 2022 Posted March 18, 2022 Hi, i'm trying to do write a little QRA script. When a enemy aircraft comes too close to a airbase i want to send: - The two closest airborne CAP capable aircraft that have AAM onboard and is not on it's way to RTB. - The closest QRA CAP group that's waiting on the tarmac for a AI_PUSH_TASK. I've got most of the stuff already done, but i'm struggling with the following 3 things: - How to find out if a unit or group is CAP capable? - How to find out if a unit has AAM? - How to find out if a unit is on it's way to RTB? With best regards Buzzer AMD Ryzen 9 5950x, MSI MEG x570 Unify, G.Skill 128GB DDR4-3200, MSI RTX3090 Ventus 3x 24GB, Samsung PCIe 4.0 M.2 1TB 980 Pro, Seagate PCIe 4.0 M.2 2TB FireCuda 520, Quest 3
Grimes Posted March 18, 2022 Posted March 18, 2022 6 hours ago, Buzzer1977 said: - How to find out if a unit or group is CAP capable? Fun fact, with scripting AI don't really care about the task they were given in the editor. If you were using attack unit or search then engage you could give an A-10C a task to go attack Migs if you wanted to. It is more about the weapons and organization of who you want to go attack stuff because you could search for anyone with an air 2 air weapon and get an A-10 for instance. 6 hours ago, Buzzer1977 said: - How to find out if a unit has AAM? Combination of getAmmo and checking the values for category, missileCategory, guidance, and/or type name for each table entry to figure out what type of weapon is there. Basically if the weapon category is 1 and the missile category is 1 then it is an A2A missile. You can further check guidance type or some of the range information to try and further categorize it. 6 hours ago, Buzzer1977 said: - How to find out if a unit is on it's way to RTB? You can't. Best you can do is know the approximate rules for it and try to manage it yourself. What I mean is to not rely on the built in systems that make AI RTB, instead keep track of their status and order them to RTB, therefore you know what is and isn't available to use for tasking. Suppose you could check weapons, fuel, and even location to guess if that unit is RTB. They are also unresponsive to tasking at that point so if they don't change that they are doing then it is safe to say they are RTB. 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts