April 29, 201610 yr Hi, folks. I just got the hang of writing basic (very basic : ) Lua scripts for my Carenado Baron panel (homebuilt). I've got every switch of mine working the corresponding button in the sim except for one instrument. The DME Position indicator (below the HSI) sends an FSX Control (Dme_select and parameter or 1 or 2) and an LVar command (DMEPOS 1 or 2). Is it possible to write an Lua command that will do the FSX command and the LVar? Here's what I have for this section, just need to add the FSX command and not sure how. Thanks for any and all help! -- Dana -- ## DME Position ## function DME_1_Position () ipc.writeLvar("DMEPOS",1) end function DME_2_Position () ipc.writeLvar("DMEPOS",2) end
May 1, 201610 yr Hi KPBG There are 2 means to communicate with an aircraft. Using LVars or, for more basic aircraft, using FSX Controls. The LVar is something set up by the aircraft designer while the FSX Control is defined by Microsoft in the core simulator. If you want to use both calls in your functions then you can. In addition to the ipc.writeLvar use the functions FSXcontrol and FSXcontrolname. FSXcontrol uses the number reference e.g. 66650 and FSXcontrolname uses DME_SELECT. The parameter is added by using a colon e.g. DME_SELECT:1. However, I would caution against using what is the same function using both LVars and FSX Controls. This can lead to conflict. That said, some more sophisticated aircraft add ons do not use the FSX interface fully and it can be necessary to write to both. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
Create an account or sign in to comment