Hi, no worries. that is all great info. In fact it has made me start looking at some of the other aircraft (LUA sections) in XP and there is some really neat stuff in there.Ccard3dev wrote: ↑Mon Jan 10, 2022 3:05 pm Hello!
I am brand new to Lua, so I don't have any idea what that code is you sent lol.
What I can say though is in the C90_sys.lua file there is a section called:
"CREATE READ-ONLY CUSTOM DATAREFS"
If you scroll down there is a section with all the annunciators listed as such:
C90DR_lighting_annun_dc_gen_L = create_dataref("laminar/c90/lighting/annun/dc_gen_L", "number")
So here is an example of how to use this in AirManager (and bear in mind I'm sure there are more efficient ways to program this but I am a beginner so I did what I could lol):
Code: Select all
--defines background image with all annunciators off offimg = img_add_fullscreen("OFF.PNG") --defines illuminated image, cropped to just the L DC Gen lgenimg = img_add("ON.PNG", 0, 0, 1280, 90) viewport_rect(lgenimg, 0,31,85,28) visible(lgenimg, false) --turns on the illuminated image for L DC Gen when the sim says it should be on -- for this aircraft all the annunciators are 0 = off 1 = on function lgen_callback(lgen) if (lgen == 1) then visible(lgenimg, true) else visible(lgenimg, false) end end -- links to data ref xpl_dataref_subscribe("laminar/c90/lighting/annun/dc_gen_L", "int", lgen_callback)
I missed the custom data ref section ! doh .. Will go back and look again. Keep up the great work. The 737 annunciators have interesting features also as the coding was 3 years younger than the C90. Great references. Joe