Updated Modded Aircraft Support (markdown)

Dan Albert 2022-02-18 13:10:12 -08:00
parent 4e79fa372a
commit a1816d76a6

@ -1,11 +1,12 @@
`Hey, can you add support for <insert mod name here> ?`
> Hey, can you add support for <insert mod name here>?
Well, we could, but...
Well, we could, but ....
It takes a lot of time to add support for a mod in Liberation. We prefer using the free time we can allocate to Liberation to develop features that will benefit the whole community of Liberation users.
`I'm willing to support the mod in liberation myself !`
> I'm willing to support the mod in liberation myself!
Here is how to do it :
Here is how to do it:
## Pre-requisites:
@ -14,7 +15,7 @@ Here is how to do it :
* Basic Lua programming knowledge
* A DCS World open beta installation
## Step 1 : Pydcs extensions injection :
## Step 1: Pydcs extensions injection:
Adding support for a modded aircraft is much more complicated than adding its name in a faction file.
@ -58,18 +59,15 @@ As you can see, extensions for mods are stored in this folder : https://github.c
These file contains a lot of metadata we need to be able to generate missions, such as possible liveries, possible payloads for each pylons, specific weapons ids ... and so on.
## Step 2 : Pydcs extensions injection :
## Step 2: Pydcs extensions injection:
Once you've created your extension, you need to inject it's content into the pydcs version run by Liberation. This is done at runtime in db.py.
If your modded content is a plane, you need to inject it to pydcs plane_map, in the file [db.py](https://github.com/dcs-liberation/dcs_liberation/blob/develop/game/db.py)
Once you've created your extension, you need to inject it's content into the pydcs version run by Liberation. In the Python file you created for the mod, decorate each unit type with either `@planemod`, `@vehiclemod`, or `@helicoptermod`. For example:
```python
plane_map["A-4E-C"] = A_4E_C
plane_map["F-22A"] = F_22A
plane_map["MB-339PAN"] = MB_339PAN
[...]
@planemod
class A_4E_C(PlaneType):
...
```
If this is a vehicle, add it to vehicle_map instead.
@ -160,7 +158,7 @@ CAP_CAPABLE = [
]
```
## Step 4 : Create default payload and inject custom weapons
## Step 4: Create default payload and inject custom weapons
See [Custom Loadouts](Custom-Loadouts)
Create default loadouts for the new plane.
@ -171,29 +169,29 @@ Any custom weapons with the mod should be included in the same file as the pytho
and the following line after the weapons definition class:
`inject_weapons(CustomWeaponsClass)` where `CustomWeaponsClass` is the name of the weapons class you created. For the A4EC listed above, that name is `WeaponsA4EC`.
## Step 5 : Factions
## Step 5: Factions
See [Custom Factions](Custom-Factions) and create a faction that support the mods so it can be used
See [Custom Factions](Custom-Factions) and add the mods to the appropriate factions. If there are no appropriate factions, create a new one, but you don't need to worry about breaking existing factions by "requiring" the mod; Liberation will filter out mods that the player doesn't use.
## Step 6 : Resource files for aircraft
## Step 6: Resource files for aircraft
Add new yaml files for your aircraft in resources/units/aircraft/
See [A-4E-C.yaml](https://github.com/dcs-liberation/dcs_liberation/blob/develop/resources/units/aircraft/A-4E-C.yaml) for reference.
## Step 7 : Add icons for the UI [Optional]
## Step 7: Add icons for the UI (Optional)
Add icons for the new plane there: https://github.com/dcs-liberation/dcs_liberation/tree/develop/resources/ui/units/aircrafts/icons
And a banner, there: https://github.com/dcs-liberation/dcs_liberation/tree/develop/resources/ui/units/aircrafts/banners
## Step 8 : Playtest !
## Step 8: Playtest
Play a few missions with the plane, test as much cases as you can.
## Step 9 : Release !
## Step 9: Release
## Step 10 : Maintenance !
## Step 10: Maintenance
Redo the data export thing (Step 1), every time said mod is updated, if needed create new loadouts and account for new capabilities in db.