Inspired by the work of SinusJayCee (Ameland signal island) I modeled my own landing tees and adopted the files necessary for making the working simObject.
It's a great start, but it has two issues which I'd like to dig into:
I'm new to this and the documentation seems a bit patchy. So I was hoping this is the place where the black-belt scenery devs hang out and they could maybe give me some pointers. I'd be very grateful.
To solve problem 1 it would be necessary for the code to be able to access the object instance's heading. Is this at all possible?
The first line of the code-section evaluates the condition for the flip. The 74.7 is the hardcoded heading of the tee which I would like to replace with the real object data.
To solve problem 2 I'd like to add some hysteresis. For that I need some state variable which is scoped to the instance of the tee. In the (limited) documentation I can only find references to something that seems to amount to global variables. How are local variables done?
The code in the xml-file looks like this (for a tee that is modeled to point at 0°):
It's a great start, but it has two issues which I'd like to dig into:
- hardcoded heading for the flipping action, so that the simObject is not really reusable in different airfields with different runway orientations. (not actually sure what SJC did there. "hard-modelling" the heading I presume).
- the tee flip-flops too easily in sideways winds.
I'm new to this and the documentation seems a bit patchy. So I was hoping this is the place where the black-belt scenery devs hang out and they could maybe give me some pointers. I'd be very grateful.
To solve problem 1 it would be necessary for the code to be able to access the object instance's heading. Is this at all possible?
The first line of the code-section evaluates the condition for the flip. The 74.7 is the hardcoded heading of the tee which I would like to replace with the real object data.
To solve problem 2 I'd like to add some hysteresis. For that I need some state variable which is scoped to the instance of the tee. In the (limited) documentation I can only find references to something that seems to amount to global variables. How are local variables done?
The code in the xml-file looks like this (for a tee that is modeled to point at 0°):
XML:
<?xml version="1.0" ?>
<ModelInfo guid="{7bc3e325-f3c3-4557-b953-61c76b741be5}" version="1.1">
<LODS>
<LOD ModelFile="tee.gltf"/>
</LODS>
<Animation guid="8eebb0b7-6f9f-4d4b-a5f3-856a9e3259a6" length="1" name="flip" type="Sim" typeParam="AutoPlay" typeParam2="flip"/>
<PartInfo>
<Name>flip</Name>
<AnimLength>1</AnimLength>
<Animation>
<Parameter>
<Code>
74.7 (A:AMBIENT WIND DIRECTION, Degrees) - 450 + 360 % 180 <
if{ 1 }
els{ 0 }
</Code>
</Parameter>
</Animation>
</PartInfo>
</ModelInfo>
