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

Part Code Problem

Messages
10,149
Country
us-arizona
Hey guys,

Can you spot the reason why this gauge 'part' code for FSX XML Gmax is not functioning?

Its a custom animation as you can see.




Code:
    <PartInfo>
        <Name>door_seal_switch</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Code>(L:Rotate Door Seal Switch,bool) 100 *  </Code>
                    <Units>percent</Units>
                    <Scale>1</Scale>
                </Sim>
                <Lag>100</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
      <CallbackCode>  
    (L:Rotate Door Seal Switch,bool) ! (>L:Rotate Door Seal Switch,bool)  
      </CallbackCode>  
        </MouseRect>
    </PartInfo>

I am curious to know what it is, as I used one of the stock FSX custom animations to base this one, and it wont work. :eek:
 
You are mixing <sim> and <code> sections together.

If you are using code script you don't need the sim, scale or units entries.

Try reducing down to just:
<Parameter>
<code> xxxxxxxxxx </code>
</Parameter>
 
I was able to track down a code by Fr. Bill at FFDS. Brilliant code. Appears that <Code> must be on two seperate lines from the actual code string or it flags a fake Syntax error.

Here is a sample L:var part code which can be used for almost anything.


Code:
<PartInfo>
	  <Name>emerg_gear_door</Name>
	  <AnimLength>100</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:Emerg Gear System,number) 100 *
		    </Code>
		    <Lag>40</Lag>
		</Parameter>
	  </Animation>
	  <MouseRect>
		<Cursor>Hand</Cursor>
		<TooltipText>Emerg Gear System</TooltipText>
		<CallbackCode>(L:Emerg Gear System,number) ! (&gt;L:Emerg Gear System,number)</CallbackCode>
	  </MouseRect>
    </PartInfo>

For mathmatical calculations, use Sim in the GUID (upper title string) otherwise use 'Standard' for all other 'basic' animations. In this one, math is present, so I used Sim as the type in the GUID and it works well.


Bill
 
Last edited:
Back
Top