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

MSFS MSFS Door Animation

Hey all,

Can you see what I might be doing wrong on this code, what might be causing it to malfunction?

Code:
    <PartInfo>
     <Name>lhc_lh_door</Name>
        <Animation>
          <Parameter>
            <Code>
         (L:LHC LEFT DOOR HANDLE CONTROL,bool) 1 &gt;
                (A:SIM ON GROUND, bool) 1 == and
        if{ 100 (>L:LHC LEFT DOOR SERVO,number) }
               els{ 0 (>L:LHC LEFT DOOR SERVO,number) }
            </Code>
           <Lag>100</Lag>
          </Parameter>
        </Animation>
    </PartInfo>

Bill
LHC
 
the LHC LEFT DOOR HANDLE CONTROL is used as bool, but you are testing if it will ever be greater than 1, which should will never happen. Or, at least, shouldn't happen, I'm not sure if the sim enforces this and, for example, you could set it to a value larger than 1 somewhere else in your code.
 
Got it working! :)


Code:
        <Animation name="lhc_lh_door_handle" guid="c38073d3-c518-4633-bb12-55e6f7fedca5" length="50" type="Sim" typeParam2="lhc_lh_door_handle" typeParam="AutoPlay" />
        <Animation name="lhc_lh_door" guid="d5541b93-67f9-4c1a-829d-3c397a7e8cf9" length="50" type="Sim" typeParam2="lhc_lh_door" typeParam="AutoPlay" />

    <PartInfo>
      <Name>lhc_lh_door_handle</Name>
        <Animation>
          <Parameter>
            <Code>
               (L:LHC LEFT DOOR HANDLE CONTROL,bool) 100 *
            </Code>
           <Lag>100</Lag>
          </Parameter>
        </Animation>
       <MouseRect>
      <Cursor>Hand</Cursor>
     <TooltipText>Left Door (%((L:LHC LEFT DOOR HANDLE CONTROL,enum))%{case}%{:0}Locked)%{:1}Open)%{End}</TooltipText>
    <MouseFlags>LeftSingle</MouseFlags>
    <CallbackCode>
               (L:LHC LEFT DOOR HANDLE CONTROL,bool) ! (>L:LHC LEFT DOOR HANDLE CONTROL,bool)             
                (L:LHC LEFT DOOR SERVO,bool) ! (>L:LHC LEFT DOOR SERVO,bool)
    </CallbackCode>
    </MouseRect>
    </PartInfo>
    
    <PartInfo>
     <Name>lhc_lh_door</Name>
        <Animation>
          <Parameter>
            <Code>
        (L:LHC LEFT DOOR SERVO,bool) 100 *
            </Code>
           <Lag>100</Lag>
          </Parameter>
        </Animation>
    </PartInfo>
 
Top