Pikey Posted August 22, 2023 Posted August 22, 2023 In the middle of the news about warehouses, these new API functions quietly tiptoed in the back door with 2.8.8.43489. This probably deserves more publicity, its not every day year we get new API functions. https://wiki.hoggitworld.com/view/DCS_func_autoCapture https://wiki.hoggitworld.com/view/DCS_func_autoCaptureIsOn https://wiki.hoggitworld.com/view/DCS_func_setCoalition Sample code: local Airbases = world.getAirbases() for i=1, #(Airbases) do Airbases[i]:autoCapture(false) end for i=1, #(Airbases) do Airbases[i]:setCoalition(1) end for i=1, #(Airbases) do local coa = Airbases[i]:getCoalition() if coa == 0 then env.info(Airbases[i]:getName() .. " is neutral.") elseif coa==1 then env.info(Airbases[i]:getName() .. " is red.") elseif coa==2 then env.info(Airbases[i]:getName() .. " is blue.") elseif coa==3 then env.info(Airbases[i]:getName() .. " is contested." ) end end This turns off autocapture, set all airfields red and prints out the result in the dcs.log. So the point of these new functions are that mission developers are no longer dependant on the existing DCS inbuilt function which determines the coalition owner of an airbase by a set of rules. What are the current system rules? By default, an airbase will revert to its Mission editor defined coalition if there are no units of a different coalition within the 2 kilometre radius (1.08NM) of an airbase center. The API funciton getCoalition() will return the result "3" if there are both coalitions in the 2km radius and on the F10 map, the coalition will show a blank. Statics can also challenge the airbase coalition, oddly, but planes and ships have no effect. i.e a blue static in a red airbase, unchallenged makes the airbase Blue. Until it is destroyed then it releases the airbase back to red. If a coalition remains unopposed in the 2km radius, including statics, but not including planes/ships, then the airbase changes the owning coalition to the presently inhabiting coalition. Players and AI can spawn at the wrong coalition airbase without issue, if the designer has set that to happen, either via scripting, or slots or Late Activation. ATC and rearming stops when the coalition is not the same as the players aircraft. AI planes without an airbase that RTB's will not pick an airbase of a different coalition. These rules have formed the basis of how we've played with DCS base capture since the game began and has been used as the basis of games by pioneers like BlueFlag. What is the new variation using the API? autoCapture() switches off the above system and the map does nothing. setCoalition() allows the Mission designer to force the airbase to adopt a new owner coalition. autoCaptureIsOn() returns the setting per airbase, if autocapture is on, allowing different rules per airbase. What benefit is available to the Mission Designer? Without the forced rules, Designers can use any system logic whatsoever to change the owning coalition to one that suits their design. Some examples (food for thought) include (and are not limited to): Not flipping the airbase owner until a specific threshold of units, time or type are met (maybe type, to prevent your single infantryman changing the map, or quantity, or the passage of time or the presence of specific units like ammo trucks, fuel, ammo etc.) Not flipping the airbase owner until something has been destroyed elsewhere, or certain zones or towns around are occupied. Increasing or decreasing or moving the airbase capture zone, or linking them to a MOOSE class. Using balancing mechanics like CTF rules. Specifically discounting infantry and statics, but including ships, or just adding planes, for example, to allow players to land and self-capture. Locking base capture down to specific player transport vehicles to emphaise those logistics guys Buying it via a menu item. Linking an empty warehouse to setCoalition() in order to force the coalition to Neutral and prevent services if the airbase is empty/neutral. Link capturing to warehousing so that warehouse contents are destroyed on capture Because access to airbase facilities and slots is often (not always) a driving factor in current DCS multiplayer meta play, having control over how a base flips coalition can now require more gameplay hoops to jump through, opening up more diverse gameplay possibilities. It certainly opens up campaign play to become a little deeper, rather than a single infantryman that is difficult to find. My own hope is that with C-130 and CH-47D on the SA page, a new meta can emmerge where logistics becomes pivotal to enabling the virtual fighter pilot gameplay and thus the two can need each other for escorting missiles to forward airbases that now need supplies. 4 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Pikey Posted August 22, 2023 Author Posted August 22, 2023 Addendum 1 - Quote ... if there are no units of a different coalition within the 2 kilometre radius ... Neutral units can't capture iirc, so that should be `if there are no units of a different, non-neutral, coalition within the 2 kilometre radius` 1 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
[HOUNDS] CptTrips Posted August 22, 2023 Posted August 22, 2023 7 minutes ago, Pikey said: Addendum 1 - Neutral units can't capture iirc, so that should be `if there are no units of a different, non-neutral, coalition within the 2 kilometre radius` That's interesting stuff. It has to be armed ground units, right? I don't think trucks will capture. I could be wrong.
Pikey Posted August 24, 2023 Author Posted August 24, 2023 Any unit, any static. A house static you spawn in a neutral airbase 2km zone will capture it. A portable tacan or an RAF firetruck will capture a red airbase and turn it blue null ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
[HOUNDS] CptTrips Posted August 24, 2023 Posted August 24, 2023 6 hours ago, Pikey said: Any unit, any static. A house static you spawn in a neutral airbase 2km zone will capture it. A portable tacan or an RAF firetruck will capture a red airbase and turn it blue null I stand corrected. I thought I had seen that, but now I remember showing a base could be captured with a static orca whale object.
Recommended Posts