• 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 FS9 XML; Flowing Animation Shift

Messages
10,088
Country
us-arizona
Hey all,

I am trying to make a Image 'appear' and 'flow through' a Mask. Image appears, and immediately it is moving, flowing downwards, for a certain period of time, (very long image), and then disappears.

I am not able to get it to work. I have been going through the code you guys blessed me with a while back, but seem to be missing something.

So that you invision it better, its like a page of code during a PFD boot up sequence. A flood of code poors downwards as the system boots up. The image is gauge code (Bitmap, tall, like an Altimeter tape or ASI tape in a PFD).

The Boot up screen works awesome. Thanks Bill Leaming. Now I am adding to it and adding this tape (Code Flow Element).

This is what I have for the animation part;

Code:
    <Element Name="CODE FLOW">
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
        <Position X="20" Y="0"/>
               <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680"/>
               <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576"/>
                    <Shift>
                          <Value Minimum="0" Maximum="300">0 300 (L:3308CODE FLOW Time,enum) rng if{
                             (L:3308CODE FLOW SHIFT,enum) -- (>L:3308CODE FLOW SHIFT,enum)
                          </Value>
                      <Scale Y="4"/>
                   </Shift>
    </Element>

And this is the entire code section that runs the visibility, etc, which I do not think I really need, as I am running it off the Boot screen system, which is identical, without the CodeFlow.
I am wondering if I can run the Shift animation off of the Bootup timer?

This is the Code Flow entire section;

Code:
<!-- CODE FLOW  SCREEN -->
     <!-- Initialize all variables when power is OFF -->
    <Element>
       <Select>
        <Value>
        (A:Avionics Master Switch,bool) 0 == (A:Electrical Master Battery,bool) 0 == || if{
        0 (>L:3308CODE FLOW Screen,enum)
        0 (>L:3308CODE FLOW Time,enum)
        0 (>L:3308CODE FLOW SHIFT,enum) }
        </Value>
       </Select>
    </Element>

     <!-- Start timer and increment when both battery and avionics are ON -->
    <Element>
       <Select>
        <Value>
        (A:Avionics Master Switch,bool) (A:Electrical Master Battery,bool) and (L:3308CODE FLOW Time,enum) 300 &lt;= and
        if{ (L:3308CODE FLOW Time,enum) ++ (>L:3308CODE FLOW Time,enum) 1 (>L:3308CODE FLOW Screen,enum) }
        </Value>
       </Select>
    </Element>

     <!-- Stop timer after 20 seconds -->
    <Element>
       <Select>
        <Value>
        (L:3308CODE FLOW Time,enum) 300 > if{ 0 (>L:3308CODE FLOW Screen,enum) }
        </Value>
       </Select>
    </Element>

     <!-- AAA While the "CODE FLOW screen" variable is ON and battery is ON, display the CODE FLOW screen bitmap -->
    <Element>
        <Visible>(L:3308CODE FLOW Screen,enum) 1 == </Visible>
         <Position X="0" Y="0"/>
        <Image Name="SYROS_PFD_CODE FLOW UP.bmp" ImageSizes="1500,681" Bright="Yes">
        </Image>
    </Element>


     <!-- CCC While the "CODE FLOW screen" variable is ON and battery is ON, display the CODE FLOW screen bitmap -->

    <Element Name="CODE FLOW">
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
        <Position X="20" Y="0"/>
               <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680"/>
               <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576"/>
                    <Shift>
                          <Value Minimum="0" Maximum="300">0 300 (L:3308CODE FLOW Time,enum) rng if{
                             (L:3308CODE FLOW SHIFT,enum) -- (>L:3308CODE FLOW SHIFT,enum)
                          </Value>
                      <Scale Y="4"/>
                   </Shift>
    </Element>

I think there should be a terribly basic way of writing this, I would think. I do not wish to use a Update section for the timer. Its only used in the Bootup section and that uses a timer also, so I wish to use this in this section of the code to simplify things.

Bob, I think you helped me with this months ago, showing me a sample of code you gave me (if you sent me this) which has many animations. For some reason, I cannot seem to put this into a working plan in this way.

Flow direction is Y axis, downwards.

Any suggestions? Can you see what I am doing wrong?
 
Messages
10,088
Country
us-arizona
What I could do is use the Bootup screen 'visible' code string for this as its trigger and 'visibility' control. That should simplify it. But how to make it 'zip along' when it starts/appears, then shuts down? Would the timer be done outside of this code block, or can I put it right inside the code block?

Forgive me for not seeing how it works. Using this in a 'shift' and making it animate is just not coming to me for some reason.

Also, I am guessing that using -- will cause it to run downwards instead of upwards? or... would that be upwards instead of downwards? X-flow...
 
Messages
10,088
Country
us-arizona
Ok, whew... A little progress. Got one working. I am really rough when it comes to coding, lol.. I love poly bending and painting, but coding is difficult for me.

This is working, but the very long graphics strip starts at its top for some reason. I put in an axis to correct this, starting at Y=3000, but that did nothing.

Code:
<Element Name="Text Shift">
        <Visible>(L:3308BootTime,enum) 200 &lt;</Visible>
    <Position X="50" Y="0"/>
               <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680"/>
               <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576"/>
         <Axis X="0" Y="3000"/>
        <Shift>
            <Value>(L:TextShift, number) ++ (>L:TextShift, number) (L:TextShift, number)</Value>
            <Scale Y="8"/>                       
        </Shift>
</Element>
 
Messages
10,088
Country
us-arizona
This didnt seem to work either, starting from the top and running out. It needs to start at the bottom so that you see it flowing for a while.
I tried axis starting at 3500, didnt work.
I tried axis starting at 500, didnt work. The mask opening is about 680 high, the strip is over 3500 tall. Axis should be at 3500, I would think. Then you see the bottom slide past through the middle to the top. Instead, you see the top at the top start and fall through and its gone. You only see a bit of the top of the tape.

This uses parts from the Altimeter tape from the FS9 747

Code:
<Element Name="Text Shift">
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
    <Position X="50" Y="0"/>
               <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680"/>
               <Axis X="0" Y="0"/>
               <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576"/>
               <Nonlinearity>
                  <Item Value="0" X="0" Y="0"/>
                  <Item Value="200" X="0" Y="3573"/>
               </Nonlinearity>
        <Shift>
            <Value>(L:TextShift, number) ++ (>L:TextShift, number) (L:TextShift, number)</Value>
            <Scale Y="8"/>                       
        </Shift>
</Element>
 
Messages
440
Country
us-wisconsin
Maybe give this a try.. I really don't like masks & without looking at the bitmaps to test / calculate it is more difficult.

If it flows from top to bottom then, with the axis at 0,0, & values going 0 to 200 -->
<Item Value="0" X="0" Y="0"/>
<Item Value="200" X="0" Y="3573 minus the Y size of the mask image "hole""/>

If it flows from bottom to top then, with the axis at 0,0, & values going 0 to 200 -->
<Item Value="0" X="0" Y="3573 minus the Y size of the mask image "hole""/>
<Item Value="200" X="0" Y="0"/>

After that you shouldn't use <Scale Y="z"/> at all because you are now defining the start and end coordinates vs. values already.
Then.. Depending on the width of the upper "picture frame" portion of the mask image you may have to
adjust the Y parameter of the axis assignment for slight adjustments --> <Axis X="0" Y="0"/>
 
Messages
10,088
Country
us-arizona
Huhhh... Still nothing. Thanks though, Roman.

I compared with with an Altimeter tape and saw I didnt have my Mininum / Maximum in the Value section. Added that, no joy. Still refuses to start at the bottom of the texture tape.

Its like the texture were only 688 high, and I just double checked and yep, its 3576 high. So its not that. I wonder what in the world it is?

I removed Axis from Mask, nothing.
I removed Axis from the tape section image, stopped the animation.
I removed Y scale, stopped the animation, broke the gauge
I made the Y scale zero, stopped the animation.

Posting it here again..

Code:
<Element Name="Text Shift">
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
            <Position X="50" Y="0"/>
               <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680"/>
         <Axis X="0" Y="3000"/>
               <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576"/>
         <Axis X="0" Y="3000"/>
               <Nonlinearity>
                  <Item Value="0" X="0" Y="3000"/>
                  <Item Value="200" X="0" Y="0"/>
               </Nonlinearity>
        <Shift>
            <Value Minimum="0" Maximum="400">(L:TextShift, number) ++ (>L:TextShift, number) (L:TextShift, number)</Value>
         <Scale Y="1.7375"/>
        </Shift>
</Element>
 
Messages
10,088
Country
us-arizona
odd... I just went through and removed Axis from both sections, no Axis in the Element, and its animating, but still no joy in 'full' 3500 animation. It starts from the very top instead of the bottom.

I also tried flipping the Min Max to 0 start, 3000 end. Same animation. Like as though this Element is not doing anything. Something in here is telling it to start at its top.
 
Messages
10,088
Country
us-arizona
I got it working!!!! :)

I copy/pasted the Altimeter tape Element from one of my older Garmin G1000's (Basically the FS9 747 PFD Altimeter) and put in my own textures and settings and it worked.

I am coding with Windows Notepad (dont laugh). I think it puts in or reuses hidden symbols which V4 catches and Notepad doesnt show. That may have done it.

IT WORKS!!!!!!!!!! woo hoooo!

Oddly, now Y scale has a reverse setting. 0.23423 is slow, and 3.xxxx is fast...
 
Messages
10,088
Country
us-arizona
Ok, now its 'completely' working great.

Reset start point at 500+ so most of the tape is already showing. The above code was showing it start out of the top, not full screen.

Code reset, working (for future viewers that might wish to use this).

Code:
     <Element>
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
            <Position X="50" Y="0"/>
            <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680">
               <Axis X="0" Y="0"/>
            </MaskImage>
            <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576">
               <Nonlinearity>
                  <Item Value="0" X="0" Y="3000"/>
                  <Item Value="200" X="0" Y="500"/>
               </Nonlinearity>
            </Image>
            <Shift>
               <Value Minimum="0" Maximum="200">(L:TextShift, number) ++ (>L:TextShift, number) (L:TextShift, number)</Value>
         <Scale Y="0.7375"/>
            </Shift>
         </Element>
 
Messages
10,088
Country
us-arizona
Because of jitters, a mini half second end pause, being hidden between bitmaps for a moment as the OS boots to life, I adjusted it more.

Code:
     <Element>
        <Visible>(L:3308BootScreen,enum) 1 == </Visible>
            <Position X="50" Y="0"/>
            <MaskImage Name="CodeFlowMask.bmp" Bright="Yes" ImageSizes="490,680">
               <Axis X="0" Y="0"/>
            </MaskImage>
            <Image Name="CodeFlow.bmp" Bright="Yes" ImageSizes="500,3576">
               <Nonlinearity>
                  <Item Value="0" X="0" Y="3000"/>
                  <Item Value="220" X="0" Y="0"/>
               </Nonlinearity>
            </Image>
            <Shift>
               <Value Minimum="0" Maximum="220">(L:TextShift, number) ++ (>L:TextShift, number) (L:TextShift, number)</Value>
         <Scale Y="1.7375"/>
            </Shift>
         </Element>
 
Messages
10,088
Country
us-arizona
It just came to me... What in the world is causing this animation to start? It has no trigger. Is the trigger simply from the sim starting? Booting up into the sim? Its been starting on its own when I boot up the or click the 'reload aircraft'. The animation starts. So my humble guess is that it starts when the sim does. Luckily, it happened to be when I need it to operate and start.

So my thoughts are, to 'start' it outside of a bootup, one might write;
Click.... (L:TextShift, number) ++ (>L:TextShift, number) /Click.....
 
Messages
10,088
Country
us-arizona
Sorry for all the questions... but another idea comes to mind. Can one 'loop' a shift animation that is flowing over a Mask? Can you start a duplicate? (Compass?)
 
Messages
440
Country
us-wisconsin
A modulo should do the loop for you. You may want to find an escape though.
<Value Minimum="0" Maximum="220">(L:TextShift, number) ++ 221 % (>L:TextShift, number) (L:TextShift, number)</Value>
 
Messages
10,088
Country
us-arizona
Modulo!!!! I havent heard that one in quite a long time. I remember it was a big topic here years ago. Going to check this out.

Many thanks, Roman!
 

DragonflightDesign

Resource contributor
Messages
1,088
Country
northernireland
Also; it's definately not Notepad causing the problem. Notepad is incredibly useful for removing ASCII characters that you really don't wany cluttering up your code. Old coder's trick we use at work a lot.
 
Messages
10,088
Country
us-arizona
Thanks to Spokes2112 (Roman) and Bjoern for a way to do this.

Code:
// SLIDER ANIMATION QUANTUM GENERATOR RIGHT
    <Element>
    <Visible>(L:3307PAGE TWO Screen,enum) 1 ==</Visible>
               <Position X="1357" Y="383"/>
            <MaskImage Name="Bar_Mask.bmp" Bright="Yes" ImageSizes="69,210">
               <Axis X="0" Y="210"/>
            </MaskImage>
               <Image Name="Bar_Energy.bmp" Bright="Yes" ImageSizes="69,210"/>
        <Shift>
            <Value>(L:QUANTUM SYSTEM RH,bool) (A:CIRCUIT GENERAL PANEL ON, bool) and
                                    if{ 1 } 
                                 els{ (L:QUANTUM SYSTEM RH,bool)
                                             if{ 0 (>L:QUANTUM SYSTEM RH,bool) } 0 }
            </Value>
            <Scale Y="-199"/> 
            <Delay PixelsPerSecond="5"/>
        </Shift>
    </Element>

Animates lovely... :)
 
Top