• 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 Non-looping SimObject animation

rhumbaflappy

Administrator
Staff member
Resource contributor
Does anyone have an example of a scenery SimObject that does not loop? What is the required xml to halt the animation at a specific keyframe?
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Here's a Sketchup conversion of a hangar from OneClickHanger. The model is straight glTF, not MSFS glTF. There are 2 animations, one for each door. They open and shut with the yoke visibility toggle.

Simple Hangar
 
Last edited:
Hi dick

Do you have any idea how to get the pilot to know that he can open the hangar?

A tooltip?

Thank you for your finds and your sharing!
 
Hi Dick:

I am trying to better understand how this object:

https://www.fsdeveloper.com/forum/resources/msfs-simple-animated-hangar.268/

...can successfully be made available for placement as a SimObject to 'test' via ADE_Alpha-19 in "2-way edit mode".


I have added a COPY of the entire folder chain for your example compiled MSFS-2020 package:

[Downloads]\SimpleHangar

06/06/2021 01:19 PM <DIR> .
06/06/2021 01:19 PM <DIR> ..
06/06/2021 01:19 PM 0 files_and_folders.txt
05/28/2021 01:44 PM <DIR> PackageDefinitions
05/28/2021 01:46 PM <DIR> PackageSources
05/28/2021 01:43 PM 301 SimpleHangarProject.xml
05/28/2021 03:34 PM <DIR> sources
2 File(s) 301 bytes
5 Dir(s) 671,528,235,008 bytes free

...to my 'active' MSFS-2020 'packages' community sub-folder:

{MSFS_Packages install path]\Community

...but this object does not appear in either ADE20_Alpha-19 or MSFS SDK DevMode ...in the SimObject pick-list. o_O


If I use the manual work-around for ADE described here: :pushpin:

https://www.fsdeveloper.com/forum/threads/adding-aircraft-from-library-alpha-17.451619/post-875753


...I apparently can cause ADE to place a "SimpleHangar" SimObject visual place-holder in the ADE workspace.


I can then apparently save and compile the ADE project, and can allow ADE to copy it to my 'active' MSFS-2020 'packages' community sub-folder:

{MSFS_Packages install path]\Community.


However, ADE throws an error message that states IIRC, 'no built package found'.

If I manually find the built package in the ADE\F20 folder chain, and copy it to my 'active' MSFS-2020 'packages' community sub-folder:

{MSFS_Packages install path]\Community


..I do not see the SimpleHangar object in its assigned placement location at run time when MSFS-2020 is re-started. :oops:


IIRC, you subsequently gave a SimObjects list to Jon that, AFAIK, was used to update ADE's 'default' SimObjects pick-list.

https://www.fsdeveloper.com/forum/threads/adding-aircraft-from-library-alpha-17.451619/post-875794

[EDITED]

Is there an additional procedure end users must perform to add such "custom" SimObjects to ADE's and/or MSFS-2020's DevMode pick-list ? :scratchch


Thanks in advance for further clarification on how to test placement / display of this example SimObject via ADE and/or MSFS-2020 DevMode. :)

[END_EDIT]

GaryGB
 
Last edited:
Readers interested in how to work with this example SimObject may wish to see the related discussion on this sub-topic here:



Thanks for following up with this, Dick. :)

GaryGB
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Hi dick

Do you have any idea how to get the pilot to know that he can open the hangar?

A tooltip?

Thank you for your finds and your sharing!
That would be good, Like a tooltip or something. But I'm afraid it's not really possible because you'd have to alter the aircraft somehow. Perhaps a better solution would be a proximity trigger in the hangar animation, so the door opens when you are in position automatically,
 

rhumbaflappy

Administrator
Staff member
Resource contributor
One of the variables that can be read by the sim is Surface Type. It occurred to me we could make a trigger for an animation (such as a hangar door), by placing an apron of an specific material type in front, or around the SimObject to trigger the animation. The apron can be given an opacity of 0, and the sim still registers the type (as long as the priority is greater than anything below it). When the plane is over the specific apron, the animation can be triggered (I hope). I'll work on this in the next few days.

