Jump to content

Recommended Posts

Posted (edited)

Hi there, I'm building a custom force feedback device that respond to the IAS (I mostly fly the P51).

Such force feedback mechanism should make the stick more stiff at high speed and a dead stick on taxi. This should give a real feeling of flying the real thing...

 

I found something that works pretty well off-line:

Quote


function LuaExportStart()

    package.path  = package.path..";"..lfs.currentdir().."/LuaSocket/?.lua"
    package.cpath = package.cpath..";"..lfs.currentdir().."/LuaSocket/?.dll"

    socket = require("socket")
    IPAddress = "127.0.0.1"
    Port = 31090

    MySocket = socket.try(socket.connect(IPAddress, Port))
    MySocket:setoption("tcp-nodelay",true) 
end

function LuaExportBeforeNextFrame()
end

function LuaExportAfterNextFrame()

    local IAS = LoGetIndicatedAirSpeed()
    
    socket.try(MySocket:send(string.format("IAS: %.4f \n",IAS)))
end

function LuaExportStop()

    if MySocket then 
        socket.try(MySocket:send("exit"))
        MySocket:close()
    end
end

function LuaExportActivityNextEvent(t)
end

 

 

but as soon I go online in a server it doesn't work

PS: the server has all settings on for enabling export data...

 

am I missing something?

thank you in advance to anyone pointing me to the right direction?

Edited by havebug
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...