• 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 Triggering Hangar door animation in SimObject by distance?

Messages
233
Country
canada
maybe to open the hangar by distance you can use this simulation variables

IF the plane coordinate are the same, so the hangar opens

Simulation Variables
The link is to 2008 SDK, so not sure it works in MSFS. If it does, the precision may not make it possible. It won't ever be equal unless the plane is in exactly the same position, and I believe all objects use the same coordinate system, so it's very precise, probably less than a meter precise.

I will test a few of proposed theories when I have time. First one is the simplest LOD-based animation: 2 LOD models, opening and closed doors. I waht to find out the following:

- Can animation specified separately for different LOD models?
- If not, if there is one animation specified fo all LOD models, what if they have different animations with the same name? LOD0 can have opening, LOD1 - closing.
- Is animation with loop=false triggered only once at the farthers LOD, or is it triggered every time new LOD model loads? If it's the latter, this would work well. If former, LOD based hangar doors are impossible. I will then see what I can do with SimObject, including plane position variables...
 
Messages
255
Country
germany
Well I will use something that's applicable to all hagars on all airports. That will be the DistanceToNotAnimate in the sim.xml of the simobject. I made a trial with the standard object Flag_Ignite and it worked phantastic. I hope this will work for my animation as well. So to le you know where I'm struggeling at present.
1) I have a working hangar model with 6 door segments "Lamelle1....Lamelle6".
2) If I put them in my modeldef as anim type="Standard" (not sim), the doors are closed from their default state being open and than they continue opening and closing as the standard repeats the animation in a loop.
3) If I put them in my modeldef as anim type="Sim" and use the <Visibility.../> I can hide the simulation with it's doors completely by using code that's using false state of a sim variable or local.
4) If I'm using the <Animation.../> there are only the opened 6 door segments but they are not animated no matter what variable I use or whatever I change in the coding.
 
Messages
255
Country
germany
So my plan for this morning is to find out more about the <Animation.../> stuff in the documentation. I saw the doc was outdated but most of it worked in the first place so I continued. But now I thing I crossed the boarder. So I'll restart from current SDK documenation again as I assume it's a metter of that.
 
Messages
255
Country
germany
Ok, I give up due to an information I got out of the documentation, that material based animations are going to be a matter of change. Nothing except the standard autoplay function is working. What's perfectly working is the approaching function.
 
Messages
233
Country
canada
Ok, I give up due to an information I got out of the documentation, that material based animations are going to be a matter of change. Nothing except the standard autoplay function is working. What's perfectly working is the approaching function.
What do you mean by approaching function?
 
Messages
233
Country
canada
OK, so this works for just having a door animation run once:
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" name="DoorL1" type="Standard" typeparam2="DoorL1" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorL2" type="Standard" typeparam2="DoorL2" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d02" name="DoorL3" type="Standard" typeparam2="DoorL3" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d03" name="DoorR1" type="Standard" typeparam2="DoorR1" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d04" name="DoorR2" type="Standard" typeparam2="DoorR2" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d05" name="DoorR3" type="Standard" typeparam2="DoorR3" />

       <AnimGraph>
           <DefaultState name="CYOW_Doors_blend"/>
               <BlendTreeState name="CYOW_Doors_blend">
                <Animations>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d02" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d03" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d04" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d05" loop="False" speed="1.0"/>
                </Animations>
            </BlendTreeState>
        </AnimGraph>

    </ModelInfo>

Now how to trigger it? Let's say by a taxi light. Does it have to be a simObject, or does regular object have ability to be triggered? If so, how would the code work? Can't find anything useful in SDK documentation... Also, need to figure out how to make different animations for the same objects in Blender, so they can be triggered...
 
Messages
255
Country
germany
OK, so this works for just having a door animation run once:
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" name="DoorL1" type="Standard" typeparam2="DoorL1" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorL2" type="Standard" typeparam2="DoorL2" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d02" name="DoorL3" type="Standard" typeparam2="DoorL3" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d03" name="DoorR1" type="Standard" typeparam2="DoorR1" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d04" name="DoorR2" type="Standard" typeparam2="DoorR2" />
        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d05" name="DoorR3" type="Standard" typeparam2="DoorR3" />

       <AnimGraph>
           <DefaultState name="CYOW_Doors_blend"/>
               <BlendTreeState name="CYOW_Doors_blend">
                <Animations>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d02" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d03" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d04" loop="False" speed="1.0"/>
                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d05" loop="False" speed="1.0"/>
                </Animations>
            </BlendTreeState>
        </AnimGraph>

    </ModelInfo>

Now how to trigger it? Let's say by a taxi light. Does it have to be a simObject, or does regular object have ability to be triggered? If so, how would the code work? Can't find anything useful in SDK documentation... Also, need to figure out how to make different animations for the same objects in Blender, so they can be triggered...
I'll try this as soon as I have a little spare time for it. Many thx upfront
 
Messages
255
Country
germany
Well what I managed to initiate is a standard animation like yours by coming closer than 100 meters to the hangar. I did this by puting the distance into my sim.xml file. I'll send you the content if you like.
It only worked when I used the standard animation
<Animation ... type="Standard" ... />
 
Messages
233
Country
canada
Well what I managed to initiate is a standard animation like yours by coming closer than 100 meters to the hangar. I did this by puting the distance into my sim.xml file. I'll send you the content if you like.
It only worked when I used the standard animation
<Animation ... type="Standard" ... />
Yes, please share the code. It's very much what I'm looking for. So, this works with a regular object, not a simObject, and for "Standard" animaiton? And it starts animation from the beginning when coming close to the hangar?
 
