connomar
Resource contributor
- Messages
- 267
- Country

My objective, which I thought was going to be easy, is to change the conditions under which an animated hangar door opens and closes. The working version used "Time of Day" and XML_YokeHidden2 to close at night, but still be able to open if the users wishes to enter.
The next idea was to add a feature to close the door if the weather turned nasty. The hidden agenda is that I haven't managed to stop it raining and snowing inside despite many occlusion attempts. When I tried to work out the logic, I realized my College classes 40+ years ago were but a distant memory, but as usual I was saved by the web.
So, my variables are:
From these variables I derived the truth table
Red text = NOT
From this, the boolean equation becomes ABC+AB
I thought I was home dry now. However, I have been confused as to why Asobo say the PartInfo function should no longer be used in new code, but then reference it in documentation as needed in the new code.
Anyway, the whole <model> xml is below, but it fails to even open the door. I don't understand, and can find no reference to, the method for ANDING three parameters instead of just two. In case it can only cope with two operands at a time, I have put the operator after the first two operands, then a third AND operator after the third. I have tried using the not operator to reverse the result of AMBIENT PRECIP RATE, which incidentally I want to trigger when millimeters of water exceeds 5.
Any help on this would be greatly appreciated.
Martin
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{01a28a9d-37b7-4e5f-adc7-e29e7ee0a2cc}" version="1.1">
<LODS>
<LOD minSize="0" ModelFile="SkyHarborMainHangarA.gltf"/>
</LODS>
<!--Animation occurs in pairs due to a problem with MSFS not accepting constraints -->
<!--Original Mk 1 objective was to open a hangar door during the day and close it at night, but also be able to open it by hiding the right hand yoke of the aircraft -->
<!-- The Mk 2 objective is to close the door in inclement weather, but allow this to be overriden by the hidden yoke -->
<Animation name="OpenDoor" guid="f9c375db-9a10-4dc4-b729-df4aae9130e0" type="Sim" typeParam="Autoplay"/>
<Animation name="BottomDoor" guid="f0b6ea65-e1cc-469e-a37a-9e2cbc11814d" type="Sim" typeParam="Autoplay" />
<DefaultState name="SkyHarborHangar"/>
<AnimGraph>
<DefaultState name="SkyHarborHangar"/>
<BlendTreeState name="SkyHarborHangar">
<Animations>
<Animation guid="f9c375db-9a10-4dc4-b729-df4aae9130e0" loop="False" speed="1"/>
<Animation guid="f0b6ea65-e1cc-469e-a37a-9e2cbc11814d" loop="False" speed="1"/>
</Animations>
</BlendTreeState>
</AnimGraph>
<PartInfo>
<Name>OpenDoor</Name>
<AnimLength>720</AnimLength>
<Animation>
<Parameter>
<Code>
<!--(L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) 1 == or if{ 715 } els{ 0 } This is the working code without the precip addition-->
(A:AMBIENT PRECIP RATE, millimeters of water) 5 !> (L:XMLVAR_YokeHidden2) 1 != and (E:Time of Day,enum) 1 == and (A:AMBIENT PRECIP RATE, millimeters of water) 5 > (L:XMLVAR_YokeHidden2) 1 == and or if{715} els{0}
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>BottomDoor</Name>
<AnimLength>720</AnimLength>
<Animation>
<Parameter>
<Code>
<!--L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) 1 == or if{ 715 } els{ 0 }-->
(A:AMBIENT PRECIP RATE, millimeters of water) 5 !> (L:XMLVAR_YokeHidden2) 1 != and (E:Time of Day,enum) 1 == and (A:AMBIENT PRECIP RATE, millimeters of water) 5 > (L:XMLVAR_YokeHidden2) 1 ==; and or if{715} els{0}
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
<!-- Behaviour below makes Light inside the hangar visible if Yoke 2 is hidden and it is not daytime.-->
<Behaviors>
<Component ID="LightInsideOfHangar" Node="InsidePointLight">
<Visibility>
<Parameter>
<Code>(L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) != or if{1} els {0}</Code>
</Parameter>
</Visibility>
</Component>>
</Behaviors>
</ModelInfo>
The next idea was to add a feature to close the door if the weather turned nasty. The hidden agenda is that I haven't managed to stop it raining and snowing inside despite many occlusion attempts. When I tried to work out the logic, I realized my College classes 40+ years ago were but a distant memory, but as usual I was saved by the web.
So, my variables are:
| A | (A:AMBIENT PRECIP RATE, millimeters of water) |
| B | (L:XMLVAR_YokeHidden2) |
| C | (E:Time of Day,enum) |
From these variables I derived the truth table
| A | B | C | RESULT |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Red text = NOT
From this, the boolean equation becomes ABC+AB
I thought I was home dry now. However, I have been confused as to why Asobo say the PartInfo function should no longer be used in new code, but then reference it in documentation as needed in the new code.
Anyway, the whole <model> xml is below, but it fails to even open the door. I don't understand, and can find no reference to, the method for ANDING three parameters instead of just two. In case it can only cope with two operands at a time, I have put the operator after the first two operands, then a third AND operator after the third. I have tried using the not operator to reverse the result of AMBIENT PRECIP RATE, which incidentally I want to trigger when millimeters of water exceeds 5.
Any help on this would be greatly appreciated.
Martin
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{01a28a9d-37b7-4e5f-adc7-e29e7ee0a2cc}" version="1.1">
<LODS>
<LOD minSize="0" ModelFile="SkyHarborMainHangarA.gltf"/>
</LODS>
<!--Animation occurs in pairs due to a problem with MSFS not accepting constraints -->
<!--Original Mk 1 objective was to open a hangar door during the day and close it at night, but also be able to open it by hiding the right hand yoke of the aircraft -->
<!-- The Mk 2 objective is to close the door in inclement weather, but allow this to be overriden by the hidden yoke -->
<Animation name="OpenDoor" guid="f9c375db-9a10-4dc4-b729-df4aae9130e0" type="Sim" typeParam="Autoplay"/>
<Animation name="BottomDoor" guid="f0b6ea65-e1cc-469e-a37a-9e2cbc11814d" type="Sim" typeParam="Autoplay" />
<DefaultState name="SkyHarborHangar"/>
<AnimGraph>
<DefaultState name="SkyHarborHangar"/>
<BlendTreeState name="SkyHarborHangar">
<Animations>
<Animation guid="f9c375db-9a10-4dc4-b729-df4aae9130e0" loop="False" speed="1"/>
<Animation guid="f0b6ea65-e1cc-469e-a37a-9e2cbc11814d" loop="False" speed="1"/>
</Animations>
</BlendTreeState>
</AnimGraph>
<PartInfo>
<Name>OpenDoor</Name>
<AnimLength>720</AnimLength>
<Animation>
<Parameter>
<Code>
<!--(L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) 1 == or if{ 715 } els{ 0 } This is the working code without the precip addition-->
(A:AMBIENT PRECIP RATE, millimeters of water) 5 !> (L:XMLVAR_YokeHidden2) 1 != and (E:Time of Day,enum) 1 == and (A:AMBIENT PRECIP RATE, millimeters of water) 5 > (L:XMLVAR_YokeHidden2) 1 == and or if{715} els{0}
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>BottomDoor</Name>
<AnimLength>720</AnimLength>
<Animation>
<Parameter>
<Code>
<!--L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) 1 == or if{ 715 } els{ 0 }-->
(A:AMBIENT PRECIP RATE, millimeters of water) 5 !> (L:XMLVAR_YokeHidden2) 1 != and (E:Time of Day,enum) 1 == and (A:AMBIENT PRECIP RATE, millimeters of water) 5 > (L:XMLVAR_YokeHidden2) 1 ==; and or if{715} els{0}
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
<!-- Behaviour below makes Light inside the hangar visible if Yoke 2 is hidden and it is not daytime.-->
<Behaviors>
<Component ID="LightInsideOfHangar" Node="InsidePointLight">
<Visibility>
<Parameter>
<Code>(L:XMLVAR_YokeHidden2) 1 == (E:Time of Day,enum) != or if{1} els {0}</Code>
</Parameter>
</Visibility>
</Component>>
</Behaviors>
</ModelInfo>
