• 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 Code Question

Messages
683
Country
us-california
I have written the following code to "animate" window blinds. It is working, but upon loading the plane the first visibility part which should be visible is not. After cycling the animation everything else is working properly, and upon return to the 0 position the "missing" part is there, and it works fine after that.

Any ideas? :confused:

PHP:
<PartInfo> 
      <Name>Blind_Adjust01</Name> 
      <AnimLength>30</AnimLength> 
         <Animation>
            <Parameter> 
                  <Code>(L:Blind_Adjust01,enum) 10 * </Code> 
            </Parameter> 
      </Animation> 
      <MouseRect>
		<Cursor>Hand</Cursor>
		 <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
			<CallbackCode>
			(M:Event) 'LeftSingle' scmp 0 ==			
				if{ (L:Blind_Adjust01, enum) ++ 3 min (>L:Blind_Adjust01, enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ (L:Blind_Adjust01, enum) -- 0 max (>L:Blind_Adjust01, enum) }				
			(L:Blind_Adjust01,enum) 0 == if{ 1 (>L:Blinds01_0,bool) } els{ 0 (>L:Blinds01_0,bool) }
            (L:Blind_Adjust01,enum) 1 == if{ 1 (>L:Blinds01_10,bool) } els{ 0 (>L:Blinds01_10,bool) }
            (L:Blind_Adjust01,enum) 2 == if{ 1 (>L:Blinds01_20,bool) } els{ 0 (>L:Blinds01_20,bool) }
            (L:Blind_Adjust01,enum) 3 == if{ 1 (>L:Blinds01_30,bool) } els{ 0 (>L:Blinds01_30,bool) }				
			</CallbackCode>
		</MouseRect>
   </PartInfo> 
     
<PartInfo> 
   	<Name>Blinds01_0</Name>
    	<Visibility>
           	<Parameter>
      		<Code>(L:Blinds01_0,bool) 0 > if{ 1 } els{ 0 }</Code>
           	</Parameter>
    	</Visibility>
</PartInfo>
 
PHP:
...
<PartInfo> 
   	<Name>Blinds01_0</Name>
    	<Visibility>
           	<Parameter>
      		<Code>(L:Blinds01_0,bool) 0 > if{ 1 } els{ 0 }</Code>
           	</Parameter>
    	</Visibility>
</PartInfo>


Try to replace
PHP:
<Code>(L:Blinds01_0,bool) 0 > if{ 1 } els{ 0 }</Code>

with
PHP:
<Code>(L:Blind_Adjust01,enum) 0 == if{ 1 } els{ 0 }</Code>
 
Last edited:
That did it. I did need to adjust your code for spacing & capitalization, but your root idea was sound.

Many Thanks, Luka! :wave:
 
Back
Top