plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!

question

FlyingRaccoon avatar image
FlyingRaccoon asked Dav3.- edited

Triggering Hangar Door Animation Using SimVar

Hi,
is there any way to trigger animation using SimVar such as:
(A:LIGHT NAV ON, Bool).
The idea is to start the hangar Open animation door when the NAV LIGHT is set to ON and trigger the Close Animation when the NAV LIGHT is set to OFF.

I’ve never tried to use SimVar, so I may have done stupid stuff.
I’ve written some code, but it hasn’t been working so far, can anybody help me?


<?xml version="1.0" encoding="utf-8"?>

<Animation name="LKPR_Door_Default" guid="dc71896e-6cf7-4740-9f22-7e5a1b008a9f" length="2" name="LKPR_Door_Default" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Default" />
<Animation name="LKPR_Door_Open" guid="337194ad-0345-4907-9c59-ec2be2511620" length="900" name="LKPR_Door_Open" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Open" />
<Animation name="LKPR_Door_Closed" guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" length="900" name="LKPR_Door_Closed" type="Sim" typeParam="AutoPlay" typeParam2="LKPR_Door_Closed" />

<AnimGraph> 
   <DefaultState name="LKPR_Door_Default"/>
   <BlendTreeState name="LKPR_Door_Default">
     <Animations>  
       <Animation guid="dc71896e-6cf7-4740-9f22-7e5a1b008a9f" loop ="True" speed="1" />
       <Animation guid="337194ad-0345-4907-9c59-ec2be2511620" loop ="True" speed="1" />
       <Animation guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" loop ="True" speed="1" />
     </Animations>
   </BlendTreeState>
</AnimGraph>

<PartInfo>
   <Name>LKPR_Door_Open</Name>
   <AnimLength>900</AnimLength>
   <Animation>
      <Parameter>
         <Code>(A:LIGHT NAV ON, Bool) 0</Code>
      </Parameter>
   </Animation>
</PartInfo>


<?xml version="1.0" encoding="utf-8"?>

<Animation name="door1" guid="337194ad-0345-4907-9c59-ec2be2511620" type="Standard" />
<Animation name="door2" guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" type="Standard" />

<AnimGraph> 
   <DefaultState name="Anim"/>
   <BlendTreeState name="Anim">
   <Animations>  
      <Animation guid="337194ad-0345-4907-9c59-ec2be2511620" loop ="True" speed="1" threshold="0"/>
      <Animation guid="b9b5e1d3-c686-4791-8b5d-45595938ffc3" loop ="True" speed="1" threshold="0"/>
   </Animations>
   <Value>(A:LIGHT NAV ON, Bool)</Value>
</AnimGraph>

This kind of approach worked, but it only trigger the animation ONCE, if I use the loop=True it never stops, otherwise it only gets called once.

aircraftanimation
1 comment
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered rhumbaflappy commented

@Tailstrike1085, the original poster on MSFS forums


- You should only have one animation for your hangar door, not 3. Just have you door closed at frame 0 and opened at frame 900

- If you want to use the LIGHT NAV ON boolean to control the animation, the code must be (A:LIGHT NAV ON, Bool) 900 * to match you animation length

Regards,
Sylvain

1 comment
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

A better idea might be to allow a hangar door to animate by aircraft proximity to the door, for example at 50 meter distance and heading between -60 and 60 degrees from the face of the door.

This could then also be used to trigger lighting, or any animation or visibility.


0 Likes 0 ·
Dav3.- avatar image
Dav3.- answered Dav3.- edited

Hi,

can't still get it to work,

could you tell me why? Thanks!

1624365495409.png




1624365495409.png (34.4 KiB)
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.