• 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.

FSX Animated Rolling Drum Counter

Messages
6
Country
japan
Good mooning / afternoon / evening ,

I'm trying to make an Autopilot Altitude Selector Collins PRE80C.
I have almost done.
However , there is only one problem for the movement of DRUM-COUNTERS.

I wrote the following code , for a long tape style number card.
It can work completely 0 to 9 , and smooth rolling animation effect.
But , from 9 to 0 , or , down from 0 to 9 , it changes in an instant , without animation.
What's wrong in my code ?

many thanks

Code:
<Element>
<Position X="0" Y="0" />
<MaskImage Name="PRE80C_MASK.bmp">
<Axis X="269" Y="125" />
</MaskImage>
<Image Name="PRE80C_TAPE_L.bmp">
<Axis X="0" Y="610" />
</Image>
<Shift>
<Value Minimum="0" Maximum="9">(A:Autopilot Altitude Lock Var,feet) 100 / flr 10 % </Value>        
<Nonlinearity>
<Item Value="0"    X="0"    Y="0"/>
<Item Value="9"  X="0"    Y="480"/>
</Nonlinearity>
<Delay PixelsPerSecond="400"/>
</Shift>
</Element>
 

Attachments

  • PRE80C.jpg
    PRE80C.jpg
    28.5 KB · Views: 228
Thank you for your reply.
I tried your method , however , the operation did not improve.
Please watch the video , and pay attention to the change of indication from 9 to 0 ,or from 0 to down 9.
Any other numbers are OK.


Code:
<Element>
<Position X="0" Y="0" />
<MaskImage Name="PRE80C_MASK.bmp">
<Axis X="269" Y="125" />
</MaskImage>
<Image Name="PRE80C_TAPE_L.bmp">
<Axis X="0" Y="610" />
</Image>
<Shift>
<Value Minimum="0" Maximum="9.99">(A:Autopilot Altitude Lock Var,feet) 100 / flr 10 % </Value>      
<Nonlinearity>
<Item Value="0"    X="0"    Y="0"/>
<Item Value="9.99"  X="0"    Y="531"/>
</Nonlinearity>
<Delay PixelsPerSecond="400"/>
</Shift>
</Element>

I don't know what the problem is.
 
That looks like the altitude selector in the King Air.
Your video is disabled so I'm still not sure what you're seeing.
This is my King Air altitude selector;

XML:
<Gauge Name="Altimeter Selector" Version="1.0">
<Image Name="Altimeter_Selector_Background.bmp"/>

<!-- 10,000' -->
<Element>
  <Position X="43" Y="23"/>
  <MaskImage Name="Altimeter_Selector_Mask.bmp">
    <Axis X="1" Y="9"/>
  </MaskImage>
  <Image Name="Altimeter_Selector_10000.bmp">
    <Nonlinearity>
      <Item Value="0" X="0" Y="170"/>
      <Item Value="9" X="0" Y="7"/>
    </Nonlinearity>
  </Image>
  <Shift>
    <Value>(A:AUTOPILOT ALTITUDE LOCK VAR,Feet) 0 max  s1 10000 / 10 % flr l1 10000 % 9999 &gt; if{ l1 10 % 9 - + }</Value>
  </Shift>
</Element>

<!-- 1,000' -->
<Element>
  <Position X="43" Y="23"/>
  <MaskImage Name="Altimeter_Selector_Mask.bmp">
    <Axis X="15" Y="9"/>
  </MaskImage>
  <Image Name="Altimeter_Selector_1000.bmp">
    <Nonlinearity>
      <Item Value="0" X="0" Y="167"/>
      <Item Value="9" X="0" Y="22"/>
    </Nonlinearity>
  </Image>
  <Shift>
    <Value>(A:AUTOPILOT ALTITUDE LOCK VAR,Feet) 0 max  s1 1000 / 10 % flr l1 1000 % 999 &gt; if{ l1 10 % 9 - + }</Value>
  </Shift>
</Element>

<!-- 100' -->
<Element>
  <Position X="43" Y="23"/> 
  <MaskImage Name="Altimeter_Selector_Mask.bmp">
    <Axis X="29" Y="10"/>
  </MaskImage>
  <Image Name="Altimeter_Selector_1000.bmp">
    <Nonlinearity>
      <Item Value="0" X="0" Y="167"/>
      <Item Value="9" X="0" Y="22"/>
    </Nonlinearity>
  </Image>
  <Shift>
    <Value>(A:AUTOPILOT ALTITUDE LOCK VAR,Feet) 0 max  s1 100 / 10 % flr l1 100 % 99 &gt; if{ l1 10 % 9 - + }</Value>
  </Shift>
</Element>

