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

xml units fsx

Messages
10
Country
france
Hello every body

i should like to know why the unit "percent" do not work with the variable "L"
i have made a full animation :

<PartInfo>
<Name>switch_sparrow</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:switch_sparrow,bool) 50 *
</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>(L:switch_sparrow,bool) ! (>L:switch_sparrow,bool) ! (>L:sparrow1,percent) </CallbackCode>
</MouseRect>
</PartInfo>


<PartInfo>
<Name>sparrow1</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:sparrow1,percent) 100 *
</Code>
</Parameter>
</Animation>
</PartInfo>



the sparrow is linked to ghost and ghost must not been visible at the end of the animation ( 95 percent)



<PartInfo>
<Name>ghost</Name>
<Visibility>
<Parameter>
<Code>(L:sparrow1,percent) 95 &gt; if{ 0 } els{ 1 } </Code>
</Parameter>
</Visibility>
</PartInfo>

It's not ok but if the code is :

<PartInfo>
<Name>ghost</Name>
<Visibility>
<Parameter>
<Code>(L:sparrow1,percent) 0 &gt; if{ 0 } els{ 1 } </Code>
</Parameter>
</Visibility>
</PartInfo>

It's ok
ghost is not visible but there is no time.

if the code is for example

<PartInfo>
<Name>ghost</Name>
<Visibility>
<Parameter>
<Code>(A:Turb eng1 CORRECTED N1, percent) 95 &gt;; if{ 0 } els{ 1 } </Code>
</Parameter>
</Visibility>
</PartInfo>


it's ok !
with "A" and "percent" no problem and with "L" my own code it'do not work , if anyone know and can help me ? Thank you :(
 
hi
no awnser ? i need help just to know if the unit percent can be use with "L" because it's not good in my gauge.

"Visibility in Range" do not work unfortunately.Thanks
 
You cannot use "percent" as a unit value the way your script is structured, since you have it set up to have only a value of zero (0) or one (1).

"Percent" requires that you have a possible range of values from zero (0) to one (1), or more typically zero (0) to one-hundred (100).
 
Hi n4gix
thank you for your answer.

<CallbackCode>(L:switch_sparrow,bool) ! (>L:switch_sparrow,bool) ! (>L:sparrow1,percent) </CallbackCode>
! (>L:sparrow1,percent) is the animation with key 0 to 100 it ' s not good to use the unit percent ? or must i write mini 0 max 100 ;
sorry but i don't see very well. :)
 
The problem is that this:

(>L:sparrow1,percent)

doesn't actually do anything except toggle the value from zero to one! :eek:

So, it should be a bool type, not a percent.
 
Thank you.

then ;how to do to get the percent unit with the animation ?
is it impossible ? the only way is realy toggle zero to one ?
 
That's what the 100 * is for!

When the value of your L:variable is made ONE, the result is multiplied by 100, so that you now have a range of 0 to 100.

The <Lag> entry controls the SPEED of the animation. Lower number equals slower animation... :cool:

Code:
<PartInfo>
   <Name>sparrow1</Name>
   <AnimLength>100</AnimLength>
   <Animation>
      <Parameter>
         <Code>
           (L:sparrow1,bool) 100 * 
         </Code>
         <Lag>100</Lag> 
      </Parameter>
   </Animation>
</PartInfo>
 
The <Lag> entry controls the SPEED of the animation. Lower number equals slower animation...


thank you bill; that i know , but if you read my question ,the problem is why the sparrow1 is always visible at the end of animation ,
sparrow1 is linked to ghost, how must i write the code ? with <Visibility> only {0} and {1} work (but man cannot see the animation) and with <visibleinrange> it 's not ok.
With FS9 SDK no problem using <visibleinrange>i get a timing.
 
First of all, because your (L:sparrow1,bool) variable can ONLY be zero or one!

You will need to add some script to your "sparrow1" such that a "counter" will increment or decrement (L:sparrow1,number) from zero to one-hundred range:

Code:
<PartInfo>
   <Name>sparrow1</Name>
   <AnimLength>100</AnimLength>
   <Animation>
      <Parameter>
         <Code>
           (L:switch_sparrow,bool 1 ==
           (L:sparrow1,number) 100 &lt;
           and
             if{
                 (L:sparrow1,number) 1 + (>L:sparrow1,number)
               } 

           (L:switch_sparrow,bool 0 ==
           (L:sparrow1,number) 0 &gt;
           and
             if{
                 (L:sparrow1,number) 1 - (>L:sparrow1,number)
               } 
         </Code> 
      </Parameter>
   </Animation>
</PartInfo>

<PartInfo>
   <Name>switch_sparrow</Name>
   <AnimLength>100</AnimLength>
   <Animation>
      <Parameter>
         <Code>
            (L:switch_sparrow,bool) 100 * 
         </Code> 
      </Parameter>
   </Animation>
<MouseRect>
   <Cursor>Hand</Cursor> 
   <CallbackCode>
      (L:switch_sparrow,bool) ! (>L:switch_sparrow,bool)
   </CallbackCode>
</MouseRect> 

<!-- NOW you can control "ghost" visibility for > 95  -->

<PartInfo>
   <Name>ghost</Name>
   <Visibility>
      <Parameter>
         <Code>
            (L:sparrow1,number) 95 &gt; if{ 0 } els{ 1 }
         </Code> 
      </Parameter>
   </Visibility>
</PartInfo>
 
Hi


you have good idea; i have tried your code , unfortunately

with :

<Name>sparrow1</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:switch_sparrow,bool 1 ==
(L:sparrow1,number) 100 &lt;
and
if{
(L:sparrow1,number) 1 + (>L:sparrow1,number)
}

(L:switch_sparrow,bool 0 ==
(L:sparrow1,number) 0 &gt;
and
if{
(L:sparrow1,number) 1 - (>L:sparrow1,number)
}
</Code>
</Parameter>
</Animation>
</PartInfo>


the sparrow1 is not animated when i "clic " on the switch ;maybe you have forgotten something ? it's not easy ,but
happy, you are here to help me ! :)
 
Back
Top