The latest DCS works with very simple solutions. A10C, P51, SU33, Huey, they all work 100%. I'm tired so forgive me any mistakes i might make ( 07:00am, going to sleep *..)
1) Browse and open C:\Users\UserName\Saved Games\DCS\Scripts\Export.lua. (Change the "UserName" to whatever your username is inside windows)
(If you don't have Export.lua, make one with notepad. This would be a good time to make a backup of the original Export.lua...)
2) Open Export.lua in notepad or any other text editor and delete Everything inside the Export.lua and paste the following:
-- Data export script for Lock On version 1.2.
-- Copyright (C) 2006, Eagle Dynamics.
-- See
http://www.lua.org for Lua script system info
-- We recommend to use the LuaSocket addon (
http://www.tecgraf.puc-rio.br/luasocket)
-- to use standard network protocols in Lua scripts.
-- LuaSocket 2.0 files (*.dll and *.lua) are supplied in the Scripts/LuaSocket folder
-- and in the installation folder of the Lock On version 1.2.
-- Please, set EnableExportScript = true in the Config/Export/Config.lua file
-- to activate this script!
-- Expand the functionality of following functions for your external application needs.
-- Look into ./Temp/Error.log for this script errors, please.
-- Uncomment if using Vector class from the Config/Export/Vector.lua file
--[[
LUA_PATH = "?;?.lua;./Config/Export/?.lua"
require 'Vector'
-- See the Config/Export/Vector.lua file for Vector class details, please.
--]]
local default_output_file = nil
function LuaExportStart()
-- Works once just before mission start.
-- Make initializations of your files or connections here.
-- For example:
-- 1) File
-- default_output_file = io.open("./Temp/Export.log", "w")
-- 2) Socket
package.path = package.path..";.\\LuaSocket\\?.lua"
package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
socket = require("socket")
host = host or "localhost"
port = port or 8080
c = socket.try(socket.connect(host, port)) -- connect to the listener socket
c:setoption("tcp-nodelay",true) -- set immediate transmission mode
--
-- local version = LoGetVersionInfo() --request current version info (as it showed by Windows Explorer fo DCS.exe properties)
-- if version and default_output_file then
--
-- default_output_file:write("ProductName: "..version.ProductName..'\n')
-- default_output_file:write(string.format("FileVersion: %d.%d.%d.%d\n",
-- version.FileVersion[1],
-- version.FileVersion[2],
-- version.FileVersion[3],
-- version.FileVersion[4]))
-- default_output_file:write(string.format("ProductVersion: %d.%d.%d.%d\n",
-- version.ProductVersion[1],
-- version.ProductVersion[2],
-- version.ProductVersion[3], -- head revision (Continuously growth)
-- version.ProductVersion[4])) -- build number (Continuously growth)
-- end
end
function LuaExportBeforeNextFrame()
-- Works just before every simulation frame.
-- Call Lo*() functions to set data to Lock On here
-- For example:
-- LoSetCommand(3, 0.25) -- rudder 0.25 right
-- LoSetCommand(64) -- increase thrust
end
function LuaExportAfterNextFrame()
-- Works just after every simulation frame.
-- Call Lo*() functions to get data from Lock On here.
-- For example:
-- local t = LoGetModelTime()
-- local name = LoGetPilotName()
-- local altBar = LoGetAltitudeAboveSeaLevel()
-- local altRad = LoGetAltitudeAboveGroundLevel()
-- local pitch, bank, yaw = LoGetADIPitchBankYaw()
-- local engine = LoGetEngineInfo()
-- local HSI = LoGetControlPanel_HSI()
-- Then send data to your file or to your receiving program:
-- 1) File
-- if default_output_file then
-- default_output_file:write(string.format("t = %.2f, name = %s, altBar = %.2f, altRad = %.2f, pitch = %.2f, bank = %.2f, yaw = %.2f\n", t, name, altBar, altRad, 57.3*pitch, 57.3*bank, 57.3*yaw))
-- default_output_file:write(string.format("t = %.2f ,RPM left = %f fuel_internal = %f \n",t,engine.RPM.left,engine.fuel_internal))
-- default_output_file:write(string.format("ADF = %f RMI = %f\n ",57.3*HSI.ADF,57.3*HSI.RMI))
-- end
-- 2) Socket
-- socket.try(c:send(string.format("t = %.2f, name = %s, altBar = %.2f, alrRad = %.2f, pitch = %.2f, bank = %.2f, yaw = %.2f\n", t, name, altRad, altBar, pitch, bank, yaw)))
local t = LoGetModelTime()
local altBar = LoGetAltitudeAboveSeaLevel()
local altRad = LoGetAltitudeAboveGroundLevel()
local pitch, bank, yaw = LoGetADIPitchBankYaw()
local vel = LoGetVerticalVelocity()
-- local angle = LoGetAngleOfAttack()
local angle = 0
local accel = LoGetAccelerationUnits()
local trueairspeed = LoGetTrueAirSpeed()
local slipball = LoGetSlipBallPosition()
local user1 = 1
local user2 = 2
local user3 = 3
local user4 = 4
local user5 = 5
local user6 = 6
if c then
socket.try(c:send(string.format("%.3f %.2f %.2f %.2f %.2f %.2f %.2f %.0f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f \n", t, altRad, altBar, pitch*1000.0, bank*1000.0, yaw*1000.0, accel.x*1000.0, angle*1000, accel.y*1000.0, accel.z*1000.0, accel.x*1000.0, (accel.y-1)*1000.0, accel.z*1000.0, user4, user5, user6, 7)))
end
end
function LuaExportStop()
-- Works once just after mission stop.
-- Close files and/or connections here.
-- 1) File
if default_output_file then
default_output_file:close()
default_output_file = nil
end
-- 2) Socket
socket.try(c:send("quit")) -- to close the listener socket
c:close()
end
-------------------------------- <- don't paste this dashed line! The word "end" should be the last line in the Export.lua -file!
3)Save the Export.lua file and close it.
4)Open Motion Extractor. -> "Add your games/Wizard" on the left. (Blue button)
5)"Open manual and advanced setup" (down there)
6)Locate your game executable manually
7) as described earlier, search "notepad.exe" inside windows folder.
8) "Plugin to use" -> "LockOnPlug" (Yes, this is disturbing as it doesn't say "DCS" but try to live with it..!)
9)"Add this game to the game list in the main dialog"
10 "Quit".
(This workaround has to be done in order to fool the software to start listening for information from DCS.)
11) You should now see a new game option on the left, called "Notepad".
12) On the right select from "Used Game" drop down menu select "Notepad".
13) New window pops up :"Auto Setup. LockonPlug, There is a official game plugin detected for this game exec.... Click YES. and Yes.
14) Switch to Motion Converter app.
15) Left upper corner, select "Profiles"
16) select "Load"
17) select "Virtual_Simforce_GT.rn2". Click Open. Click Accept.
18) Switch back to X-Sim Extractor
19) "Play Game"
20) Notepad opens up. LEAVE IT OPEN!
21) Open DCS single player.
22) Open any mission or quick action whatever.
23) You should be seeing a new separate small window that has LockOn PC CDROM game package picture and a lot of real time data from DCS.
24) In Motion Converter select the "Input setup" tab. You will see from line 21 to 40 "Effekt 21 Game time - > Effekt 40: user value 6 all sorts of data.
Tip: Use DCS in windowed mode so you'll see what does what. For Example, User1, User2 and User 3 are Velocities in X Y and Z axes as described in an earlier post.
Thats it! The rest you should be able to sort out yourself! It's up to you how to setup the axes according to your setup. These instructions let you see DCS outputting data to the virtual Simforce GT -style configuration.
Check this very basic tutorial out:
http://www.youtube.com/watch?v=tMeeV3WWlYEI hope this helped someone! Now to bed...
-Lauri