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

Triggered Animation?

Messages
23
Country
switzerland
Dear Community, I have realized an animated Object in Blender and transfered it successfully into MSFS, everything works and the animation is displayed (with type="Standard" typeParam="Autoplay").
Now I would like to make that animation work ONLY depending on A) system time or B) drone distance.

A) the animation shall play once at every full hour (basically with system time minutes = 00)

B) the animation shall play once only when the gamers drone is at a distance of that object lesser than 4 meters

So the idea is to build in triggers to the animation.

Anybody of you has an idea on how to make that work this way. Any assistance/ideas/hints are very much appreciated, thank you very much.
 
OK, from what I understand, the Standard animation type will work in any old scenery objects.

If you want something more complex then you will need to create a simobject. This is how the windmills and windsocks are animated. See the asobo-simobjects folders for the various models (windmills and windsock models are in the asobo-simobjects-landmarks folder). The SDK has an example of the windsock as well (Samples/WindsockSample).

Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{ebb99e88-a7b4-43da-b2d0-1d2c7dcc23f2}">
    
    <LODS>
        <LOD minSize="0" ModelFile="Windsock_LOD00.gltf">
            <!-- <AnimationFileList> -->
                <!-- <AnimationFile>Windsock_Animations.gltf</AnimationFile> -->
            <!-- </AnimationFileList>         -->
        </LOD>
    </LODS>
    

    <Animation name="Knots_00" guid="0096FD0E-EE60-45AF-968E-6F450DAEF1D0" type="Standard"/>
    
    <Animation name="Knots_05" guid="62E315C3-B373-4042-A4C8-BFB80A556DB7" type="Standard"/>
    
    <Animation name="Knots_10" guid="92D6EDCE-7F4B-4AB3-9F9B-91CC7EB462FA" type="Standard"/>
    
    <Animation name="Knots_15" guid="09E22898-E9EF-4A82-9A61-FF88EA595BB7" type="Standard"/>
    
    <Animation name="Knots_20" guid="FF244E92-4407-479F-8C3C-FB09254D87CB" type="Standard"/>
    
    <Animation name="Knots_25" guid="EE3688CA-1F3B-4E6F-AF97-A8E38F0F2905" type="Standard"/>
    
    
    
    <AnimGraph>
    
        <DefaultState name="Anim"/>
        
        <BlendTreeState name="Anim">
          <Animations>
            <Animation guid="0096FD0E-EE60-45AF-968E-6F450DAEF1D0" loop ="True" speed="1" threshold="0"/>
            <Animation guid="62E315C3-B373-4042-A4C8-BFB80A556DB7" loop ="True" speed="1" threshold="5"/>
            <Animation guid="92D6EDCE-7F4B-4AB3-9F9B-91CC7EB462FA" loop ="True" speed="1" threshold="10"/>       
            <Animation guid="09E22898-E9EF-4A82-9A61-FF88EA595BB7" loop ="True" speed="1" threshold="15"/>       
            <Animation guid="FF244E92-4407-479F-8C3C-FB09254D87CB" loop ="True" speed="1" threshold="20"/>       
            <Animation guid="EE3688CA-1F3B-4E6F-AF97-A8E38F0F2905" loop ="True" speed="1" threshold="25"/>       
          </Animations>
          <Value>(A:AMBIENT WIND VELOCITY, KNOTS)</Value>
        </BlendTreeState>
        
        
     </AnimGraph>
        
    <Behaviors>
        <Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>
        
        <Component ID="WindSock">
            <UseTemplate Name="ASOBO_WindDirection_Template">
            </UseTemplate>
        </Component>

    </Behaviors>
</ModelInfo>

As you can see, the windsock uses standard animations and switches between them depending on wind speed. This gives a bit of motion to the the sock. The ASOBO_WindDirection_Template is what rotates the windsock to the wind direction (quick tip, you need to set your animation name in blender to "Orientation" to use this template). That template can be found in Official\OneStore\fs-base-aircraft-common\ModelBehaviorDefs\Asobo\Misc\SimObjects.xml.

I haven't tested it but I don't see any reason why you couldn't use any animation code you like there.

Your option B will be difficult though as I don't know if there is any parameter that will measure the distance from the user to the object. Maybe there is in the Jetway code?
 