<!-- Steady Light -->
<Element>
  <Position X="16" Y="25"/>
  <Visible>(L:Batt Av On,Number) 1 == (L:Altimeter_Select,Bool) 0 == &amp;&amp; if{ (A:AUTOPILOT ALTITUDE LOCK VAR,Feet) (A:INDICATED ALTITUDE,Feet) - abs sp0 300 1000 l0 rng</Visible>
  <Image Name="Altimeter_Selector_Alerter.bmp"/>
</Element>

<!-- Flashing light -->
<Element>
  <Position X="16" Y="25"/>
  <Visible>(L:Batt Av On,Number) 1 == if{ (A:AUTOPILOT ALTITUDE LOCK VAR,Feet) (A:INDICATED ALTITUDE,Feet) - abs sp0 40 60 l0 rng if{ (E:ABSOLUTE TIME,Seconds) 0.25 % 0.125 > ! } }</Visible>
  <Image Name="Altimeter_Selector_Alerter.bmp"/>
</Element>

<!-- Reset Cancel -->
<Element>
  <Position X="16" Y="25"/>
  <Visible>(A:AUTOPILOT ALTITUDE LOCK VAR,Feet) (A:INDICATED ALTITUDE,Feet) - abs 20 &lt; if{ 0 (&gt;L:Altimeter_Select,Bool) }</Visible>
  <Image Name="Altimeter_Selector_Alerter.bmp"/>
</Element>

<Mouse>
  <Area Top="20" Bottom="50" Left="15" Right="40">
    <Tooltip>Altitude Alerter</Tooltip>
    <Cursor Type="Hand"/>
    <Click>1 (&gt;L:Altimeter_Select,Bool)</Click>
  </Area>
  <Area Top="20" Bottom="50" Left="45" Right="70">
    <Tooltip>Altitude Select Decrease</Tooltip>
    <Cursor Type="DownArrow"/>
    <Click Event="AP_ALT_VAR_DEC" Repeat="Yes"/>
  </Area>
  <Area Top="20" Bottom="50" Left="70" Right="100">
    <Tooltip>Altitude Select Increase</Tooltip>
    <Cursor Type="UpArrow"/>
    <Click Event="AP_ALT_VAR_INC" Repeat="Yes"/>
  </Area>
</Mouse>

</Gauge>

There are differences between our coding. Try mine, see if it's amy better.
 
The video is disabled from viewing in this forum. You can view it if you click the YouTube link on it.
 
Most likely it's the <Delay PixelsPerSecond="400"/>
That's what I think too.
Now, if you would closely study the video, you will see that decreasing the alt setting behaves differently then when increasing. Like when going back from 0.9 to 0.8 (flashing numbers in between).
But that's difficult to tell; what happens if you use a pixeldelay of 40 ??

Another thing: (to the OP)
You code sniplet doesn't show the 1000 dial code.
If you use simular (duplicate) code with Delay for that, that surely won;t work. Because the 100 and 1000 dials are animated independantly then.
Which would give a visual problem when you increase/decrease the AP Alt var fast.
But without the full (display and click) code and taper/mask bitmaps, I'm just guessing ....

With only the original code in post-1 available, for just the 100 dial, I would expect to behave the dial even differently:
OK for 1 to 9, but from 9 to 0 (0.9 to 1.0), I would expect the 100 dial to slowly (10 times the expected delay) animate from 9, 8, .... back to 0, as dictated by the DelayPixel line.
But again, just guessing here without seeing all of the code/bitmaps.

What might solve your problem:
Use a taper bitmap with values 0,0 0,1 ....... 0,9 1,0 1,1 ..... etc. avoids the Delay independancy between the 100 and 1000 dial.

But even then, the "Delay PixelsPerSeconds" won't work correctly always IMO:
(that is: if you use the events AP_ALT_VAR_INC and AP_ALT_VAR_DEC in your click code, with Repeat).
Because of the inherant "accelleration" function of these events, the "Delay PixelsPerSeconds" may cause a huge lag between actual value and displayed (animated by the Delay) value.

What I would do (if I correctly understand what you want to achieve):
- Control the intended Alt setting by incr/decr of an Lvar, and write (at each, repetitive click, change) this Lvar value to AP_ALT_VAR_SET_ENGLISH.
- Use a second Lvar (the above Lvar, increasing/decreasing with a fixed, timed delay) as Value in the Shift code of the taper bitmap.

I haven't studied Chris' code above, but that may work as well. More 'ways to Rome' .....LoL
Main difference is, that I myself don't like to use events AP_ALT_VAR_INC and AP_ALT_VAR_DEC, because of their inherent, and sometimes unpredictable 'control acceleration behavior' ).
A matter of design taste ....LoL

Hope you have enough tips now.
But I assume it's clear now that using "Delay PixelsPerSeconds" isn't the right way to go for a smooth 100/1000 feet rolling drum ...

Cheers, Rob
 
Last edited:
Back
Top