Adding a factor to n1 gauge
Re: Adding a factor to n1 gauge
air manager gauges are correct as is / same data values as the sim panels. . It’s just finding an easier way to fine tune things rather than to change sim flight model which is not 100% correct.
Re: Adding a factor to n1 gauge
It’s really simple. You subscribe to say the Sim N1 data which will already be done if using an existing instrument and then just do whatever maths you want on the value before rotating the needle or displaying the value. You can even do non linear if you need to.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Adding a factor to n1 gauge
it might be really simple to an experienced user but someone new it’s actually not that simple (at to me). I can’t find any examples of this so even after starting to understand the concepts and methods by watching the videos (which is all good) without a code example it seems like i’m at the bottom of a mountain looking up… with no guide. If it is simple can you show me a code line that would be a starting point? That would probably help me take the first steps!
Re: Adding a factor to n1 gauge
Maybe you can start with posting a script here.
Re: Adding a factor to n1 gauge
This is the gauge script I was using to learn on. I'm presuming there is a way to change the ("%.01f",n1) value....
-- Robinson R66 N1 %RPM --
--------------------------------------------
-- Load and display images --
--------------------------------------------
img_add_fullscreen("background.png")
img_needle = img_add("needle.png", 10, 10, 380, 380)
img_add_fullscreen("cap.png")
txt_n1 = txt_add( "0.0", "size:60px; color: green; halign:right;", -5, 260, 380, 380)
---------------
-- Functions --
---------------
function new_data_xpl(n1)
n1 = var_cap(n1[1], 0, 110)
rotate(img_needle, -40 + (260 / 110 * n1) )
end
function new_data_fsx(n1)
n1 = var_cap(n1, 0, 110)
rotate(img_needle, -82 + (260 / 122 * n1) )
txt_set(txt_n1, string.format ("%.01f", n1) )
end
-------------------
-- Bus subscribe --
-------------------
xpl_dataref_subscribe("sim/cockpit2/engine/indicators/N1_percent", "FLOAT[8]", new_data_xpl)
fsx_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)
fs2020_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)
-- Robinson R66 N1 %RPM --
--------------------------------------------
-- Load and display images --
--------------------------------------------
img_add_fullscreen("background.png")
img_needle = img_add("needle.png", 10, 10, 380, 380)
img_add_fullscreen("cap.png")
txt_n1 = txt_add( "0.0", "size:60px; color: green; halign:right;", -5, 260, 380, 380)
---------------
-- Functions --
---------------
function new_data_xpl(n1)
n1 = var_cap(n1[1], 0, 110)
rotate(img_needle, -40 + (260 / 110 * n1) )
end
function new_data_fsx(n1)
n1 = var_cap(n1, 0, 110)
rotate(img_needle, -82 + (260 / 122 * n1) )
txt_set(txt_n1, string.format ("%.01f", n1) )
end
-------------------
-- Bus subscribe --
-------------------
xpl_dataref_subscribe("sim/cockpit2/engine/indicators/N1_percent", "FLOAT[8]", new_data_xpl)
fsx_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)
fs2020_variable_subscribe("TURB ENG N1:1", "Percent", new_data_fsx)
Re: Adding a factor to n1 gauge
Please use </> code brackets next time. Would be nice to know which flight simulator you're using.
Re: Adding a factor to n1 gauge
FSX
I just copied it from the screen - i don’t know what happened to the code brackets
I just copied it from the screen - i don’t know what happened to the code brackets
Re: Adding a factor to n1 gauge
Thanks to everyone for the pointers and help - I have now figured out how to do this / indeed simple once you know how... Thank you.
Re: Adding a factor to n1 gauge
It is, it's just basic math
Re: Adding a factor to n1 gauge
yes, very basic - the problem was i did not know where to insert it - but I do now, small steps…! I think I was also overthinking what what actually was required.