Jump to content
The simFlight Network Forums

dazz

Members
  • Content Count

    100
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dazz

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yeah, silly me. I haven't fired up my sim in ages and since all my assignments are in Lua - Linda, I just opened my NGX script and searched for "taxi" without even thinking. That parameter probably came from flipping switches in the cockpit while tracing control changes. Thanks for the clarifications
  2. try this Ron: ipc.control(69749, 536870912)
  3. Does that apply to loading, I don't know, the 900, then another NGX variant like the 800WL or 700 or whatever?
  4. I use the path of the AIR file. function loadFunct() acPath = ipc.readSTR(0x3C00, 256) if (string.find(acPath, "00NGX") == null) then ... end end event.sim(FLIGHTLOAD, "loadFunct") [/CODE]
  5. I'm testing with Fs2Crew after reloading the flight and it seems to be very wrong. Plenty of "are you sure about that" when the items are clearly correct, like anti-collision lights on, and I can't contact ground crew either, so yeah
  6. Damn it! , it's also happening to me and I thought it was something in my code. I can force to restart my dll in the middle of a flight, but if I load a different flight it stops working
  7. Project released, in case someone wants to check it out http://forum.avsim.net/topic/368674-a-little-project-of-mine-for-simpit-builders-ngxsdk2lua/
  8. Roger that. And please Pete, don't let the FSUIPC4.dll crash steal too much of your time. It really takes a bunch of restarts to crash the sim.
  9. Here's the log in the event viewer with version 4.812f Exception code: 0xc0000005 Fault offset: 0x0004f590 Faulting process id: 0x1bbc Faulting application start time: 0x01cd119264c5fc9a Faulting application path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\fsx.exe Faulting module path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.dll And I tried the event.terminate thing (this is the script I use to start & restart the dll, calling it from ipcReady with ipc.runlua, so that it runs in it's own thread): require "ngxSDK2Lua" function restartNGXSDK2Lua() acName = ipc.readSTR(0x3D00, 100) if (string.find(acName, "NGX") == null) then return end resp = ngxSDK2Lua.start(); if (resp ~= nil) then ipc.log(resp) end end function kill() ipc.log("Killing ngxSDK2Lua ...............") resp = ngxSDK2Lua.kill(); if (resp ~= nil) then ipc.log(resp) end end event.offset(0x3D00, "STR" , "restartNGXSDK2Lua") event.terminate("kill") [/CODE] ...but I don't see the "Killing ngxSDK2Lua ..............." trace printed in the log, not sure it's working
  10. Ok, I'll try that version of FSUIPC. It's a very rare occurrence really so it doesn't worry me much. I need to keep restarting the dll over and over again to trigger the error, so it's not that big of a deal I think. As for the event.terminate part, I'll try that, but I'm not creating a new thread in the dll in the end. It was crashing like mad when I tried it and couldn't figure out why, but will see if event.terminate helps Thanks for the suggestions
  11. Pete maybe you can give me some guidelines on how to proceed to debug this: When I restart the dll in the middle of a flight, I can do it in two ways: 1.- Call the Lua script that starts the dll. It calls a function in the dll that starts the SimConnect communication. When I do that the previous instance seems to vanish on it's own, and the new one starts just fine. Problem is that after a number of restarts I get a CTD in FSUIPC4.dll (different fault offsets, here's two examples): Exception code: 0xc0000005 Fault offset: 0x0004afc2 Faulting process id: 0x1944 Faulting application start time: 0x01cd118cc82d9b4b Faulting application path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\fsx.exe Faulting module path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.dll Exception code: 0xc0000005 Fault offset: 0x0004dbaa Faulting process id: 0x1ab4 Faulting application start time: 0x01cd118f381ebe6b Faulting application path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\fsx.exe Faulting module path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.dll 2.- If I do a Lua KillAll I get an instant CTD in ntdll.dll: Exception code: 0xc0000029 Fault offset: 0x000907b6 Faulting process id: 0xc84 Faulting application start time: 0x01cd118ba3ba321e Faulting application path: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\fsx.exe Faulting module path: C:\Windows\SysWOW64\ntdll.dll what tools can I use to figure out where the problem is please?
  12. There's a note in my Readme warning about that, and advising to check your forums here for possible news before doing anything with my dll. I still think this could end up being a useful Lua script installer, even if it doesn't use my dll at all.
  13. Damn, it's true!, it's not what I said. I'm trying with a release version of the dll with some traces in the log and the loop is running in the new thread. It's doing some weird things but it's running for sure and the creator thread is back to running the Lua script that launched the dll. The module runs but every now and then, randomly, a call to Lua fails (this is the FSUIPC log, where I print what comes from the dll. Every log line is a switch/knob I clicked): IRS_DisplaySelector: 1 IRS_SysDisplay_R: 0 IRS_DisplaySelector: 2 IRS_DisplaySelector: 3 IRS_DisplaySelector: 4 IRS_DisplaySelector: 3 IRS_DisplaySelector: 2 IRS_DisplaySelector: 1 [E] *** LUA Error: ...ht Simulator X\modules\linda/system/handlers-mcp.lua:168: attempt to perform arithmetic on a nil value IRS_DisplaySelector: 0 IRS_DisplaySelector: 1 IRS_DisplaySelector: 2 IRS_DisplaySelector: 1 IRS_DisplaySelector: 2 [E] *** LUA Error: (null) IRS_DisplaySelector: 1 IRS_DisplaySelector: 2 [E] *** LUA Error: attempt to call a number value [/CODE] ...and finally crashes: Unhandled exception at 0x773015ee in fsx.exe: 0xC0000005: Access violation reading location 0x56085da3. I'll see what I can do. By the way, I'm doing this thing modular, so one will only need to drop a script in a folder and the dll will do the rest, and if you add a supported panel in the future, you just add the script (or run the installer again) and off you go. I plan on including some module(s) with the installer ready to use, maybe some GoFlight & Opencockpits panels
  14. It doesn't even get to the loop. The child dies because the parent dies (the function above returns). When the function extern "C" __declspec(dllexport) int luaopen_ngxSDK2Lua(lua_State *L) [/CODE] exits, the thread that created the child that runs the SimConnect part (startThread above) dies, and with it dies the "startThread" child. So the timeline would be like... Lua: require "ngxSDK2Lua" dll: extern "C" __declspec(dllexport) int luaopen_ngxSDK2Lua(lua_State *L) dll: spawns the "initCommunication" thread that should start the SimConnect part dll: the function luaopen_ngxSDK2Lua exits, execution back to Lua. Parent thread dies dll: child thread dies at some point while configuring SimConnect because the parent just died, FSX crashes to desktop. I would need some sort of Linux "fork" like function maybe? not sure, but I've reverted back to the old version with an init Lua script that I'll start with ipc.runlua so that the SimConnect stuff runs on it's own thread.
  15. One question please. I'm trying to spawn a thread to run the communication with the NGX void startThread() { initCommunication(); } extern "C" __declspec(dllexport) int luaopen_ngxSDK2Lua(lua_State *L){ // register Lua functions static const luaL_Reg functs [] = { {"registerOffsetMap", cpp_registerOffsetMap}, {"registerLuaFile", cpp_registerLuaFile}, ... {NULL,NULL} }; luaL_register(L,"ngxSDK2Lua", functs); LuaGlobal = L; if (active) { return 0; } // run installed modules ... boost::thread thrd(startThread); thrd.detach(); return 0; } [/CODE] this runs the first time I do a require "ngxSDK2Lua" in Lua. The idea is that control returns to the Lua script while the dll does it's stuff, but as soon as the the function returns, the child thread that starts the SimConnect communication dies. Until now I was starting the module using an independent Lua thread with ipc.runlua, but this would be better. Is it even possible please?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.