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

Re: DCS A10 Support?

Postby mrconsoler » Fri 26. Jul 2013, 08:00

Hi, can somebody write there a step by step guide how to setup this plugin?
mrconsoler
 
Posts: 11
Joined: Fri 26. Jul 2013, 07:46
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support

Postby thunder1991 » Tue 13. Aug 2013, 03:01

Hello All,
Olá a todos.
Sorry, but my english don´t work.

André,
Como você, estou tentando quebrar a cabeça para fazer rodar o X-SIM no DCS World. Acabei de construir uma estrutura toda pronta para um simulador que utilizará 2 situações (baseado no projeto do Florinskes). Corrida e Aviação (DCS World). Não faço a menor idéia de como fazer isso funcionar, não sei nem por onde começar.
Preciso de ajuda urgente (se possível) pois estou com tudo pronto e não consigo fazer o DCS rodar, será que é possível você me ajudar?
Outro detalhe importante é que sou extremamente leigo em relação a programação, se puder fazer um passo a passo eu lhe seria muito grato.

Abraço,

Moraes.
thunder1991
X-Sim Supporter
 
Posts: 14
Joined: Tue 22. Jan 2013, 17:37
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby Bergison » Thu 23. Jan 2014, 23:19

Thanks lenopo for this great script! The accelleration values work perfect for my setup, I have however difficulties getting the engine RPM out of DCS.
This is the part of the Export.lua I try to modify:

Code: Select all
function LuaExportAfterNextFrame()   
   local t = LoGetModelTime()
   local altBar = LoGetAltitudeAboveSeaLevel()
   local altRad = LoGetAltitudeAboveGroundLevel()
   local pitch, bank, yaw = LoGetADIPitchBankYaw()
   local vel = LoGetVerticalVelocity()
   local angle = 0
   local accel = LoGetAccelerationUnits()
   local trueairspeed = LoGetTrueAirSpeed()
   local slipball = LoGetSlipBallPosition()
   local engine = LoGetEngineInfo()
   local user1 = 1
   local user2 = 2
   local user3 = 3
   local user4 = 4
   local user5 = 5
   local user6 = 6

   if x then

    socket.try(x:send(string.format("%.3f %.2f %.2f %.2f %.2f %.2f %.2f %.0f %.2f %.2f %.2f %.2f %.2f %f %f %.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, engine.RPM.left, engine.RPM.right, user6, 7)))

   end

end


Does somebody see what I got wrong with this? THANKS for your help!!!
User avatar
Bergison
 
Posts: 39
Images: 20
Joined: Wed 6. Nov 2013, 20:37
Location: Austria
Has thanked: 0 time
Been thanked: 9 times

Re: DCS A10 Support?

Postby spyderwash » Sat 26. Apr 2014, 17:59

Hi everybody,

I'm trying to make communication between DSC and Lock On. I've found a export.lua file in lockOn folder. Have I to put it in some DSC folder? I've found a lot of LUA files in DSC main folder but not the mentioned Cofing/Export one. Can someone help me? thanks
spyderwash
X-Sim Supporter
 
Posts: 201
Images: 10
Joined: Tue 19. Feb 2013, 19:43
Location: ITALY VARESE
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby spyderwash » Wed 30. Apr 2014, 18:22

but I have to run dcs first lock on or installed are 2 different games? because I can not find the folders in my documents
thanks
spyderwash
X-Sim Supporter
 
Posts: 201
Images: 10
Joined: Tue 19. Feb 2013, 19:43
Location: ITALY VARESE
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby spyderwash » Tue 6. May 2014, 00:48

bump
spyderwash
X-Sim Supporter
 
Posts: 201
Images: 10
Joined: Tue 19. Feb 2013, 19:43
Location: ITALY VARESE
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby laurivs » Mon 12. May 2014, 06:24

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=tMeeV3WWlYE

I hope this helped someone! Now to bed...

-Lauri
laurivs
 
Posts: 46
Joined: Sat 10. May 2014, 18:47
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby spyderwash » Sat 5. Jul 2014, 21:16

thanks, I saw it just now, but in the end I had solved this spiegazioe everything will be simpler
thank you
spyderwash
X-Sim Supporter
 
Posts: 201
Images: 10
Joined: Tue 19. Feb 2013, 19:43
Location: ITALY VARESE
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby Pavlado » Sun 6. Jul 2014, 14:56

leonpo wrote: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


Hi.
Can you please describe in detail what to do if you run the DCS via the uploader, so I always turn off profile in X-sim extractor.
Pavlado
 
Posts: 8
Joined: Sun 30. Mar 2014, 22:59
Has thanked: 0 time
Been thanked: 0 time

Re: DCS A10 Support?

Postby gabry1090 » Sun 6. Jul 2014, 20:16

hi guys, thanks very much for the guide, everything works! But I have a problem with bank value...is it the same as roll? if it isn't how can i find the roll value?
Because if i try to roll the plane once you are upside down the seat throw me in the opposite direction, seams like a problem with negative values! if you try to do the same in IL-2 the simulator behaviour is normal instead! Is there another value to consider for lateral forces? already tried all banks and user 3 values but they don't seem to be ok for roll! please let me know, thanks!
gabry1090
 
Posts: 23
Joined: Wed 23. Oct 2013, 15:09
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Digital Combat Simulator Series

Who is online

Users browsing this forum: No registered users and 1 guest