Unknown surface types default to 4.0 SimObjects and library objects seem to default to 12.0 Roads are 0.0 Water is 2.0 Grass is 1.0 I'm not sure what clay is as I can find no examples...the clay runway is defined as type Dirt (12.0), so if clay is a valid type, it would make a very good type for a material trigger.
 
Last edited:
One of the variables that can be read by the sim is Surface Type...

Maybe add a 'POI' directly?

I'll think about it too;)

However your idea of a trigger via materials would be even better.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Having a problem with getting the hangar doors to open via Surface Type.

XML:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{f50ce35e-35fe-4b0b-8bb7-02242401e711}">

    <LODS>
        <LOD minSize="0" ModelFile="TriggerHangar.gltf"/>
    </LODS>

    <Animation guid="259d4897-5033-4d21-a575-d45dcb965f22" length="100" name="DoorLeft" type="Sim" typeParam="AutoPlay" typeParam2="DoorLeft"/>
    <Animation guid="665f9750-aea8-4cac-afb4-650101ba674d" length="100" name="DoorRight" type="Sim" typeParam="AutoPlay" typeParam2="DoorRight"/>

    <AnimGraph>
        <DefaultState name="TriggerHangar_Close"/>
        <BlendTreeState name="TriggerHangar_Close">
          <Animations>
            <Animation guid="259d4897-5033-4d21-a575-d45dcb965f22" loop="False" speed="1"/>
            <Animation guid="665f9750-aea8-4cac-afb4-650101ba674d" loop="False" speed="1"/>
          </Animations>
        </BlendTreeState>
    </AnimGraph>

    <PartInfo>
        <Name>DoorLeft</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (A:SURFACE TYPE,enum) 20 == if{ 50 } els{ 0 }
<!--                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 } -->
<!--                (E:LOCAL MONTH OF YEAR, Number) 4 == if{ 50 } els{ 0 } -->
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>DoorRight</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (A:SURFACE TYPE,enum) 20 == if{ 50 } els{ 0 }
<!--                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 } -->
<!--                (E:LOCAL MONTH OF YEAR, Number) 4 == if{ 50 } els{ 0 } -->
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>

</ModelInfo>

The commented conditions work fine, just surface type is not being recognized. The SimVar Watcher shows the surface as 20. And the doors should open, but they don't. :mad:

Untitled.png
 
the idea of the surface_type is great 👍
I checked with spad.next the surface's enum
and I only have 15 types....
Screenshot 2021-06-10 210206.jpg

try using one of these, imho it will work 🙂🤞

EDIT:
I found this in the official documentation
Screenshot 2021-06-10 224419.jpg

so that's not the problem :confused:
 
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
I did try 7 which is Clay? in MSFS. I'll try a few more.

Edit... tried a few, but none work. Perhaps the sim cannot read the code for SURFACE TYPE
 
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
The only problem with using the yoke hiding for a trigger is that not all aircraft have that built in. The A: variables in the SimObject XML don't read the user aircraft's A:, but I think use the SimObject's A:, so with a static object, it's really pointless to try them. I'l study the default ground vehicles and see if they have something that can work.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
This could be solved if there is a way to access the User Aircraft variables, rather than the SimObject variables.
 
I know little of L:Vars, SimConnect or WASM code, but I wonder: ...must one also separately set a parameter value for "SURFACE INFO VALID" ? :scratchch


"True indicates SURFACE CONDITION is meaningful."


I wonder if this is how MSFS-2020 tracks terrain 'Surface Type' in order to trigger User A/C "GroundRoll" on-ground taxi dynamics and sounds ?

https://docs.flightsimulator.com/html/index.htm?rhsearch=soundhttps://docs.flightsimulator.com/html/index.htm#&rhhlterm=indexes index=#rhsearch=GroundRoll&t=Content_Configuration/Flights_And_Missions/Event_Trigger_Definitions.htm&rhhlterm=groundroll

https://docs.flightsimulator.com/html/Asset_Creation/Sounds/Shared_States_and_Switches.htm?rhsearch=soundhttps://docs.flightsimulator.com/html/index.htm#&rhhlterm=index=


LINDA had this to say regarding SimConnect support for non-default aircraft functionality ? :pushpin:


