• 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 Playing an animation when a key is pressed

Messages
8
Country
netherlands
So im currently making an aircraft and i got all the basic animations like landinggear done. Now im trying to play the canopy animation when a key is pressed.

I found a canopy sim variable but i couldnt find a way to map that to a key. So my plan is to use the `toggle_alternator4` (which i dont use with my aircraft) to open the canopy.

I know the animation works cause i mapped it to a flap key and then it just played.

Code:
    <Animation name="canopy_key"     guid="4b51a100-3542-4478-80c5-254b93b27a2e" length="100" type="Sim" typeparam2="canopy_key" typeparam="AutoPlay" />
    
    <PartInfo>
        <Name>canopy_key</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>GENERAL ENG MASTER ALTERNATOR:4</Variable>
                    <Units>keyframe</Units>
                    <Scale>1</Scale>
                    <Bias>0</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

Any bit of info helps!
 
Messages
151
Country
unitedkingdom
I did use "lever_canopy_open" for FSX and P3D, but that does not seem to be working on my model in MSFS.

Code:
<Animation name="lever_canopy_open" guid="4A513AF9-D409-477f-9195-48211E703961" length="50" type="Sim" typeParam2="lever_canopy_open" typeParam="AutoPlay" />
<PartInfo>
    <Name>lever_canopy_open</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:CANOPY OPEN,percent) 2 /
        </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <TooltipID>TOOLTIPTEXT_CANOPY</TooltipID>
      <Cursor>Hand</Cursor>
      <CallbackCode>
         (&gt;K:TOGGLE_AIRCRAFT_EXIT)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Messages
223
Country
germany
Hey guys any news on this topic here? I'm at the same point at present. Would like to open/clode a hangar door that I build animation actions for.
 
Messages
856
Country
indonesia
try using (A: INTERACTIVE POINT OPEN, Percent) and use native fs2020 xml instead modeldef.xml version
 
Messages
223
Country
germany
Sorry but this doesn't speak to me as I had to dive deeper into coding. Now I anderstand the next level of coding but I'm leaking of documenation. Any suggestion on that?
 
Last edited:
Messages
223
Country
germany
Does anybody have a working example of an event driven animation of a scenery object for like opening doors of hangars or buildings?
 
Messages
151
Country
unitedkingdom
I found that 'switch_canopy' worked to open and close the canopy, but only after I added an exit in the Aircraft Editor, Interactive Points tab.

Code:
<Animation name="switch_canopy"                     guid="873FC11A-74DE-47c0-88B9-B3A21AFEFB76"   length="50" type="Sim" typeParam2="switch_canopy" typeParam="AutoPlay" />
    <PartInfo>
    <Name>switch_canopy</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:switch_canopy_position,number) 50 *
        </Code>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle</MouseFlags>
      <TooltipID>TOOLTIPTEXT_CANOPY</TooltipID>
      <CallbackCode>
        0 (&gt;K:TOGGLE_AIRCRAFT_EXIT) (L:switch_canopy_position) ! (&gt;L:switch_canopy_position)
      </CallbackCode>
    </MouseRect>
    </PartInfo>
 
Messages
223
Country
germany
I found that 'switch_canopy' worked to open and close the canopy, but only after I added an exit in the Aircraft Editor, Interactive Points tab.

Code:
<Animation name="switch_canopy"                     guid="873FC11A-74DE-47c0-88B9-B3A21AFEFB76"   length="50" type="Sim" typeParam2="switch_canopy" typeParam="AutoPlay" />
    <PartInfo>
    <Name>switch_canopy</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:switch_canopy_position,number) 50 *
        </Code>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle</MouseFlags>
      <TooltipID>TOOLTIPTEXT_CANOPY</TooltipID>
      <CallbackCode>
        0 (&gt;K:TOGGLE_AIRCRAFT_EXIT) (L:switch_canopy_position) ! (&gt;L:switch_canopy_position)
      </CallbackCode>
    </MouseRect>
    </PartInfo>
Hi, to be honest I don't know how this is gonna help me find a solution but I'll give it s shot. I haven't done anything with aircraft modelling yet, just airports incl. sceneries. I guess the animation name should be the connection between the animation in the scenery object (hangar) that's referenced by the guid in modelinfo. The ^"switch_canopy_position" ist the connection to the aircraft interactive point tab, correct?
 
Messages
220
Country
canada
I’m experimenting with hangar doors opening and closing depending on distance, which would be nice based on LODs. But first I need the animation to play once and stop. So far I can’t even make it play once and stop, so thinking of triggering would follow… Is there a way to make the animation play once? Here's what I have so far. Animation works, but loops constantly.

XML:
<?xml version="1.0" ?>

    <ModelInfo guid="{42a07289-bac6-4fe7-0fdb-b245856b9a57}" version="1.1">

        <LODS>

            <LOD ModelFile="CYOW_Doors_LOD00.gltf" minSize="50"/>

            <LOD ModelFile="CYOW_Doors_LOD01.gltf"/>

        </LODS>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" name="DoorL1" type="Standard" typeParam="Autoplay"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" name="DoorL2" type="Standard" typeParam="Autoplay"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d02" loop="False" name="DoorL3" type="Standard" typeParam="Autoplay"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d03" loop="False" name="DoorR1" type="Standard" typeParam="Autoplay"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d04" loop="False" name="DoorR2" type="Standard" typeParam="Autoplay"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d05" loop="False" name="DoorR3" type="Standard" typeParam="Autoplay"/>

    </ModelInfo>
 
Top