changed the system to make use of JSON files

This commit is contained in:
David Pierron
2020-10-18 18:23:31 +02:00
parent 373924a959
commit ed92e9afb9
25 changed files with 7305 additions and 417 deletions

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,84 @@
# LUA Plugin system
This plugin system was made for injecting LUA scripts in dcs-liberation missions.
The resources for the plugins are stored in the `resources/plugins` folder ; each plugin has its own folder.
## How does the system work ?
The application first reads the `resources/plugins/plugins.json` file to get a list of plugins to load, in order.
Each entry in this list should correspond to a subfolder of the `resources/plugins` directory, where a `plugin.json` file exists.
This file is the description of the plugin.
### plugin.json
The *base* and *jtacautolase* plugins both are included in the standard dcs-liberation distribution.
You can check their respective `plugin.json` files to understand how they work.
Here's a quick rundown of the file's components :
- `mnemonic` : the short, technical name of the plugin. It's the name of the folder, and the name of the plugin in the application's settings
- `skipUI` : if *true*, this plugin will not appear in the plugins selection user interface. Useful to force a plugin ON or OFF (see the *base* plugin)
- `nameInUI` : the title of the plugin as it will appear in the plugins selection user interface.
- `defaultValue` : the selection value of the plugin, when first installed ; if true, plugin is selected.
- `specificOptions` : a list of specific plugin options
- `nameInUI` : the title of the option as it will appear in the plugins specific options user interface.
- `mnemonic` : the short, technical name of the option. It's the name of the LUA variable passed to the configuration script, and the name of the option in the application's settings
- `defaultValue` : the selection value of the option, when first installed ; if true, option is selected.
- `scriptsWorkOrders` : a list of work orders that can be used to load or disable loading a specific LUA script
- `file` : the name of the LUA file in the plugin folder.
- `mnemonic` : the technical name of the LUA component. The filename may be more precise than needed (e.g. include a version number) ; this is used to load each file only once, and also to disable loading a file
- `disable` : if true, the script will be disabled instead of loaded
- `configurationWorkOrders` : a list of work orders that can be used to load a configuration LUA script (same description as above)
## Standard plugins
### The *base* plugin
The *base* plugin contains the scripts that are going to be injected in every dcs-liberation missions.
It is mandatory.
### The *JTACAutolase* plugin
This plugin replaces the vanilla JTAC functionality in dcs-liberation.
### The *VEAF framework* plugin
When enabled, this plugin will inject and configure the VEAF Framework scripts in the mission.
These scripts add a lot of runtime functionalities :
- spawning of units and groups (and portable TACANs)
- air-to-ground missions
- air-to-air missions
- transport missions
- carrier operations (not Moose)
- tanker move
- weather and ATC
- shelling a zone, lighting it up
- managing assets (tankers, awacs, aircraft carriers) : getting info, state, respawning them if needed
- managing named points (position, info, ATC)
- managing a dynamic radio menu
- managing remote calls to the mission through NIOD (RPC) and SLMOD (LUA sockets)
- managing security (not allowing everyone to do every action)
- define groups templates
You can find the *VEAF Framework* plugin [on GitHub](https://github.com/VEAF/dcs-liberation-veaf-framework/releases)
For more information, please visit the [VEAF Framework documentation site](https://veaf.github.io/VEAF-Mission-Creation-Tools/) (work in progress)
## Custom plugins
The easiest way to create a custom plugin is to copy an existing plugin, and modify the files.
## New settings pages
![New settings pages](0.png "New settings pages")
Custom plugins can be enabled or disabled in the new *LUA Plugins* settings page.
![LUA Plugins settings page](1.png "LUA Plugins settings page")
For plugins which expose specific options (such as "use smoke" for the *JTACAutoLase* plugin), the *LUA Plugins Options* settings page lists these options.
![LUA Plugins Options settings page](2.png "LUA Plugins settings page")

View File

@@ -0,0 +1,22 @@
{
"mnemonic": "base",
"skipUI": true,
"nameInUI": "",
"defaultValue": true,
"specificOptions": [],
"scriptsWorkOrders": [
{
"file": "mist_4_3_74.lua",
"mnemonic": "mist"
},
{
"file": "json.lua",
"mnemonic": "json"
},
{
"file": "dcs_liberation.lua",
"mnemonic": "liberation"
}
],
"configurationWorkOrders": []
}

View File

@@ -1,29 +0,0 @@
# this is a list of lua scripts that will be injected in the mission, in the same order
mist.lua
Moose.lua
CTLD.lua
NIOD.lua
WeatherMark.lua
veaf.lua
dcsUnits.lua
# JTACAutoLase is an empty file, only there to disable loading the official script (already included in CTLD)
JTACAutoLase.lua
veafAssets.lua
veafCarrierOperations.lua
veafCarrierOperations2.lua
veafCasMission.lua
veafCombatMission.lua
veafCombatZone.lua
veafGrass.lua
veafInterpreter.lua
veafMarkers.lua
veafMove.lua
veafNamedPoints.lua
veafRadio.lua
veafRemote.lua
veafSecurity.lua
veafShortcuts.lua
veafSpawn.lua
veafTransportMission.lua
veafUnits.lua
missionConfig.lua

View File

@@ -1,58 +0,0 @@
# LUA Plugin system
This plugin system was made for injecting LUA scripts in dcs-liberation missions.
The resources for the plugins are stored in the `resources/plugins` folder ; each plugin has its own folder.
## Standard plugins
### The *base* plugin
The *base* plugin contains the scripts that are going to be injected in every dcs-liberation missions.
It is mandatory.
### The *JTACAutolase* plugin
This plugin replaces the vanilla JTAC functionality in dcs-liberation.
### The *VEAF framework* plugin
When enabled, this plugin will inject and configure the VEAF Framework scripts in the mission.
These scripts add a lot of runtime functionalities :
- spawning of units and groups (and portable TACANs)
- air-to-ground missions
- air-to-air missions
- transport missions
- carrier operations (not Moose)
- tanker move
- weather and ATC
- shelling a zone, lighting it up
- managing assets (tankers, awacs, aircraft carriers) : getting info, state, respawning them if needed
- managing named points (position, info, ATC)
- managing a dynamic radio menu
- managing remote calls to the mission through NIOD (RPC) and SLMOD (LUA sockets)
- managing security (not allowing everyone to do every action)
- define groups templates
For more information, please visit the [VEAF Framework documentation site](https://veaf.github.io/VEAF-Mission-Creation-Tools/) (work in progress)
## Custom plugins
Custom scripts can also be injected by dropping them in the `resources/plugins/custom` folder, and writing a `__plugins.lst` file listing them in order.
See the `__plugins.lst.sample` file for an example.
## New settings pages
![New settings pages](0.png "New settings pages")
Custom plugins can be enabled or disabled in the new *LUA Plugins* settings page.
![LUA Plugins settings page](1.png "LUA Plugins settings page")
For plugins which expose specific options (such as "use smoke" for the *JTACAutoLase* plugin), the *LUA Plugins Options* settings page lists these options.
![LUA Plugins Options settings page](2.png "LUA Plugins settings page")

View File

@@ -0,0 +1,38 @@
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- configuration file for the JTAC Autolase framework
--
-- This configuration is tailored for a mission generated by DCS Liberation
-- see https://github.com/Khopa/dcs_liberation
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- JTACAutolase plugin - configuration
env.info("DCSLiberation|JTACAutolase plugin - configuration")
if dcsLiberation then
veaf.logTrace("dcsLiberation")
-- specific options
local smoke = false
-- retrieve specific options values
if dcsLiberation.plugins then
veaf.logTrace("dcsLiberation.plugins")
if dcsLiberation.plugins.jtacautolase then
veaf.logTrace("dcsLiberation.plugins.jtacautolase")
veaf.logTrace(string.format("dcsLiberation.plugins.jtacautolase.smoke=%s",veaf.p(dcsLiberation.plugins.jtacautolase.smoke)))
smoke = dcsLiberation.plugins.jtacautolase.smoke
end
end
veaf.logTrace(string.format("smoke=%s",veaf.p(smoke)))
-- actual configuration code
for _, jtac in pairs(dcsLiberation.JTACs) do
if dcsLiberation.JTACAutoLase then
dcsLiberation.JTACAutoLase(jtac.dcsUnit, jtac.code, smoke, 'vehicle')
end
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
{
"mnemonic": "jtacautolase",
"nameInUI": "JTAC Autolase",
"defaultValue": true,
"specificOptions": [
{
"nameInUI": "Use smoke",
"mnemonic": "smoke",
"defaultValue": true
}
],
"scriptsWorkOrders": [
{
"file": "mist_4_3_74.lua",
"mnemonic": "mist"
},
{
"file": "JTACAutoLase.lua",
"mnemonic": "jtacautolase-script"
}
],
"configurationWorkOrders": [
{
"file": "configuration.lua",
"mnemonic": "jtacautolase-config"
}
]
}

View File

@@ -0,0 +1,5 @@
[
"veaf",
"jtacautolase",
"base"
]