Buzzer1977 Posted October 13, 2023 Posted October 13, 2023 Is there a function to check aircraft type compatibility with a airfield? I'm trying to dynamically generate a mission and therefore need to verify if a aircraft type can start, land, park, rearm and refuel at a given airfield. Is there such a function or how can i implement this (f.e. check runway length, parking type, etc ...) ? 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
cfrag Posted October 13, 2023 Posted October 13, 2023 3 hours ago, Buzzer1977 said: Is there a function to check aircraft type compatibility with a airfield? In general terms, all aircraft are compatible with all airfields, so we need to be more specific. Now, to smart-ass off the bat: all aircraft can land anywhere. If they can survive the landing, however, that depends on a multitude of factors, so I'm guessing that you are interested in the factors that significantly enhance survivability of an aircraft for a particular airfield. For example, the Normandy maps are replete with airfields that modern jets can land only once on, and then usually not survive. So what makes a landing survivable? Air speed at landing (which usually is a function of weight, and wing profile, plus winds), runway length and runway strength (can it carry the weight). And, above all, of course, there's the pilot's skill. A good pilot can land a plane that they are intimately familiar with on airfields that they are equally familiar with much more successful than a neophyte at their first attempt at that airfield. So let's reduce all this variability to runway length (and assume infinite surface strength). If you know an aircraft type's average landing and take-off distance, you could pick an airfield by the available runways, and I think that is what you are mainly after. And let's discount all helicopters and Farps immediately, as - unless you are flying the Harrier - they are straight out for fixed-wings, and we'll focus on fixed wings. So, DCS's scripting environment contains the Airbase class, which allows you to access all runways, and part of that description is each runway's length and width. That would be your main source to choose the best, and coupled with an airfield's x and z coordinate's the closest airfield that matches your runway len/wid requirements. 4 hours ago, Buzzer1977 said: verify if a aircraft type can start, All aircraft can start on all airfields. If there are enemy troops there (or if the airfield belongs to an enemy faction) that will not prevent you from trying a start-up sequence. If you are able to survive it, may be another matter. If your type requires services like air or electricity and the airfield does not belong to your faction, you may have additional challenges. But inherently, all aircraft can start on all airfields, even FARPS (I've built a couple of missions where you start your plane on a simulated (FARP-based) make-shift airfield and then take off using a road. So, if you are determining if an airfield will be friendly to you, invoke getCoalition() to see if it matches the unit's 4 hours ago, Buzzer1977 said: park Like staring, parking is not the issue. The enemy running around on the field may be making that a bad idea, but nothing will stop you from trying to park. Simply pick a spot that suits you. But maybe you are wondering if an airfield has a sufficiently sized shelter for your aircraft. This presupposes that you know the size that your type requires. Currently we have getParking() which will return some parking information for an airfield. Be advised that (at least in Caucasus) the returned information will not always match the information that you see on the map. Regard it as an additional challenge to spice up your mission design everyday tasks. 4 hours ago, Buzzer1977 said: rearm and refuel That is usually a matter of which supplies are available at the airfield (and which faction it belongs to). DCS is about to make a significant leap wrt this functionality with warehouses; FARPS usually require some specific vehicles being present to provide rearm and refuel services. To simplify matters, simply assume that airfields have unlimited supplies, but must belong to your faction. 4 hours ago, Buzzer1977 said: how can i implement this Build a table that stores the minimum runway length for your types. I'm afraid you'll have to roll your own here. Most pilots find that information in the Owner's Manual, you'll probably have to collect that from the web and perform some trial and error. All helicopters and the Harrier have a 0 minimum runway (but require dumping cargo/fuel to perform safely) Get the type that you are currently flying (not an easy task, but doable, even in multiplayer. In MP, you will probably want to use the communications callback to implement this), and then, using the type find the minimum landing/take-off roll. Query all airfields, and pick the closest one that matches all criteria is friendly to you (matches your coalition) has a sufficiently long runway has a matching parking slot (not really required, but you asked) has sufficient stores in the warehouse (only if your mission supports limited storage) If you can do that, you'd be 90% of the way of doing what you are looking for. 1
Recommended Posts