Jump to content
The simFlight Network Forums

tnjram

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Chennai->India

tnjram's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Mr.Pete Happy Holidays! I dont want to use trigger it off from a button. More so it will be called from ipcReady ( basically to do after take off procedures ) ..button was just for testing purpose. There was some change in the code as i was testing and hence i posted back the new code - never mind that. As I understand, the listner ( events ) keep adding to the windows queue for processing but at a certain point ( when user conditions were met) the function was cancelled (function pointer became null ) so when the pending events ( windows queue) fired they were trying to execute a function pointer pointing to null causing the crash.
  2. test.lua ----------- function geardown(offs, val) msg = "" if val == 0 then msg = " up " else msg = " down " end ipc.display ( "gear"..msg) ipc.sleep(500) if msg == " up " then event.cancel("geardown") -- ipc.exit() end end -- to kick it all off: event.offset(0x0BE8, "UW", "geardown")
  3. The lua plug in will finally go into ipcReady once it takes shape, but for now in the learning phase,,,just trying a few things Here are the details.. 48017 Starting everything now ... 48017 LUA.0: beginning "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\ipcReady.lua" 48017 LUA.0: ...es\Microsoft Flight Simulator X\Modules\ipcReady.lua:1 48017 LUA.0: Global: ipcPARAM = 0 48033 LUA.0: ended "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\ipcReady.lua" 48048 FollowMe service initialised and ready ... 49343 Advanced Weather Interface Enabled 52697 KEYDOWN: VK=76, Waiting=0, Repeat=N, Shifts=0 52697 .. Key not programmed -- passed on to FS 52697 *** EVENT: Cntrl= 65574 (0x00010026), Param= 0 (0x00000000) ALL_LIGHTS_TOGGLE 52978 KEYUP: VK=76, Waiting=0 63383 Button changed: bRef=0, Joy=0, Btn=1, Pressed 63383 [buttons] 15=P0,1,CL7:R,0 63383 LUA.0: beginning "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 63383 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:17 63399 LUA.0: Global: ipcPARAM = 0 63399 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:4 63414 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:22 63430 LUA.0: Waiting for an event in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 63430 LUA.0: Offset Change event: calling "geardown" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 63430 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:5 63445 LUA.0: Local: offs = 3048 63461 LUA.0: Local: val = 16383 63461 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:6 63477 LUA.0: Global: msg = 63477 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:9 63492 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:11 63508 LUA.0: Global: msg = down 63539 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:12 63586 Button changed: bRef=0, Joy=0, Btn=1, Released 64054 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:13 64069 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:17 64085 LUA.0: Waiting for an event in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 93803 Button changed: bRef=0, Joy=0, Btn=1, Pressed 93803 [buttons] 15=P0,1,CL7:R,0 93834 LUA.0: ended "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 93850 LUA: "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua": killed 93866 LUA.0: beginning "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 93866 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:17 93881 LUA.0: Global: ipcPARAM = 0 93881 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:4 93897 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:22 93912 LUA.0: Waiting for an event in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 93912 LUA.0: Offset Change event: calling "geardown" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 93912 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:5 93928 LUA.0: Local: offs = 3048 93944 LUA.0: Local: val = 16383 93944 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:6 93959 LUA.0: Global: msg = 93959 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:9 93975 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:11 93990 LUA.0: Global: msg = down 94022 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:12 94053 Button changed: bRef=0, Joy=0, Btn=1, Released 94536 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:13 94536 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:17 94536 LUA.0: Waiting for an event in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 99856 KEYDOWN: VK=71, Waiting=0, Repeat=N, Shifts=0 99856 .. Key not programmed -- passed on to FS 99856 *** EVENT: Cntrl= 65570 (0x00010022), Param= 0 (0x00000000) GEAR_TOGGLE 99872 Monitor IPC:0BE8 (U16) = 0 99872 SimRead: 0BE8="GEAR HANDLE POSITION" FLT64: 0 99887 LUA.0: Offset Change event: calling "geardown" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 99887 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:5 99903 LUA.0: Local: val = 0 99903 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:6 99918 LUA.0: Global: msg = 99934 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:7 99934 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:11 99950 LUA.0: Global: msg = up 99950 KEYUP: VK=71, Waiting=0 99965 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:12 100496 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:13 100496 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:14 100511 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:17 100511 LUA.0: Write Intercept event: calling "" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 100527 *** LUA Error: attempt to call a nil value windows event viewer Faulting application name: fsx.exe, version: 10.0.61472.0, time stamp: 0x475e17d3 Faulting module name: FSUIPC4.dll, version: 4.9.4.2, time stamp: 0x55bff8ac Exception code: 0xc0000005 Fault offset: 0x0008f705 Faulting process id: 0x45c Faulting application start time: 0x01d0f6ca57e6290f Faulting application path: D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\fsx.exe Faulting module path: D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.dll Report Id: d6c00039-62bd-11e5-add1-bd28d58471e6
  4. just to add to the above... function geardown(offs, val) msg = "" if val == 0 then msg = " up " else msg = " down " end ipc.display ( "gear"..msg) -- cancel the event so that next time button press should not do action. event.cancel("geardown") [ this causes the crash..if i comment out this line then no problem] *************** if i add the following line of code the crash goes away ipc.exit() end
  5. Hi I just wrote a small piece of code test.lua fired by a button press and when the aircraft gear is activated I wanted to display gear up or gear down as a message. I dont know if I'm implementing event,cancel properly.Below is the code snippet that is causing the crash. Thank you test.lua function geardown(offs, val) msg = "" if val == 0 then msg = " up " else msg = " down " end ipc.display ( "gear"..msg) -- cancel the event so that next time button press should not do action. event.cancel("geardown") [ this causes the crash..if i comment out this line then no problem] end -- to kick it all off: event.offset(0x0BE8, "UW", "geardown") following is the error line from the console window 38438 LUA.0: Waiting for an event in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38438 LUA.0: Offset Change event: calling "geardown" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38438 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:5 38438 LUA.0: Local: offs = 3048 38454 LUA.0: Local: val = 16383 38470 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:6 38470 LUA.0: Global: msg = 38485 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:9 38501 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:11 38501 LUA.0: Global: msg = down 38532 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:12 38548 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:13 38641 LUA.0: ... Games\Microsoft Flight Simulator X\Modules\test.lua:14 38641 LUA.0: VRI read event: calling "" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38641 *** LUA Error: attempt to call a nil value 38641 LUA.0: (null) event: calling "!" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38641 *** LUA Error: attempt to call a nil value 38641 LUA.0: (null) event: calling "\" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38641 *** LUA Error: attempt to call a nil value 38641 LUA.0: U‹ìV‹uhxêÉg‹Æè¼þÿPèéÅþÿYY^]ÃU‹ì‹EWhxêÉgèþ»þÿ¸4 event: calling "lua:10" in "D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\test.lua" 38641 *** LUA Error: attempt to call a nil value 38641 LUA.0: gvars = {} test.lua.txt
  6. I just figured i could achieve it using offset 0D70. Thanks
  7. Hi I want to be able to toggle flags via lua script. I tried to achieve the functionality through ipc. Setflag & ipc. Clearflag but it didn't work. If i use a joystick button and use luatoggle then it works. However i need to be able to do it via script since i may need to start 5 or 6 threads. What is it that im missing. Thanks
  8. Is LINDA an alternative to FSUIPC??
  9. so how do i convert the value obtained ( from offset 0x2EA0 ) to degrees P.S: Not good in maths :)
  10. Hi Mr Pete Dowson Sir I'm a newbie to FSX and FSUIPC as well. So please bear with me if I have asked you a silly question and not googled hard for a similar question/solution already asked and answered. I have a requirement in which I wanted to read/write Pitch & Elevator Trim executed via lua scripting triggered by a button in a Joystick. I'm new to FSUIPC and hence started browsing example code from your collection of lua scripts ... and slightly modified "Display Vals". The offset document and code example( display vals, liar) is neat and clear when it comes to reading/writing Pitch/Altitude, etc but I could not find any example for reading/writing elevator trim...especially how to convert the value read from offset 0x2EA0. I have a gauge( XML in Panel) displaying ( digital readout ) of Elevator Trim( <String>T:%((A:Elevator Trim Position,degrees))%!2.2f!</String>) and I was trying to verify the data read from offset with the digital read out. My question a) what is the formula to convert value read from offset 0X2EA0 ( so that it would match my reading from gauge) b) if i write ( as per the example code in "Liar" example LUA plug-in for FSUIPC4/ESPIPC only, by Pete Dowson, January 2009) will it reflect really the changes in FS). The reason I'm asking is based on your comment "alter them all to values we want to fool other FSUIPC clients to believe" Need your guidance Thanks very much Regards Janakiraman Swaminathan display vals.txt
×
×
  • 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.