mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Merge remote-tracking branch 'remotes/MetalStormGhost/dcs_liberation/f16i-mod-support-v2.2' into f16i-mod-support-v2.2
Added a pydcs extension for the IDF Mods Project F-16I mod version 2.2, utilizing the pylon_injector written for the CJS Superbug mod support. Includes banner by Schmokedpancake. The mod alters the stock F-16C aircraft, which requires a different approach when injecting the mod information to pydcs. The extension changes the F-16C parameters by setattr(F_16C_50, "fuel_max", 2585.48), adds new weapons to the existing pylons and adds five new ones (for example, the mod allows internal ECM equipment in the dorsal spine, freeing the central hardpoint for a fuel tank). The mod also adds additional Vipers: F-16D (both with and without the dorsal spine, GE and P&W engines) and the stock F-16C Block 50 under a different DCS unit ID. Also added a separate mod_payloads directory under resources which can be used when aircraft added by mods use the same "unitType" in the loadout lua files. The loadouts are only loaded if the mod is enabled (uses the existing inject_custom_payloads function). The mod settings are now saved in the Liberation save inside the Faction, so loading the aircraft icons, banners, loadouts etc and the pydcs injection can be re-applied on game load.
This commit is contained in:
7660
pydcs_extensions/f16i_idf/f16i_idf.py
Normal file
7660
pydcs_extensions/f16i_idf/f16i_idf.py
Normal file
File diff suppressed because it is too large
Load Diff
17
pydcs_extensions/pylon_injector.py
Normal file
17
pydcs_extensions/pylon_injector.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from typing import Tuple, Any
|
||||
|
||||
|
||||
def inject_pylon(to_pylon: Any, from_pylon: Any) -> None:
|
||||
"""
|
||||
Inject weapons/ordnance added by mods into the pylons of existing aircraft.
|
||||
This is done to support mods such as the CJS Super Hornet, which modify aircraft
|
||||
that exist in stock DCS. Ornance is injected pydcs aircraft classes via introspection
|
||||
:param to_pylon: The pydcs pylon class of the target aircraft
|
||||
:param from_pylon: The custom pylon class containing tuples with added weapon info
|
||||
:return: None
|
||||
"""
|
||||
for key, value in from_pylon.__dict__.items():
|
||||
if key.startswith("__"):
|
||||
continue
|
||||
if isinstance(value, Tuple):
|
||||
setattr(to_pylon, key, value)
|
||||
Reference in New Issue
Block a user