Thanks Anthony, it's hard to work with things that are not described anywhere... ;-) I have studied the Windsock sample already but it doesen't give me the clue on how to make my animation work based on the actual time (only based on wind). Perhaps anybody out there knows something about a variable similar to "AMBIENT WIND VELOCITY" reflecting the actual time in Minutes?

By the way, is there anywhere a list with all those variables?
 
Anybody of you has an idea on how to make that work this way. Any assistance/ideas/hints are very much appreciated, thank you very much.
I think you can find good hint from this thread ;)

mfs_sdk_variables-jpg.63908
 
Thanks 614NLV! I was wondering too, if the story/discussion about Visibility would help. I think yes (by the way, there is a hint to those variables, hoooray). Perhaps I will experiment around with an object with an animation that is only visible at a certain period of time and at other time with an object (same design) but without animation at the same place visible at other times... should make the same effect. Will take me 1/2 day or so to experiment, but let's give it a try... ;-)
 
My other Idea to "B) the animation shall play once only when the gamers drone is at a distance of that object lesser than 4 meters"

I could mess around with two different LOD versions, one with animation, one without... and define corresponding distances triggering the right LOD

and another 1/2 day of lifetime planned... ;-)
 
Just to keep you up to date with my experiments with diffrent LOD's:

NOPE, within a "normal" scenery Object I can not define separate LOD Objects WITH an animation! For that I have to definitively create a "misc"-type SimObject like a e.g. a windsock.

So I willl have to invest a looooooooooooooooooooooooot of time to understand the creation of "simple" SimObjects, as normal human being with not a lot of programming practice ;-)

If anybody out there has found a tutorial covering this subject, thanks a lot for a hint (yes, I know and follow the discussions about Flags, Visibility, Simple Animation) and I learn a lot, but the first and simple step, that one at the very beginning, to create a SimObject of "misc"-type (not a complette aiorcraft, for gods sake). I seem to be to stupid to understand.... mea culpa
 
Any luck figuring this out? I'd like to create animated hangar doors that are triggered by proximity, if possible. Can be by time, but it's not as good. Can't figure how to do either... I did figure out how to do a flag, but you probably know that if you follow that topic...
 
For now my hangar opens automatically when the sim is started
I thought I'd put a button to open it with the mouse
but if that's okay for me, it's not good for Ai planes that can't use the mouse
Yes, the ideal would be to have a distance trigger, which opens automatically when you pass by, as if it were a photocell.
But I don't know how to make it ...:) Any suggestion?
 
From the thread referenced by you it seems that it may be possible wither with SimObject or even a regular object to create differed LOD objects, so when you are close and it takes a large portion of the screen (including if you're inside it) the LOD model with door opening animation would load, and when you are farther away, the next LOD would have a closing animation, and the last LOD would have it closed. I'm not sure if you can just use a normal object and if animation will be triggered each time LOD is loaded though... Can it be cpecified in XML for each LOD separately? I don't know. Needs further testing...
 
the idea of doing 3 different LODs, with the opening and closing animations is clever.
I haven't studied the LODs well yet, so I don't know yet if it will have only one xml (as I think), but maybe it is possible to do 3 different xml, with different triggered conditions.
But I'm not sure if that is the best solution in game..
for example I would not like to see an AI-plane go through the doors (if don't have the collision properties)
I think the change of LOD can be valid only for ourselves
Initially I had put a button, which you can see in the video, to open the hangar with a <MouseRect>
But even this solution creates problems for AI planes
Even the possibility of controlling the opening via atc, as the push-back is called, would not be a bad idea, but at the moment I have not thought about how it would be possible to achieve it.

for now I have put a simple animation that opens the hangar when the sim starts and therefore always remain open
a scenery-object is sufficient for this
if the animation is not standard but Sim then it must be a simobject, as you well know

Considering that the airport I am developing is small and has opening and closing times (like an office), I think I will solve it by triggering the automatic opening and closing to the operating hours, which seems also quite true to reality.
And also because I have to finish mine which I would like to release in about a month
But I think that if you don't mind any negative consequences for the AI-planes, putting a button in and one outside the hangar with <MouseRect> could be the simplest and even nicer solution, as well as real.
unless the opening of your hangar is controlled by a photocell :)
;)
 
