• 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 A:var value not being reset

Messages
1,468
Country
italy
The basic original gauge function Worked correctly.
Code:
 <Value>(L:YAW_TEST,number) 0 == (A:AUTOPILOT YAW DAMPER,bool) 1 == if{ 1 Minimum="-3" Maximum="3" (A:AILERON AVERAGE DEFLECTION,degrees) }</Value>
Then I added a test button and changed the code. The test function also works correctly
Code:
<Value>(L:YAW_TEST,number) (A:AUTOPILOT YAW DAMPER,bool) | if{ 1 Minimum="-3" Maximum="3" (A:AILERON AVERAGE DEFLECTION,degrees) } if{ 2 (A:AILERON AVERAGE DEFLECTION,degrees) 6 ++ }</Value>
However when I switch on the yaw damper the gauge reacts in the same way as "if{ 2 " etc instead of "if{ 1 ". Even if I don't press the test button the wrong value is sent when I select the "yaw on" switch. The test button changes the value of (L:YAW_TEST,number) from 0 to 2 and back to 0 That works fine.
BTW I'm using (A:AILERON AVERAGE DEFLECTION,degrees) in reverse because in the sim it produces a larger value and is more visible. In real life if you hand fly the VC10 the yaw damper indicators are dancing all over the place!!
In essence I have a value 1 which allows the gauge to indicate the movement according to aileron deflection. Value 2 (a test function) which forces the gauge to indicate a deflection. It seems that the test function is not being reset even though the L:var value does change.
Your help much appreciated.
vololiberista
 
Code:
<Value>(L:YAW_TEST,number) (A:AUTOPILOT YAW DAMPER,bool) | if{ 1 Minimum="-3" Maximum="3" (A:AILERON AVERAGE DEFLECTION,degrees) } if{ 2 (A:AILERON AVERAGE DEFLECTION,degrees) 6 ++ }</Value>

What is the purpose of if{ 1... and if{ 2... for you?

What's behind the if{... is the "do" function of the code.
Looking at your code i suspect that you want to use it to check for a certain value.

Correct usage of an if{ } statement:
(condition) if{ (do this) } els{ (do that) }

If a condition is true then do this otherwise do that.

For instance:
(L:switch,enum) 2 == if{ 3 (&gt;L:yes,enum) } els{ 1(&gt;L:yes,enum) }

if L:switch, enum = 2 then make L:yes,enum a value of 3, else make L:yes,enum a value of 1.

Is my suspicion correct?

grt
Willem
 
You are right more or less Willem,
Effectively I want the gauge to work:-
1. When the yaw damper switch is 1
2. When the yaw damper switch is 0 but the test switch is 2

In the mean time I have worked out a compromise which more or less works ok.

However, there is another problem which perhaps you may know the answer if I may.

I have two gauges superimposed. One is a flap.bmp code below which does nothing other than open and close a flap exposing buttons:-
Code:
   <Element>
      <Select>
         <Value>(L:FLAP,bool)</Value>
         <Case Value="0">
            <Image Name="FLAP_OPEN.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="FLAP_CLOSED.bmp"/>
         </Case>
      </Select>
   </Element>
</Gauge>

When the flap is closed the buttons are concealed. But, when I select the AP the button image shows through the flap image. The code for the button is below. Can I do anything about this? or is it a problem asociated with overlaying gauges? This problem only occurs if/when the AP is selected
The button code is below:-
vololiberista
Code:
<Gauge Name=" Yaw Select Button" Version="1.0">
   <Element>
      <Select>
         <Value>(A:AUTOPILOT YAW DAMPER,bool)</Value>
         <Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Stby Select</Tooltip>
      <Cursor Type="Hand"/>
	<Click Event="YAW_DAMPER_TOGGLE"/>
   </Mouse>
</Gauge>
 
You can NOT "set" much less "reset" A:variables. Period!

A:variables are read only.

You can only "set" things that are >K:events (key_events).
 
Regarding your first question.
From what you say you want the Yaw Damper Indicator to work in two modes, Normal and Test.

In Normal mode it should indicate when the yaw damper is on. If it is off the indications should be zero. In this case you need to pass the value of
(A:AILERON AVERAGE DEFLECTION,degrees) to the indicator if (A:AUTOPILOT YAW DAMPER,bool) is true and pass zero if it is false. Try this.
Code:
<Value>(A:AUTOPILOT YAW DAMPER,bool) if{ (A:AILERON AVERAGE DEFLECTION,degrees) } els{ 0 }</Value>

In Test mode you need to first check if the Yaw Damper is off and, if (Yaw_Test,number) is 2, then pass a test value to the indicator . In this case you are not concerned with what the (A:AILERON AVERAGE DEFLECTION,degrees) is reading, because the result will be a test value (I'll use 3 degrees) that is passed to the indicator. Plus, as Bill said, you can not set the A:var value, though you could subsequently modify it in some way. Try this.
Code:
<Value>(A:AUTOPILOT YAW DAMPER,bool) 0 == (L:YAW_TEST,number) 2 == &Amp&Amp if{ 3 } </Value>

Regarding your second question.
With superimposed images in the same gauge, the last one to be drawn will be drawn over the first one to be drawn and that is what you will see. You can set the order in which the images are drawn if in different gauges through draw_order in the panel config file. Not sure why you have the same "SWAP.bmp" image in both cases. Means the image will stay the same when you toggle the yaw damper.
Roy
 
Last edited:
Thanks Roy,
I can understand your codes individually and they work individually. But what is the best way to combine them? Or, do I have to keep them as separate elements?
vololiberista
 
This code finally "seems" to work. It was "obviously!" wanting also to see a null function.
vololiberista
Code:
 <Value>(L:YAW_TEST,number) 2 == (A:AUTOPILOT YAW DAMPER,bool) 0 == and } if{ 15 } els{ (L:YAW_TEST,number) 0 == (A:AUTOPILOT YAW DAMPER,bool) 0 == and if{ 0 } els{ Minimum="-8.5" Maximum="4.5" (A:AILERON AVERAGE DEFLECTION,degrees) }</Value>

As regards the other problem of overlaying bmps. It is strangley resolved if the flap is open rather than closed. i.e. the crew is faced with an open flap exposing the buttons. They do their checks and then close the flap!!!
 
Last edited:
Back
Top