• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 three position switches

Messages
181
Country
czechrepublic
Hi,
I would like to ask if somebody has a three position switch for makemdl & FS9... I have not found it in FFDS forum or anywhere else :-(

I have three items to be used as three position switch

1) Ignition (turboprop engine): AUTO (up) - OFF (middle) - MANually ON (down)
I dont know if FS supports AUTO ignition, but at least it would be fine to have there "fake" and make switch to control ON - OFF - ON

2) Starter (also turboprop): L eng (left) - OFF (middle) - R eng (right)
It should be possible, as I saw at many 3rd party addons...

3) DC generator: ON (up) - OFF (middle) - reset (down)
Again, I am not sure if FS supports DC gen failure that can be fixed by reseting, so at least it would be good to have ON - OFF - nothing/fake switch (and it would be awesome if from RESET to OFF the switch would be spring-loaded, but I think this is to complicated...)

Sorry for asking on so complicated think, but I dont know where to start, I believe there are no 3pos switches in "native" MakeMDL where I could copy this from...

Pavel
 
Starter Switch: Left - Off - Right

Code:
  <part>
    <name>da42_starter_switch</name>
    <animation>
      <parameter>
        <code>50 (L:StarterSwitch,enum) 50 * +</code>
        <lag>400</lag>
      </parameter>
    </animation>
    <mouserect>
      <cursor>Hand</cursor>
      <tooltip_text>Engine Starter</tooltip_text>
      <mouse_flags>LeftSingle+RightSingle+LeftRelease+RightRelease</mouse_flags>
      <callback_code>
        (M:Event) 'LeftSingle' scmp 0 ==
        if{
        -1 (>L:StarterSwitch, enum)
        (>K:TOGGLE_STARTER1)
        }
        (M:Event) 'RightSingle' scmp 0 ==
        if{
        1 (>L:StarterSwitch, enum)
        (>K:TOGGLE_STARTER2)
        }
        (M:Event) 'LeftRelease' scmp 0 ==
        if{ 0 (>L:StarterSwitch, enum) }
        (M:Event) 'RightRelease' scmp 0 ==
        if{ 0 (>L:StarterSwitch, enum) }
      </callback_code>
    </mouserect>
  </part>

Three Position Switch
Code:
  <part>
    <name>da42_switch_anti_ice_light</name>
    <animation>
      <parameter>
        <code>
          25 (L:IceLight, number) 25 * +
        </code>
      </parameter>
    </animation>
    <mouserect>
      <cursor>Hand</cursor>
      <tooltip_text>Ice Light</tooltip_text>
      <mouse_flags>LeftSingle+RightSingle+Wheel</mouse_flags>
      <callback_code>
        (M:Event) 'LeftSingle' scmp 0 ==
        if{ (L:IceLight, enum) -- -1 max (>L:IceLight, enum) }
        (M:Event) 'RightSingle' scmp 0 ==
        if{ (L:IceLight, enum) ++  1 min (>L:IceLight, enum) }
        (M:Event) 'WheelDown' scmp 0 ==
        if{ (L:IceLight, enum) -- -1 max (>L:IceLight, enum) }
        (M:Event) 'WheelUp' scmp 0 ==
        if{ (L:IceLight, enum) ++  1 min (>L:IceLight, enum) }
        (L:VC_Click,bool) ! (>L:VC_Click,bool)
        1 (>L:XMLClick,enum)
      </callback_code>
    </mouserect>
  </part>
 
Thank you Bill! Could you please tell me how are they keyframed? I tried the engine starter with KF0 = OFF, KF50 = L start, K100 = R start or with K0 = L start, K50 = OFF, K100 =R start, but both are incorrect... I am not getting it.

Pavel
 
The starter switch is keyed 0 - 50 - 100

The generic "Three Position Switch" is keyed 0 - 25 - 50
 
Good, starter works... but the other 3-pos switch which I am trying to use for ignition nope.

Code:
<part>
    <name>ev_ignition_sw</name>
    <animation>
      <parameter>
        <code>
          25 (L:ign2, number) 25 * +
        </code>
      </parameter>
    </animation>
    <mouserect>
      <cursor>Hand</cursor>
      <tooltip_text>Ignition Right Engine Switch</tooltip_text>
      <mouse_flags>LeftSingle+RightSingle+Wheel</mouse_flags>
      <callback_code>
        (M:Event) 'LeftSingle' scmp 0 ==
        if{ (L:ign2, enum) -- -1 max (>L:ign2, enum) }
        (M:Event) 'RightSingle' scmp 0 ==
        if{ (L:ign2, enum) ++  1 min (>L:ign2, enum) }
        (M:Event) 'WheelDown' scmp 0 ==
        if{ (L:ign2, enum) -- -1 max (>L:ign2, enum) }
        (M:Event) 'WheelUp' scmp 0 ==
        if{ (L:ign2, enum) ++  1 min (>L:ign2, enum) }
        (L:VC_Click2,bool) ! (>L:VC_Click2,bool)
        1 (>K:MASTER IGNITION SWITCH:2,bool)
      </callback_code>
    </mouserect>
  </part>

Is this code correct? And if yes, do I need anything else to startup default FS turbine engine? I have fuel open (condition levers at rich), this ignition in upper (or lower) position and starter engaged... I hear the sound of starter, but the engine doesnt start (something we all know when we are trying to start a car at cold winter).

Pavel
 
For a turbine, the event ID is: (>K:TURBINE_IGNITION_SWITCH_TOGGLE)

Note that this does NOT take an :index!

The "read variable" is: (A:TURBINE_IGNITION_SWITCH_TOGGLE,bool)

There are no event IDs or variables for more than one engine...

Try this:
Code:
      <callback_code>
        (M:Event) 'LeftSingle' scmp 0 ==
        if{ (L:ign2, enum) -- -1 max (>L:ign2, enum) }
        (M:Event) 'RightSingle' scmp 0 ==
        if{ (L:ign2, enum) ++  1 min (>L:ign2, enum) }
        (M:Event) 'WheelDown' scmp 0 ==
        if{ (L:ign2, enum) -- -1 max (>L:ign2, enum) }
        (M:Event) 'WheelUp' scmp 0 ==
        if{ (L:ign2, enum) ++  1 min (>L:ign2, enum) }
        (L:VC_Click2,bool) ! (>L:VC_Click2,bool)

        (L:ign2, enum) 1 ==
        (A:TURBINE_IGNITION_SWITCH_TOGGLE,bool) 0 ==
        and
        if{ (>K:TURBINE_IGNITION_SWITCH_TOGGLE) }

        (L:ign2, enum) 0 ==
        (A:TURBINE_IGNITION_SWITCH_TOGGLE,bool) 1 ==
        and
        if{ (>K:TURBINE_IGNITION_SWITCH_TOGGLE) }

      </callback_code>
 
Back
Top