Skip to content

Commit

Permalink
added tools to help debugging the DCS exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
opiopan committed Jul 21, 2024
1 parent 656f924 commit 416f343
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/tools/dcs_mock.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- arg[1]: directory placed the exporter script
-- arg[2]: DCS base directory

package.cpath = arg[2] .. 'bin-mt\\?.dll;' .. package.cpath
package.path = arg[2] .. 'LuaSocket\\?.lua;' .. package.path

log = {}
function log.write(mod, type, msg)
print(mod .. ': ' .. msg)
end

function LoGetSelfData()
return {
Name = 'F-16'
}
end

local socket = require('socket')

fsmapper = {}
fsmapper.basedir = arg[1] .. '..\\'

dofile(arg[1] .. 'fsmapper.lua')

if LuaExportStart then LuaExportStart() end

while true do
if LuaExportBeforeNextFrame then LuaExportBeforeNextFrame() end
socket.sleep(0.1)
if LuaExportAfterNextFrame then LuaExportAfterNextFrame() end
socket.sleep(0.1)
end

if LuaExportStop then LuaExportStop() end
13 changes: 13 additions & 0 deletions src/tools/test_dcs_exporter.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
if "%~1" == "" (
echo ERROR: No DCS path is specified
exit /b 1
)

set tooldir=%~dp0
set luadir=%tooldir%..\..\modules\lua-5.4.6\src\
set exporterdir=%tooldir%..\core\dcs-exporter\
set dcsdir=%~1

REM %luadir%lua.exe %tooldir%dcs_mock.lua %exporterdir% %~1
%dcsdir%\bin-mt\luae.exe %tooldir%dcs_mock.lua %exporterdir% %dcsdir%

0 comments on commit 416f343

Please sign in to comment.