1. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  2. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  3. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

No Game Output Data DCS 2.5

Discussion in 'Digital Combat Simulators (DCS)' started by JINTEXX, May 31, 2019.

  1. JINTEXX

    JINTEXX New Member

    Joined:
    Apr 12, 2019
    Messages:
    1
    Balance:
    16Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, 6DOF
    Hey XSim Community i hope you all doin well i have received my DOF Reality H3 3DOF Simrig a couple months ago since that i tried getting DCS to work and i hope i will get some Help from you Guys.

    i have the plugin installed via Game Manager and checked the Export file created under J/Steam Games/steamapps/common/DCS World/scripts <-- Export.lua was created

    green flag and blue flag ingame manager while DCS is running
    axis configured as DOF Reality provided
    game interface as DOF Reality provided
    im using the Steam Version of DCS but already tried the Normal Version but the was no Output too

    i hope you guys as professionals can help a noob with his problem

    if there are any Questions or if you need moreInformation to understand my problem just let me know

    Best Wishes Niklas

    PS:(im sry for my bad english im not a native speaker)



    Export.lua down there...
    Code:
    ---------------------------------------------------------------------------------------------------
    -- Export plugin for SimTools V3
    -- Version 1.0
    -- Export start
    ---------------------------------------------------------------------------------------------------
    
    Myfunction =
    
    {
    Start=function(self)
        package.path = package.path..";.\\LuaSocket\\?.lua"
        package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
        socket = require("socket")
    
        my_init = socket.protect(function()
            -- export telemetry to SimTools
            host1 = host1 or "127.0.0.1"
            port1 = port1 or 41230
            c = socket.udp ( )
            c:settimeout ( 0 )
            c:setpeername ( host1, port1 )
    --        c:send ( "Hello Wolrd!" )
    --        c1 = socket.try(socket.connect(host1, port1)) -- connect to the listener socket
    --        c1:setoption("tcp-nodelay",true) -- set immediate transmission mode
    --        c1:settimeout(.01)
        end)
        my_init()
    end,
    
    
    AfterNextFrame=function(self)
    
        local altRad = LoGetAltitudeAboveGroundLevel()
        local pitch, bank, yaw = LoGetADIPitchBankYaw()
        local accel = LoGetAccelerationUnits()
    
    
        -- reduce forces on ground
        -- if altRad < 3 then
        --    accel.x = accel.x * 0.25
        --    accel.y = accel.y * 0.25
        --    accel.z = accel.z * 0.25
        -- end
    
        my_send = socket.protect(function()
            if c then
    --            socket.try(c1:send(string.format("%.3f; %.3f; %.3f; %.3f; %.3f; %.3f;\n", pitch*1000.0, bank*1000.0, yaw*1000.0, accel.x*1000.0, accel.y*1000.0, accel.z*1000.0)))
                socket.try(c:send(string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", pitch, bank, yaw, accel.x, accel.y, accel.z)))
    
                end
        end)
        my_send()
    
    end,
    
    
    Stop=function(self)
        my_close = socket.protect(function()
            if c then
                c:close()
            end
        end)
        my_close()
    end
    }
    
    
    -- =============
    -- Overload
    -- =============
    
    -- Works once just before mission start.
    do
        local PrevLuaExportStart=LuaExportStart
        LuaExportStart=function()
            Myfunction:Start()
            if PrevLuaExportStart then
                PrevLuaExportStart()
            end
        end
    end
    
    -- Works just after every simulation frame.
    do
        local PrevLuaExportAfterNextFrame=LuaExportAfterNextFrame
        LuaExportAfterNextFrame=function()
            Myfunction:AfterNextFrame()
            if PrevLuaExportAfterNextFrame then
                PrevLuaExportAfterNextFrame()
            end
        end
    end
    
    -- Works once just after mission stop.
    do
        local PrevLuaExportStop=LuaExportStop
        LuaExportStop=function()
            Myfunction:Stop()
            if PrevLuaExportStop then
                PrevLuaExportStop()
            end
        end
    end
    

    Attached Files:

  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0