Jump to content
Sign in to follow this  
Gregg_Seipp

Advice to aircraft developers on buttons and switches

Recommended Posts

I just thought I'd throw this out there to people who develop complex aircraft for FSX (and other platforms, I guess).

 

A lot of people have external devices to control stuff. Lights, flaps, deicing, prop controls, autopilots. They use a button or a switch to control stuff you create on an airplane. As RealAir points out in at least one of their manuals, most accidents happen when the airplane is 'low and slow' and you don't want to mess around with a VC or bringing up a panel to do something critical so you program it into a button or a switch. So you program it into a button so you can keep from getting disoriented, even momentarily. So I progam my controls to keep my looking at my instruments or outside. After spending many hours trying to program my panel for a few buttons, I have realized that some things just can't be safely done due to the APIs provided. Here's my thoughts:

  • Some things aren't modeled at all even though they are critical. Engine icing is an example. Flying along at 1500 feet in the soup, I have to turn my 'head' and physically click the button. There's, apparently, no API for this particular aircraft.
  • Toggles. Critical things that are 'toggle' commands can be dangerous. If the effect of the switch can't be seen without turning your head (landing light toggles) then the toggle event may do the opposite. In small aircraft this is often simple because the switch is in front of the pilot...landing light...carb heat. In big aircraft, it's actually bad. You click the button you created on your control but you don't know if you turned it off or on.

Thing is, turning your head (or glancing up) in a simulator is a lot more complex than in real life and, even though it's simpler in real life, that's what tends to kill a lot of pilots.

 

So,

  • if it's critical, create an API. Create an on and an off (and, sometimes, a toggle)
  • if it's not visible to a pilot looking forward, don't make it a toggle.
  • If you have to make it a toggle, flash a message on the screen..."engine ice on"
    "landing light on". It's more realistic since a pilot who flips a switch can feel it on their fingers.

Just my two cents. I don't know how many folks have hardware with switches, maybe it's a lot, maybe not. It's at least something to consider when building a complex aircraft. Just one more blasted thing to think about.


Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i7-8700 32GB Ram, GTX-1070 8 Gig RAM

Share this post


Link to post
Share on other sites

Agree, some good points here. It does seem more and more simmers are purchasing panel hardware to increase their immersion... more than the typical yoke or joystick. Now I realize not all developers can afford this integration but the higher end, higher priced models should consider this when going to market. It is now high on my decision list as to whether I will purchase this aircraft or not... will it work with my hardware.

 

 

 

i


Intel i9-12900KF, Asus Prime Z690-A MB, 64GB DDR5 6000 RAM, (3) SK hynix M.2 SSD (2TB ea.), 16TB Seagate HDD, EVGA GeForce 3080 Ti, Corsair iCUE H70i AIO Liquid Cooler, UHD/Blu-ray Player/Burner (still have lots of CDs, DVDs!)  Windows 10, (hold off for now on Win11),  EVGA 1300W PSU
Netgear 1Gbps modem & router, (3) 27" 1440 wrap-around displays
Full array of Saitek and GoFlight hardware for the cockpit

Share this post


Link to post
Share on other sites

Many FSX functions are 'toggle only'...that is to say there is no 'ON' or 'OFF' KEY_EVENT. Some states can be determined by reading the 'A:Variable' but

not all controls/functions offer that capability.

 

I use the L:Var variables that are available for any given aircraft in conjunction with a

registered version of FSUIPC4 to set up my controllers. I also use LUA scripts for a

number of more complex arrangements.

 

As to knowing if a control went to the desired state, I have used LUA to display

a message on the screen (time of display is settable) to indicate the state of a

function when I hit the button or switch.

 

If you have controllers beyond the basic joystick/throttle/pedals and are not

using FSUIPC4 then I recommend that you investigate adding it as it provides

very powerful features to address the 'custom' setups.

 

Asking developers to add additional code to what may be an already a huge

chunk of development and programming time is not something I would

advocate. There are just too many variables in configurations for them to

create a 'one size fits all' approach.

 

I prefer to do my own customization in any event, but that's just me :)

 

Paul


Wide-5.jpg

Share this post


Link to post
Share on other sites

I use the L:Var variables that are available for any given aircraft in conjunction with a

registered version of FSUIPC4 to set up my controllers. I also use LUA scripts for a

number of more complex arrangements.

 

As to knowing if a control went to the desired state, I have used LUA to display

a message on the screen (time of display is settable) to indicate the state of a

function when I hit the button or switch.

 

If you have controllers beyond the basic joystick/throttle/pedals and are not

using FSUIPC4 then I recommend that you investigate adding it as it provides

very powerful features to address the 'custom' setups.

 