"This beta version provides limited functionality with MSFS 2020 and FSUIPC7. Only LINDA default MSFS library functions can be used. Most original FSX Controls and FSUIPC offsets are available. Due to fact the MSFS 2020 SimConnect not providing access to Lvars, only the MSFS default aircraft functionality is available (use LIB: MSFS Default when assigning functions). No other aircraft modules will be released until Lvars are made available." :pushpin:



As you may already know, Umberto initially explained (current) MSFS-2020 variable functionality on September 9, 2021 ...here:

https://www.fsdeveloper.com/forum/threads/simconnect-accessing-local-variables.448704/

Right now, the only way to read or write LVars is from a WASM module, because there are wrappers in WASM for all functions of the old Panels interface, which includes the ability to read/write LVars.

However, there's no easy way to export them to the outside world. for example an external Simconnect client, since WASM modules cannot call any of the WIndows API features ( Named Pipes, Socket, IPC, etc ) that are usually used to send data across processes.

It MIGHT ( although I haven't tried ) be possible to use Simconnect itself to communicate between a WASM module ( which, as of today, can only be a Gauge, since standalone modules are not supported yet ), using the SimConnect_CreateClientData, SimConnect_RequestClientData, SimConnect_SetClientData ( etc. ) functions, so the WASM gauge could communicate with an external .EXE using Simconnnect itself as a transport, and sharing data using some kind of protocol to handle LVars.

It's quite tricky, but might work, provided all the following will work:

- those Simconnect calls working as they did in FSX/P3D, both in the external .EXE and in the WASM module, which not something to take for granted, since even more basic functions are still INOP today.

- until WASM works only with Gauges, it will be fairly impractical, since you would have to add this "proxy" gauge to every airplane you have, something that wouldn't be required if the module could just start with the sim, like any other .DLL

- You'll have to create some data exchange protocol to act on LVars, design the data areas, work with strings ( LVar names ) which can be tricky

It would be way easier if Asobo just added support for LVar to Simconnect natively, so you could just use it from an external .EXE, without having to deal with any of that.


And as you may also already know, Umberto subsequently explained (current) MSFS-2020 variable functionality on January 28, 2021 ...elsewhere:

https://forums.flightsimulator.com/t/demo-lvar-write-access-for-any-aircraft-control/353443/19

"Variables and events are very different things:

Variables

L: are the usual LVar from FSX. The “L” naming might be misleading, since it sounds a bit like “Local” vars, when in fact they are really global user variables.

A: are “Airplane” variables, however they work from other Simobjects like Ground Vehicles too, but not all kind of objects have the same variables available, the User airplane has all of them, AI airplanes have less, Ground Vehicles even less and SimpleObject have less than Ground vehicles. They are the “simulation” variables which you usually read only, because they are handled by the simulation so, even if some of them can be written, you’ll likely “fight” against the simulation which will write to them too. You usually change their values indirectly: by sending an EVENT which result in the simulation changing its state.

H: are new “Html” variables used by the new Html5/Javascript gauge system

O: variables are local variables that store some states of simobjects with an XML behavior

Events

K: are not variables, they are Events ( K as in “keyboard”, even if they might not be assigned to the keyboard at all ), so you SEND them to the sim to perform an action, which usually results in a related A: variable to change. So, for example, if you send the K: PARKING BRAKE event, it will affect the PARKING BRAKE POSITION A: variable.

Right now, you can access A: variables with Simconnect, even from an external .EXE written in any language that supports it ( usually C# or C++ ), but to access L: variables you must use a WASM module or gauge that will call the Panels interface which maps 1:1 the old Gauges SDK.

H: and O: variables are usually accessed from Html/JS code, there’s no documented way to access them with an API.

You can send Events both from Simconnect or from the Panels interface in WASM modules/gauges."

https://www.prepar3d.com/SDKv4/sdk/...ce/gauges/references/gauges_api_overview.html

https://www.prepar3d.com/SDKv3/LearningCenter/utilities/variables/variables_overview.html

[EDITED]

PS: This raised questions (...for the un-initiated like me) as to what one may be able do in MSFS with SimConnect coding:

https://blackhole.smb.net/MSFS/Docu...t_Reference.html#simconnectsetdataonsimobject

[END_EDIT]


This thread also raised questions (...for the un-initiated like me) as to what one may otherwise be able do in MSFS with legacy XML (gauge ?) coding:

https://www.fsdeveloper.com/forum/t...switch-to-trigger-xml-gauge-variables.448261/



Perhaps you have seen this thread already ? ;)



Alternatively, might this suggest some options for User A/C data I/O without FSUIPC ? :idea:




Some LUA scripts for FSUIPC in Microsoft Flight Simulator FS2020:






Also, one might wonder if FSUIPC 7 can access legacy Sim variables to implement anything like SCASM's SurfaceType or SenseBorder ? :twocents:

https://www.google.com/search?q=SCA...&ved=0ahUKEwim09mC1ZDxAhVBaM0KHVzLCiUQ4dUDCA0


Otherwise, IIUC, FSUIPC 7 may eventually also have access to (legacy ?) variables via a new WASM interface:

https://forum.simflight.com/topic/9...lable-for-developers-and-advanced-users-only/

https://forum.simflight.com/topic/9...nt-side-api-lvarhvar-discussion-topic/page/6/

GaryGB
 
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
The only problem with using the yoke hiding for a trigger is that not all aircraft have that built in. The A: variables in the SimObject XML don't read the user aircraft's A:, but I think use the SimObject's A:, so with a static object, it's really pointless to try them. I'l study the default ground vehicles and see if they have something that can work.
I can confirm the XML code using A: parameter is accessing the SimObject rather than the User aircraft. Using this:

(A:SURFACE TYPE, enum) 12 == if{ 50 } els{ 0 if{ 50 } els{ 0 }

results in the doors being open. Objects in the sim always show a ground type of 12 (Dirt). Using any other type results in the doors being closed, as the animation never triggers. So this is a dead-end unless someone knows how to access the parameters of another object in XML code. (The user aircraft is always number 1).
 
Hi Dick:

Thanks for your ongoing follow-up with this. :)

I sometimes wonder if others here realize just how important this is to making MSFS "As Real As It Gets" and/or to future "Fun With MSFS". :banghead:

Despite 2 prior years in development, if the MSFS-2020 SDK is still in its infancy with implementing features already on Asobo's to-do list, might we consider an interim solution that uses LOD's triggered by a (very) close proximity of the user A/C to the hangar doors ?


IIRC, Bill Lyons had a FS2002-era scenery object which used this method to cause hangar doors to 'vanish' and reveal the inside of the hangar rather than triggering an animation of doors closing; IUC LOD's (or calculated A/C to object distance via SCASM) were used for proximity detection.


If we were otherwise compelled to utilize add-on legacy-compatible XML gauge code in a user A/C, a notable legacy example comes to mind. :pushpin:

Bill Lyons had a FS2004-era scenery package which used a user A/C panel gauge to trigger animated hangar doors, and a limo to drive up.

Flying with the Stars:



But perhaps another option merits consideration, that requires no add-on gauge, and instead, the user A/C Radio at an assigned frequency. :idea:


Fr. Bill Leaming (aka "n4gix") had a scenery object with a hangar door that is radio controlled using a specific frequency on NAV2 radio

https://www.fsdeveloper.com/forum/threads/hanger-needed.15495/post-99925

https://www.fsdeveloper.com/forum/threads/hanger-needed.15495/

https://www.fsdeveloper.com/forum/threads/precipitation-inside-the-hangar.441952/

Perhaps Fr. Bill Leaming can tell us whether MSFS radio functions can (currently ?) be used this way as they were in FS2Kx ? :teacher:


Finding a way to do user A/C pilot radio-controlled SimObject Hangar Doors, may reveal how to trigger pilot-controlled airport lights. :wizard:


AFAIK, if MSFS user A/C radio interaction with static SimObjects is feasible, some new "gotchas" / options may apply:


Kronzky: Display Simvar values in-game on a panel gauge



PS: Anthony Lynch (aka "Anthony31") posted some fascinating info regarding ModelBehavior code, Animation code and Visibility:



GaryGB
 
Last edited:
Top