Created Modded Aircraft Support (markdown)

C. Perreau
2021-03-30 18:51:50 +02:00
parent a733da54bb
commit a8cebb0842

@@ -0,0 +1,71 @@
`Hey, can you add support for <insert mod name here> ?`
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 !`
Here is how to do it :
## Step 1 : Pydcs extensions injection :
Adding support for a modded aircraft is much more complicated than adding its name in a faction file.
In order for a modded aircraft to work with Liberation, we need to generate a data export for it to work with [pydcs](https://github.com/pydcs/dcs)
Pydcs is the library we use to generate the .miz files, it is awesome, but it is not magical and can't support modded content natively if we don't tell it how do to do it. Its database also need to be updated every time DCS is updated.
Updating pydcs database is done by adding a script to DCS World to be executed on the game startup to export some aircraft data.
See the script here : https://github.com/pydcs/dcs/blob/master/tools/pydcs_export.lua;
Copy this script on your computer and do what is explained in the comments :
``` lua
-- execute(dofile) this script at the end of
-- of 'DCS World\MissionEditor\modules\me_mission.lua'
-- base.dofile("C:\\Users\\peint\\Documents\\dcs\\tools\\pydcs_export.lua")
```
Modify the first line "export_path" so it match an existing folder on your computer :
```lua
local export_path = "D:\\Work\\DCS\\dcs\\dcs\\"
```
Running this script generate most of pydcs data in the target folder when launching DCS.
If DCS stops loading at 10%, it's normal. If it doesn't start at all after 5 minutes and stay blocked at 10%, there might be an error in the script, so check ```<DCS World Save directory>/dcs.log``` for clues.
If you run it with mods installed, it generates a version of pydcs with support for the currently installed mods.
> As pydcs does not have the ambition of supporting every existing mods, we do not push modded content to the official pydcs version, which only supports vanilla DCS.
So to add support for modded aircrafts in liberation, we then have to manually extract the new aircraft from the generated modded pydcs version, and create an extension (which is added to liberation code)
Example for the popular A-4E-C mod : https://github.com/Khopa/dcs_liberation/blob/develop/pydcs_extensions/a4ec/a4ec.py
As you can see, extensions for mods are stored in this folder : https://github.com/Khopa/dcs_liberation/blob/develop/pydcs_extensions
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 :
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.
[WIP]
## Step 3 : Liberation flight planner database setup :
## Step 4 : Create default payload
## Step 5 : Create a faction that support the mods so it can be used
## Step 6 : Add icons for the UI
## Step 7 : Playtest !
Redo the data export thing (Step 1), every time said mod is updated