I have FSUIPC4 (registered) and Linda that I use with several controllers (see my platform below if it matters). Can you share an example or two of your LUA that does this? I don't know anything about LUA but I think if there's a way to make toggles to important 'nonvisible' work it would be worth the effort.

 

Asking developers to add additional code to what may be an already a huge

chunk of development and programming time is not something I would

advocate. There are just too many variables in configurations for them to

create a 'one size fits all' approach.

 

I don't think I was saying it that strong. Just asking them to put some thought into it and laying down my thought process. I'm just a lowly customer with little to no idea what the other customers are doing. And I'd just make it available to FSUIPC and let people deal with interfacing it there.


Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i7-8700 32GB Ram, GTX-1070 8 Gig RAM

Share this post


Link to post
Share on other sites

Can you share an example or two of your LUA that does this? I don't know anything about LUA but I think if there's a way to make toggles to important 'nonvisible' work it would be worth the effort.

 

Sure, just let me add some comments to a couple of my Lua scripts to

explain what is going on.

 

I don't think I was saying it that strong. Just asking them to put some thought into it and laying down my thought process.

 

I can agree on that basis. There are aspects that relate to Multi-Player that

I would like developers to realize/code for. Gear state is one....FSX has specific

KEY events for GEAR UP, GEAR DOWN and a couple of other SET variables.

But most tend to just go with the default FSX "G" that produces the GEAR

TOGGLE event. In MP, if gear state is 'out of sync' between what

you see as your state and others see as your state, executing a GEAR

TOGGLE all day long will not 'fix' the issue. Use of the specific state KEY

events would.

 

I'll post those Lua examples here sometime soon :) Others may find them

useful as well.

 

Paul


Wide-5.jpg

Share this post


Link to post
Share on other sites

Very much appreciate it!


Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i7-8700 32GB Ram, GTX-1070 8 Gig RAM

Share this post


Link to post
Share on other sites

OK, let me see if I can get this code to display OK on this forum. It seems I

recall having difficulty making that happen with the forum software here before.

 

EDIT: The 'code' box! was truncating each long line. I'll try to fix it here

Note that each "ipc.display" line should be one long, non-wrapped line

followed by the 'end' statement on the next line.

 

I have a rather unique method for implementing my control assignments using

the 'advanced features' of FSUIPC4. It took many 'RTFM's for me to get a

grasp on all the power contained in that 'utility' :)

 

I've selected one of my many aircraft-specific lua scripts that will hopefully

demonstrate what can be done with the display and control of FSX variables

with FSUIPC4 and Lua.

 