Messages
255
Country
germany
The three txt files (i have added .txt) are for the hangar object. In the zip you'll find the hangar.+
The sim.cfg contains the distance. The hangar has an animation of 150 frames for the closing sequence and 150 for opening again.
The hangar door is built of 6 parts. You'll find tghe gtlf in the zip so you can see what it's looking like
 

Attachments

  • sim.cfg.txt
    129 bytes · Views: 204
  • model.CFG.txt
    36 bytes · Views: 191
  • Hangar_NW2Lo2.xml.txt
    3.4 KB · Views: 209
Last edited:
Messages
233
Country
canada
Thanks a lot! I will check it in the sim later, most likely on my model. But first a couple of questions as I'm trying to understand the code: So, with "DistanceToNotAnimate=50" you are triggering the animation up close, starting from the beginning when it triggers, correct? Then looping because you have loop=true, but it should play once I guess, if I set loop=false. Great!
Your XML has triggers for taxi light switch and yoke - do they work? Are taxi lights triggering only 2 doors? And yoke - another door?
Does <AnimLength>150</AnimLength> mean only 150 frames of the animation will play and then it will stop? If so, that could be useful...
What do MouseRect parts do?

Edit: you said that "sim" animation doesn't work, but your file has it, not a "standard"...
Edit 2: - oh, I'm looking at the wrong file I guess - is it the Hangar_NW2Lo2.xml that's a working file? Not the Hangar_NW2Lo.xml? The "2" has "sim" animation too though... I don't see how you are opening doors and closing them independently...
 
Last edited:
Messages
233
Country
canada
Here are my steps so far:

I managed to create an animation group in Blender so all doors are triggered by one animation and both open and close animations are in the same file:
1615265017011.png


This works.
I then created simobject with the following in sim.cfg:

Code:
[VERSION]
Major=1
Minor=0

[fltsim.0]
title=CYOW_Doors
model=
texture=

[General]
category=StaticObject
DistanceToNotAnimate=50

And this in CYOW_Doors.xml:
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" name="DoorsOpen" type="Standard" typeparam2="DoorsOpen"/>

        <AnimGraph>
      
           <DefaultState name="CYOW_Doors_blend"/>
        
               <BlendTreeState name="CYOW_Doors_blend">
            
                <Animations>

                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>

                </Animations>

            </BlendTreeState>

        </AnimGraph>

    </ModelInfo>

The doors load closed, and animation is not visible, however the animation triggers behind the scenes as soon as object is rendered. If I come close fast, I see the door opening animation going on, but if I wait a bit when I'm far (so doors are static and closed) and then come closer - the doors just jump open immediately, so animation is played and stopped even when invisible. Doors are juming closed and open when I cross the threshold back and forth, but animation is done and not playing. So not sure what to do about that. I need the animation started only when I'm close.

As an alternative, I tried to make the taxi light trigger both animations - closed and opened doors. And it doesn't work. Here's the code I tried, based on SDK example:

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" name="DoorsOpen" type="Standard"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorsClose" type="Standard"/>

        <AnimGraph>

            <DefaultState name="DoorsOpen"/>

            <BlendTreeState name="DoorsOpen">

                <Animations>

                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1" threshold="0"/>

                </Animations>

                <Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>

            </BlendTreeState>

            <BlendTreeState name="DoorsClose">

                <Animations>

                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1" threshold="1"/>

                </Animations>

                <Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>

            </BlendTreeState>

            <Transition end="DoorsOpen" start="DoorsClose">

                <Condition>(A:LIGHT TAXI ON, Bool) True</Condition>

            </Transition>

            <Transition end="DoorsClose" start="DoorsOpen">

                <Condition>(A:LIGHT TAXI ON, Bool) False</Condition>

            </Transition>

        </AnimGraph>

    </ModelInfo>

I also tried this one:

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" name="DoorsOpen" type="Standard" typeparam2="DoorsOpen"/>

        <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorsClose" type="Standard" typeparam2="DoorsClose"/>

        <AnimGraph>

            <DefaultState name="CYOW_Doors_open"/>

            <BlendTreeState name="CYOW_Doors_open">

                <Animations>

                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>

                    <Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1.0" threshold="1"/>

                </Animations>

                <Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>

            </BlendTreeState>

        </AnimGraph>
      
      

    </ModelInfo>

Both do not work. I can see the doors closing when the object is rendering, so closing animation works OK. But nothing is happening on switching taxi lights on or off. Any ideas?
 
Messages
1
Country
brazil
<Animation name="portadireita1" guid="5fb8546a-9f47-4705-a1fa-d02b00ed3c57" type="Sim" typeParam="AutoPlay" length="100" typeParam2="portadireita1"/>

<PartInfo>
<Name>portadireita1</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(E:LOCAL TIME, Seconds) 24000 &gt;=
(E:LOCAL TIME, Seconds) 67500 &lt;= and if{ 100 } els{ 0 }
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo

maybe it helps in something, this is the model i'm using, but i take the opportunity to trigger the animation according to the airport's opening hours.

but my knowledge of programming is very low
 
Messages
233
Country
canada
Not here. I just resorted to having a fixed animation, opening and closing doors every couple of minutes. Could not make an acceptable triggered animation.
 
Messages
2
Country
austria
Not here. I just resorted to having a fixed animation, opening and closing doors every couple of minutes. Could not make an acceptable triggered animation.
ok, guess we will just have to wait for this to be more accessible in the sdk
 
Top