Well after searching, it looks like there's no real SDK into DCS, one of the only two ways (apart things other already build and I've not already seen yet), seems to go LUA using the available API from the DCS root folder "DCS World/API/"
Other than this there's a Visual Studio C++ Dynamic Library sample called ED_FM_Template which can be used to go further
Code: Select all
========================================================================
DYNAMIC LINK LIBRARY : ED_FM_Template Project Overview
========================================================================
AppWizard has created this ED_FM_Template DLL for you.
This file contains a summary of what you will find in each of the files that
make up your ED_FM_Template application.
ED_FM_Template.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
ED_FM_Template.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
ED_FM_Template.cpp
This is the main DLL source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named ED_FM_Template.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
https://github.com/bjanders/dcs-api
https://www.digitalcombatsimulator.com/ ... ng_engine/
https://forum.dcs.world/topic/193666-sd ... -everyone/
https://forum.dcs.world/topic/316716-sd ... nt-5126114
https://forum.dcs.world/search/?q=sdk&quick=1
https://forum.dcs.world/forum/218-how-to/
Here's from "DCS World/API/DCS_ControlAPI.html"
Code: Select all
DCS Simulation Control User Scripts
The behaviour of the DCS can be altered using the Lua scripts. You define the hooks to the DCS events, and then do what you want using the provided API.
When loading, DCS searches for Saved Games\DCS\Scripts\Hooks\*.lua files, sorts them by name and then loads into the GUI Lua-state. Each user script is loaded into an isolated environment, so the only thing they share is the state of the simulator.
Each script defines a set of callbacks to the DCS events and sets them with the call DCS.setUserCallbacks(cb_table) For each callback type the hooks of all user scripts will be called in order of loading.
For callbacks which are supposed to return a value, currently there are 3 of them:
onPlayerTryConnect
onPlayerTrySendChat
onPlayerTryChangeSlot
returning a value means breaking the hook call chain. Returning nothing (or nil) means continuing the hook chain, which ends with the default allow-all handlers.
The example user script 'Hooks/test.lua':
local test = {}
function test.onPlayerTryConnect(ipaddr, name, ucid, playerID)
print('onPlayerTryConnect(%s, %s, %s, %d)', ipaddr, name, ucid, playerID)
-- if you want to gently intercept the call, allowing other user scripts to get it,
-- you better return nothing here
return true -- allow the player to connect
end
function test.onSimulationStart()
print('Current mission is '..DCS.getMissionName())
end
DCS.setUserCallbacks(test) -- here we set our callbacks
The available API is documented below. The full list of the callbacks is at the end of this document.
In addition, all standard lua 5.1 libraries are available as well, namely:
base api, like print, etc,
math.*
table.*
string.*
io.*
os.*
debug.*