--
-- The function below will display the currently selected 'control set' (Mode)
-- whenever the value in the user-defined offset 0x66C0 changes.
-- The display is in 2 lines.
-- The top line for the upper 5 switch positions on the Saitek Pro Quads and
-- the bottom line for the lower 5 switches.
-- I have 2 switches on my throttle quads assigned to increment/decrement
-- the value in the offset over a range of 0 to 3 in a circular fashion.
-- The display of the currently assigned functions for the other 10 switches
-- lasts 10 seconds. (the 10 in Control Set = "..conset, 10).
-- You can make this any value.
-- See the first entry in the "event.offset" section, which calls this function.
-- See the FSUIPC4.ini code below for the button assignment code.
-- Note that the embedded spaces are there to align the top and
-- bottom display lines.

function dispC47CS(offs, val)

-- add 1 to the passed parameter

conset=val+1

-- set the Lua display size and position here

ipc.setdisplay(650, 200, 500, 100)
if val == 0 then
ipc.display("GEN 1 _ GEN 2 _ BATTERY _ NAV LIGHTS _ LAND
LIGHTS\nSTART 1 _ START 2 _ AVIONICS _ BEACON	 _ CABIN
LIGHTS\nControl Set = "..conset, 10)
end

if val == 1 then
ipc.display("E1 TANK SEL _ E2 TANK SEL _ E1 PUMP _ E2 PUMP _ PRIME
1\nE1 TANK OFF _ E2 TANK OFF _ E1 VALVE _ E2 VALVE _ PRIME
2\nControl Set = "..conset, 10)
end

if val == 2 then
ipc.display("GPS	 _ AP CHART _ TAGS		 _ PITCH UP _ HDG INC
\nRADAR _ MAP		 _ AUTOPILOT _ PITCH DWN _ HDG DCR\nControl Set
= "..conset, 10)
end

if val == 3 then
ipc.display("MAG 1 INC _ MAG 2 INC _ COWL 1 INC _ COWL 2 INC _ PITOT
ON\nMAG 1 DEC _ MAG 2 DEC _ COWL 1 DEC _ COWL 2 DEC _ PITOT
OFF\nControl Set = "..conset, 10)
end

end

-- The following 2 functions will display the fuel tanks that are selected for the
-- left and right engines of the Mamm-Sim C-47.
-- The user-defined offsets 0x66C1 and 0x66C2 are used to keep track of
-- the selected tanks when the buttons assigned to the tank selects are
activated. See the FSUIPC4.ini code below

function dispR_FUEL_TANK(offs, TANK)

if TANK == 0 then x = "R MAIN" y = 3 end
if TANK == 1 then x = "L MAIN" y = 2 end
if TANK == 2 then x = "L AUX" y = 6 end
if TANK == 3 then x = "R AUX" y = 7 end
if TANK == 4 then x = "OFF" y = 0 end

-- Set the current right engine tank in FSX offset 65962
-- and then display the selection for 2 seconds

ipc.control(65962, y)

ipc.display("RIGHT FUEL TANK = "..x, 2)
end

function dispL_FUEL_TANK(offs, TANK)

if TANK == 0 then x = "R MAIN" y = 3 end
if TANK == 1 then x = "L MAIN" y = 2 end
if TANK == 2 then x = "L AUX" y = 6 end
if TANK == 3 then x = "R AUX" y = 7 end
if TANK == 4 then x = "OFF" y = 0 end

-- Set the current left engine tank in FSX offset 65963
-- and then display the selection for 2 seconds

ipc.control(66523, y)

ipc.display("LEFT FUEL TANK = "..x, 2)
end

-- The following two functions are called when the values in the standard
-- FSX offsets 0x3590 and 0x3594 change. These are the fuel valve variables.
-- The current state is checked and the appropriate state message displayed
-- for 2 seconds.

function dispL_FUEL_VALVE(offs, STATE)

if STATE == 0 then y = "CUTOFF" end
if STATE == 1 then y = "CLOSED" end

ipc.display("LEFT FUEL VALVE = "..y, 2)
end

if STATE == 1 then y = "CLOSED" end

ipc.display("RIGHT FUEL VALVE = "..y, 2)
end

-- These are the event triggers that call the above functions.
-- They must be BELOW the called function code in the file!

event.offset(0x66C0,"UB","dispC47CS")
event.offset(0x66C1,"UB","dispR_FUEL_TANK")
event.offset(0x66C2,"UB","dispL_FUEL_TANK")
event.offset(0x3590 ,"UB","dispL_FUEL_VALVE")
event.offset(0x3594 ,"UB","dispR_FUEL_VALVE")

-- This is the end of the Lua script
-- It resides in the FSX 'Modules' folder
-- and can have any name but MUST have the
-- extension '.lua'


===================================================
=== Here is the button assignment section =========
=== of my FSUIPC4.ini file for the MAMM-SIM C-47 ==
=== The coding is made by editing the ini file ====
=== since there are MULTIPLE assignments for ======
=== each of the 10 switches on the throttle quad ==
=== Which assignment is currently active depends ==
=== upon the value in user-defined offset 0x66C0 ==
=== Note that I use LETTERS for my controller =====
=== assigments instead of the default numbers =====
[buttons.MAAM-SIM Douglas C-47]
1!==//------- Control Set 1 -----------------
0=PA,4,Cx510066C0,x00030001 ;//CONTROL SET INC Max = 3 Step = 1
1=PA,5,Cx610066C0,x00030001 ;//CONTROL SET DEC Max = 3 Step = 1
2=B66C0=0 PD,14,C66363,0 ;//TOGGLE GEN 1
3=B66C0=0 PD,15,C66300,0 ;//Start 1 TOGGLE
4=B66C0=0 PD,16,C66364,0 ;//TOGGLE GEN 2
5=B66C0=0 PD,17,C66301,0 ;//Start 2 TOGGLE
6=B66C0=0 PD,18,C66241,0 ;//TOGGLE Master Battery
7=B66C0=0 PD,19,C66293,0 ;//TOGGLE Avionics Master
8=B66C0=0 PA,0,C66379,0 ;//TOGGLE NAV Lights
9=B66C0=0 PA,1,C66239,0 ;//TOGGLE Beacon
10=B66C0=0 PA,2,C65751,0 ;//TOGGLE Landing Lights
11=B66C0=0 PA,3,C66240,0 ;//TOGGLE Cabin Lights (Taxi Lights?)
2!==//------- Control Set 2 -----------------
20=B66C0=1 PD,14,Cx510066C1,x00030001 ;//OFFSET INC Max = 4 Step =
1 LEFT FUEL TANK SELECT
21=B66C0=1 PD,15,Cx010066C1,x04	 ;//Tank OFF
22=B66C0=1 PD,16,Cx510066C2,x00030001 ;//OFFSET INC Max = 4 Step =
1 RIGHT FUEL TANK SELECT
23=B66C0=1 PD,17,Cx010066C2,x04	 ;//Tank OFF
24=B66C0=1 PD,18,C66340,0 ;// TOGGLE Fuel Pump 1
25=B66C0=1 PD,19,C66494,0 ;// TOGGLE ENG1 FUEL VALVE
26=B66C0=1 PA,0,C66341,0 ;// TOGGLE Fuel Pump 2
27=B66C0=1 PA,1,C66495,0 ;// TOGGLE ENG2 FUEL VALVE
28=B66C0=1 PA,2,C66345,0 ;// TOGGLE PRIMER 1
29=B66C0=1 PA,3,C66346,0 ;// TOGGLE PRIMER 2
3!==//------- Control Set 3 -----------------
30=B66C0=2 PD,14,C66506,225 ;//Toggle GPS
31=B66C0=2 PD,15,C66506,440 ;//Toggle ANR-75 radar
32=B66C0=2 PD,16,C66506,14992 ;//Toggle AP Chart
33=B66C0=2 PD,17,C66506,1065 ;//MAP TOGGLE
34=B66C0=2 PD,18,C66199,0 ;// TAGS
35=B66C0=2 PD,19,C65580,0 ;// AUTOPILOT TOGGLE
36=B66C0=2 RA,0,C66583,0 ;// AP PITCH REF. INC UP
37=B66C0=2 RA,1,C66584,0 ;// AP PITCH REF. INC DOWN
38=B66C0=2 RA,2,Cx520007CC,xFFFF00B4
39=B66C0=2 RA,3,Cx620007CC,xFFFF00B4 ;// HEADING DEC
4!==//------- Control Set 4 -----------------
40=B66C0=3 RD,14,Cx11000892,x00030001 ;//MAG1 INC
41=B66C0=3 RD,15,Cx21000892,x00000001 ;//MAG1 DEC
42=B66C0=3 RD,16,Cx1100092A,x00030001 ;//MAG2 INC
43=B66C0=3 RD,17,Cx2100092A,x00000001 ;//MAG2 DEC
44=B66C0=3 RD,18,C66329,1 ;//OPEN COWL FLAPS 1
45=B66C0=3 RD,19,C66330,1 ;//CLOSE COWL FLAPS 1
46=B66C0=3 RA,0,C66331,1 ;//OPEN COWL FLAPS 2
47=B66C0=3 RA,1,C66332,1 ;//CLOSE COWL FLAPS 2
48=B66C0=3 PA,2,C66072,0 ;// PITOT HEAT ON
49=B66C0=3 PA,3,C66073,0 ;// PITOT HEAT OFF
===============================================

 

Now if the forum software didn't mangle that too much it should be 'food for

thought' and generate some questions :)

 

Paul


Wide-5.jpg

Share this post


Link to post
Share on other sites

This is going to take some real study time :).


Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i7-8700 32GB Ram, GTX-1070 8 Gig RAM

Share this post


Link to post
Share on other sites

This is going to take some real study time :).

 

Gregg,

 

These documents, included with FSUIPC4, will be helpful in deciphering my coding :)

 

FSUIPC4 for Advanced Users.pdf

 

FSUIPC Lua Library.pdf

 

Revised_List_of_FSX_Controls.pdf

 

FSUIPC4 Offsets Status.pdf

 

I am constantly going back into those whenever I go about setting up the controls

for a new aircraft or adding new features. Most of what I have these days are for

the A2A Accu-Sim aircraft.

 

For the B-17G I have 8 control sets (modes)...80 functions mapped to the 10

switches on my Saitek Pro dual throttle quads. I can pretty much go from cold

and dark to getting airborne without having to use the keyboard or mouse.

 

Some of my switch assignments have multiple functions for a given mode.

When I select the B-17 engine 3 'Start', for example, that switch press also

sets the primer select to engine 3 as well as the fire extinguisher to engine 3.

 

I've not dabbled with LINDA although Günter keeps trying to 'convert' me.

I'm pretty certain, however, that you can have a 'hybrid' setup with functions

assigned in LINDA and additional functions via FSUIPC4.ini editing, including

the generation of a display window when a parameter changes.

 

I even have 'reminder' WAV files that play if I happen to be below a certain

altitude and speed and my gear is not down. Or after takeoff, should I forget

to return the gear switch in the B-17G to its center, neutral position a little

voice that sounds a lot like me reminds me to "'Check Gear Switch!".

These are triggered via Lua scripts.

 

As a retired engineer I rather enjoy 'tweaking', thus my exploration of the

various things I have mentioned here.

 

Paul


Wide-5.jpg

Share this post


Link to post
Share on other sites

Thanks Paul. I'll take a look and start with something basic.


Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i7-8700 32GB Ram, GTX-1070 8 Gig RAM

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...