DCS A10 Support?  Topic is solved solved with post #24909

DCS A10 Support?

Postby asticher » Fri 7. Sep 2012, 20:14

Has anyone tryed to read out the Datas from DCS A10?
Or even run the Game with a MotionSim successfully?
I didn´t find a post or profil, about that.

THX,
André
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby sirnoname » Fri 28. Sep 2012, 11:44

Hi there,

if you like support for a game it is very easy.
You have to look at the developer page of the game for informations.
If you have found a SDK (Software development kitt) or plugin source code you have to send me that stuff.
After this you get a plugin and you have to test this plugin. This part have to be done until it works.
If there is no motion telemetry support you may get stage 2 key for the reward of a simulator thread and use the graphic or memory driver.

regards,
SirnoName
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: DCS A10 Support?

Postby leonpo » Fri 2. Nov 2012, 16:23

Hello

I have successfully managed to create DCS P-51D profile.

Currently I am using only pitch and yaw acceleration hovewer pitch and bank works as well.

The motion profile is uploaded as well.

Below is the update part of export.lua:

-- 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()
-- slipball only available on patch 1.1, uncomment this and comment next if 1.1
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.z*1000.0, angle*1000, accel.y*1000.0, accel.x*1000.0, user1, user2, user3, user4, user5, user6, 7)))
--socket.try(c:send(string.format("%.3f %.2f %.2f %.2f %.2f %.2f %.2f %.0f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f \n", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)))
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
Regards

Leon
User avatar
leonpo
 
Posts: 14
Joined: Thu 26. Apr 2012, 21:53
Location: Israel
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby leonpo » Sat 3. Nov 2012, 15:02

Just updated the profile.

Using 3 acceleration values (forces) from LoGetAccelerationUnits():

x: longitudal force, mapped to user1 value in the extractor
y: vertical force minus 1, mapped to user2 value in the extractor
z: later force, mapped to user3 value in the extractor
export.lua snippet:


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
User avatar
leonpo
 
Posts: 14
Joined: Thu 26. Apr 2012, 21:53
Location: Israel
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby leonpo » Fri 16. Nov 2012, 14:25

Short update

After upgrading to 3.0.0.7b, i can not trigger extractor to start sendind data to convertor. There is no button "send data"

Leon
User avatar
leonpo
 
Posts: 14
Joined: Thu 26. Apr 2012, 21:53
Location: Israel
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby leonpo » Fri 16. Nov 2012, 15:05

I think, i have found the problem. DCS is started via launcher.exe and then launcher.exe starts dcs.exe and exits.
The extractor detects that launcher.exe is stopped and also stops the profile. Currently i used a workaround by just defining and launching notepad.exe as the game executable and manually launching the game

Leon
User avatar
leonpo
 
Posts: 14
Joined: Thu 26. Apr 2012, 21:53
Location: Israel
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby sirnoname » Fri 16. Nov 2012, 15:46

A batch file in a command shell would do it.
Executable is cmd exe which will not close after the launcher is closed.

Alternative:
Goto C:\Program Files\X-Sim\Plugin\wizard_scripts
Copy iRacing heuristic.txt to mygame.txt
Open mygame.txt

//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: iRacing startup exchange
games: iRacing
startup_file: iexplore
game_executable: iRacingSim.exe
game_parameter: http://members.iracing.com/membersite


Exchange the http address with your launcher.
Echange game executable with your game executable.
Exchange titles and game: which will be the name in the game list.
Rescan for games, game will be found.

Play game will open the IE which ask you one time to execute the launcher.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: DCS A10 Support?

Postby leonpo » Sat 17. Nov 2012, 10:49

Thank you very much for the reply. I have tried both methods.
Starting DCS via batch does no work, launcher terminate the cmd.exe as well. Even before pause.

I also tried game.txt file as well, however wizard was not detecting the game. So currently i just starting following empty batch file:

ECHO OFF
ECHO Please start DCS
PAUSE

Leon
User avatar
leonpo
 
Posts: 14
Joined: Thu 26. Apr 2012, 21:53
Location: Israel
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby asticher » Thu 27. Dec 2012, 02:53

Oh oh, sorry Leonpo for no response on your posts!
To be honest, i did´nt really expected that someone codes this Profil.
But now i installed your Profil, edit that the export.lua and BANG - IT WORKS!!!
Even with DCS World and Black Hawk, A10C Modules, ...
Great work, thanks very much indeed.
I´m a absolut Beginner in x-sim and try to build a two (later three) Axis 360 Degrees Fly Sim.
Soo i can start now *HAPPY*
Hope i can bother you with some further questions soon :-D

See you,
André
ak JaBoG32 Siddharta
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby Settingz85 » Sun 14. Apr 2013, 19:50

Hi all,
thanks alot for sharing Lua script and help for running DCS. For now i use leonpo´s workaround
"Currently i used a workaround by just defining and launching notepad.exe as the game executable and manually launching the game".
I had some trouble with creating a "X-sim 3 game configuration script". It looks like this:

//////////////////////////////////////////////////////////
// X-Sim 3 game configuration script
//////////////////////////////////////////////////////////

title: DCS World
games: DCS World
startup_file: iexplorer
game_executable: DCS.exe
game_parameter: launcher.exe

I´m sure i missed something, that makes the game not working/detecting. However, the workaround does it so far.

greetings
Settingz85
 
Posts: 13
Images: 6
Joined: Sat 22. Dec 2012, 01:31
Has thanked: 1 time
Been thanked: 1 time

Next

Return to Digital Combat Simulator Series

Who is online

Users browsing this forum: No registered users and 1 guest