Christian Bahr
Resource contributor
- Messages
- 1,027
- Country
Hi!
At this point I would like to share my experiences about animations that can be controlled by conditions. This should only be the beginning, the hope is that many new and good ideas will emerge from it
Let's take a hunter's hide as an example. The hunter's hide has two animations: Freeze and Collapse:
The names of the animations already say it, the hunter's hide should not collapse under Condition A, under Condition B it should collapse. Here is the content of the corresponding XML file, using the bear example from the current MSFS SDK as a template:
In the flight simulator itself it looks like this, when it rains the hunter's hide collapses, if it doesn't rain then nothing happens:
The next goal would be to figure out how to modify the code to make a proximity detector out of it
At this point I would like to share my experiences about animations that can be controlled by conditions. This should only be the beginning, the hope is that many new and good ideas will emerge from it
Let's take a hunter's hide as an example. The hunter's hide has two animations: Freeze and Collapse:
The names of the animations already say it, the hunter's hide should not collapse under Condition A, under Condition B it should collapse. Here is the content of the corresponding XML file, using the bear example from the current MSFS SDK as a template:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{eca76b2e-3475-4c2f-9bb7-b0901270dbd2}">
<Animation name="Collapse" guid="c4d8867e-9bc1-43f8-80a0-9f7d0b874994" type="Standard" typeParam="random"/>
<Animation name="Freeze" guid="df50f45d-39ba-4f14-8e10-3e5fe8f35992" type="Standard"/>
<LODS>
<LOD MinSize="0" ModelFile="ediu_hochsitz.gltf"/>
</LODS>
<AnimGraph>
<DefaultState name="Freeze"/>
<BlendTreeState name="Freeze">
<Animations>
<Animation guid="df50f45d-39ba-4f14-8e10-3e5fe8f35992" loop ="True" speed="1"/>
</Animations>
</BlendTreeState>
<BlendTreeState name="Collapse">
<Animations>
<Animation guid="c4d8867e-9bc1-43f8-80a0-9f7d0b874994" threshold="0" loop ="False" speed="0.01"/>
</Animations>
<Value>(A:AMBIENT PRECIP STATE, mask)</Value>
</BlendTreeState>
<Transition start="Freeze" end ="Collapse">
<Condition>(A:AMBIENT PRECIP STATE, mask) 3 > if{ 1 } els{ 0 }</Condition>
</Transition>
<Transition start="Collapse" end ="Freeze">
<Condition>(A:AMBIENT PRECIP STATE, mask) 3 < if{ 1 } els{ 0 }</Condition>
</Transition>
</AnimGraph>
</ModelInfo>
In the flight simulator itself it looks like this, when it rains the hunter's hide collapses, if it doesn't rain then nothing happens:
The next goal would be to figure out how to modify the code to make a proximity detector out of it