My idea is to have this not just a utilitarian purpose, but an eye candy in my airport. So things should also happen when you're just around. So my plan is this:

1. LOD2 (very far) - Simple low-poly hangar model, doors stay OPEN, no animation: this has a reason, for animation flow - it doesn't matter far away if doors are open.
2. LOD1 (closer and clearly visible) - animation OPEN->CLOSED, no loop.
3. LOD0 (large size on screen, maybe 100m away or so) - animation CLOSED->OPEN, no loop.

That way here's what's going to happen:

- When you spawn inside the hangar, LOD0 loads with doors closed, doors will slowly open and stay open.
- When you taxi away, the doors close.
- If you start at a gate, away from the hangar, LOD1 loads and you may see the open doors closing, a sign of an active life in a busy airport.
- If you taxi close by to the hangar by on the way to the runway before takeoff or after landing - LOD0 loads and you see the doors opening again and close again later when you are away and LOD1 loads. Busy airport, why not?
- When you are approaching for landing, far away doors are open (LOD2) which is OK because they could be open for a long while in a real airport, and it's really far away. When you are closer you may see that hangar doors are closing (LOD1), creating the appearance of some life at the airport. By the time you land, doors are closed.
- When taxi on closest taxiway by the way to the gates, or approach the hangar directly, LOD0 loads and the closed doors open and stay open, so you can taxi inside.

No interaction of any sort is necessary and it all behaves in a plausible manner.

The only inconsistency would be when you are taking off, and LOD1 is changing to LOD2, and the doors would jump from closed to open, but the airport will be behind you, and who is looking back when taking off? But the time you engage autopilot and can watch the ground - you are likely far enough for LOD2, and if you are just doing the pattern, they will stay on LOD1. Yes, AI aircraft will have problem with that, but I guess if doors use collision material, they should not go through? Most will be at the gates anyway...

That's the idea, but will it work with a simple object? Will the corresponding animation load each time the new LOD is loaded, play once an stop? What if LOD will load again in the same session, after another LOD was loaded, will the animation play again? I yes - that's all I need. Or is a SimObject needed for that, and more complicated scripting?
 
Last edited:
yes, 3 LODs like that have good logic
and you can make them as simple scenery-object because the animation is Standard Type.
You don't need to make a SimObject because you have no triggered-conditions but only one simple animation (as the mine)
the doubts are only two:
- if it is possible to have an object with 3 LODs but with 2 having an animation;
- you will have to put a Loop=False parameter to open the hangar only once, but I'm not sure if the animation will work a second time... You have to try 👍🙂
 
Yes, that's my thoughts exactly. If it doesn't work, how could I do similar logic with SimObject? If you managed to trigger animation by distance, or something similar - let me know.
 
Possible solution

I take my hangar as example: it's a simple SceneryObject with 4 animations, one for each door
I detach the doors from the hangar SceneryObject -with blender- and make two SimObjects, one for the opening animation and one for the closing one
Then I add the <Visibility> parameter to these two xml files
Now I just need a condition to trigger them to
And I thought we can use gps coordinates
it shouldn't be difficult in a flight simulator to figure them out :)
Screenshot 2021-02-11 010232.png


Screenshot 2021-02-11 010032.png


So if the coordinates are between xxx and xxx then make SimObjects1 visible (open)
else
SimObjects2 (close)

we just need to get the coordinates for the open hangar zone.
with all the other coordinates SimObject2 will be visible and the hangar will be closed

It seems a nice solution, what do you think? ;)
 
Last edited:
Sounds interesting. Can you do an "if..then" statements with such conditions? There are also 2 axes there, you can't just compare 2 numbers, you need to compare X and Y separately and both have to be within range.
 
I don't have an answer for now, I understand what you mean, an area should be defined
I don't know how to do it, but what else can be used besides the GPS coordinates?
I believe we have the necessary variables from the sim and this may be the way to get it to work in this way
I will trigger the opening according to the Airport opening hours. And I will adopt the same method of making 2 SimObjects
I will use the variable of the Time you will have to use that of the coordinates.
I'm not a coder, but I think there is the possibility of defining an area, with coordinates and being able to compare them to trigger a condition
You'll see that you will found the solution
 
Last edited:
Back
Top