• 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 Actuating a Lever, Index, Command

Messages
10,163
Country
us-arizona
Hey guys,

How do you write a string that controls a lever that is measured by index?

For instance, if I want to engage the spoiler handle to point 10,000 (index) how would you write that?

Would this be right?

(K:SPOILERS SET,index) 10000



I cannot get mine to work... sigh..

I have tried Spoilers On, Spoilers Off, the above, etc, and nothing works.

These are also my Spoilers settings in the config;

spoiler_limit = 90.0
spoiler_extension_time = 0.6 //Seconds
spoilerons_available = 0 //Spoilerons Available?
spoiler_handle_available = 1
aileron_to_spoileron_gain = 0 //Aileron to spoileron gain
min_ailerons_for_spoilerons = 0 //Degrees
min_flaps_for_spoilerons = 0 //Minimum flap handle position when spoilerons activate
auto_spoiler_available = 0

I thought I should not have auto spoiler on, as the sim might do strange things with it.
 
From the 'Event IDs' SDK

"KEY_AXIS_SPOILER_SET AXIS_SPOILER_SET Sets spoiler handle position (-16383 - +16383)"

So try .... 'some proportional value' (>K:AXIS_SPOILER_SET)
 
10000 (>;K:SPOILERS_SET) works for me in FSX. Takes a value from 0 to 16384.

I assume a similar event is available in FS9?

It works with these aircraft.cfg settings:
spoiler_limit = 90
spoiler_extension_time = 0.01
spoiler_handle_available= 1
spoilerons_available = 0
aileron_to_spoileron_gain = 0
min_ailerons_for_spoilerons= 0
min_flaps_for_spoilerons = 0
auto_spoiler_available = 0
 
My spoilers are a bit different. It allows me to set the spoiler lever to any percentage I want. The update part is to allow for blow back or partial extension if above VNE.
Code:
<Gauge Name="Spoiler Lever" Version="1.0">
<Image Name="Spoiler_Background.bmp"/>
<Update Frequency="3"/>
<Update>
(A:SPOILER HANDLE POSITION,position) 4097 &gt; (A:AIRSPEED INDICATED,Knots) 345 &gt; AND if{ 4096 (>K:SPOILERS_SET) } els{ (L:spoiler_inhibit,bool) 1 == if{ 0 (>K:SPOILERS_SET) } }
</Update>

<Element>
    <Position X="0" Y="0"/>
    <Select>
         <Value>(A:Spoilers handle position, position) 0 max 1 min 9 * near 1 +</Value>
         <Case Value="1">
            <Image Name="Spoiler1.bmp"/>
         </Case>
         <Case Value="2">
            <Image Name="Spoiler2.bmp"/>
         </Case>
         <Case Value="3">
            <Image Name="Spoiler3.bmp"/>
         </Case>
         <Case Value="4">
            <Image Name="Spoiler4.bmp"/>
         </Case>
         <Case Value="5">
            <Image Name="Spoiler5.bmp"/>
         </Case>
         <Case Value="6">
            <Image Name="Spoiler6.bmp"/>
         </Case>
         <Case Value="7">
            <Image Name="Spoiler7.bmp"/>
         </Case>
         <Case Value="8">
            <Image Name="Spoiler8.bmp"/>
         </Case>
         <Case Value="9">
            <Image Name="Spoiler9.bmp"/>
         </Case>
         <Case Value="10">
            <Image Name="Spoiler10.bmp"/>
         </Case>
      </Select>
</Element>

<Mouse>
    <Help ID="HELPID_GAUGE_SPEED_BRAKE"/>
    <Tooltip ID="TOOLTIPTEXT_SPEED_BRAKE"/>
    <Cursor Type="Hand"/>
    <Click Kind="LeftSingle+LeftDrag">(M:Y) 0 - 136 / 0 max 1 min  16384 * (&gt;K:SPOILERS_SET)</Click>
</Mouse>
</Gauge>
 
Ahhh so... Putting the 'amount' in front of the >K:.... is what I was missing. Many thanks guys.
 
Worked awesome. Many thanks...

Here is the code I used. This replicates 'regeneration' from the propeller on descents with throttle off on an electric aircraft.

Code:
<!-- /////////////////////////// REGENERATION DECELERATION EFFECT -->

   <Element>
      <Select>
         <Value>
                      (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) 0 ==
                      (A:PLANE ALT ABOVE GROUND,feet) 20 &gt;
                      (A:VELOCITY BODY Z,knot) 80 &gt;
                      (A:SPOILERS LEFT POSITION,percent) 0 ==
                      and and and
                      if{
                         16384 (>K:SPOILERS_SET)
                        }
         </Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>
                      (A:GENERAL ENG THROTTLE LEVER POSITION:1, percent) 1 &gt;
                      (A:PLANE ALT ABOVE GROUND,feet) 20 &lt;
                      (A:VELOCITY BODY Z,knot) 79.9 &lt;
                      or or
                        if{
                          (A:SPOILERS LEFT POSITION,percent) 1 &gt;
                          if{
                            0 (>K:SPOILERS_SET)
                            } }
         </Value>
      </Select>
   </Element>
 
Back
Top