- Messages
- 1,451
- Country
Hello lads
I hate the limitations made by the FS9's SDK; among them the lack of control for specific events. In this case, the hated K:TOGGLE_TAXI_LIGHTS event.
I would have liked that MS's guys to do something like that K:TAXI_LIGHTS_SET...
With the high risk to receive a kick in the butt , I will ask for help; I have no idea how to make my switch to work properly.
My plan is:
1.- Set in Gmax the animation as follows:
Key 0: Landing Lights ON (up position).
Key 25: Neutral position: the spring return the switch to center (after it has been used to toggle lights ON or OFF).
Key 50: Landing Lights OFF (down position).
2.- Avoid to all cost, the potential flooding made by the K: event.
3.- Use a control to monitor the switch positions and trigger actions: In this case, (L:407_LandingLT_SwPositionControl, number).
This control, is not implemented in the 2D gauge; instead in the 3D part itself.
4.- Fully Integrate the 2D version with the 3D part.
Here we go...
First, the 2D gauge element to display the switch:
Now, the mouse area:
And finally, the part code:
The problem is that the switch is never going to its ON position (key 0), the "spring" doesn't do its job and the lights do nothing...
Any hint?
In advance, thank you.
Sergio.
I hate the limitations made by the FS9's SDK; among them the lack of control for specific events. In this case, the hated K:TOGGLE_TAXI_LIGHTS event.
I would have liked that MS's guys to do something like that K:TAXI_LIGHTS_SET...
With the high risk to receive a kick in the butt , I will ask for help; I have no idea how to make my switch to work properly.
My plan is:
1.- Set in Gmax the animation as follows:
Key 0: Landing Lights ON (up position).
Key 25: Neutral position: the spring return the switch to center (after it has been used to toggle lights ON or OFF).
Key 50: Landing Lights OFF (down position).
2.- Avoid to all cost, the potential flooding made by the K: event.
3.- Use a control to monitor the switch positions and trigger actions: In this case, (L:407_LandingLT_SwPositionControl, number).
This control, is not implemented in the 2D gauge; instead in the 3D part itself.
4.- Fully Integrate the 2D version with the 3D part.
Here we go...
First, the 2D gauge element to display the switch:
HTML:
<!-- 2D GAUGE: Graphics for Landing Light On/Off Switch -->
<Element>
<Position X="104" Y="28"/>
<Select>
<Value>(L:407_LandingLT_SwPositionControl, number)</Value>
<Case Value="1">
<Image Name="407_switch_coll_UP.bmp" Luminous="Yes"/>
</Case>
<Case Value="0">
<Image Name="407_switch_coll_MD.bmp" Luminous="Yes"/>
</Case>
<Case Value="-1">
<Image Name="407_switch_coll_DN.bmp" Luminous="Yes"/>
</Case>
</Select>
</Element>
Now, the mouse area:
HTML:
<!-- 2D GAUGE: Mouse Area for Landing Light On/Off Switch -->
<!-- Landing Light On/Off Switch -->
<!-- "Landing lights ON" (UP position) -->
<Area Left="104" Top="20" Width="25" Height="18">
<Cursor Type="Hand"/>
<Click Repeat="No" MouseWheelFlip="No">
1 (>L:407_LandingLT_SwPositionControl)
1 (>L:Bell_407_Click, number)
</Click>
</Area>
<!-- "Neutral" (MIDDLE position) -->
<Area Left="104" Top="35" Width="25" Height="18">
<Cursor Type="Hand"/>
<Click Repeat="No" MouseWheelFlip="No">
0 (>L:407_LandingLT_SwPositionControl)
1 (>L:Bell_407_Click, number)
</Click>
</Area>
<!-- "Landing lights OFF" (DOWN position) -->
<Area Left="104" Top="50" Width="25" Height="18">
<Cursor Type="Hand"/>
<Click Repeat="No" MouseWheelFlip="No">
-1 (>L:407_LandingLT_SwPositionControl)
1 (>L:Bell_407_Click, number)
</Click>
</Area>
And finally, the part code:
HTML:
<!-- SPRING LOADED VERSION 1-->
<!-- Landing Light On/Off: Spring Loaded Switch -->
<!-- Taxi lights VARIABLE is used instead the landing lights VARIABLE. (which is used to trigger the flood light in all gauges)-->
<!--
Key 0: Landing Lights ON (up position)
Key 25: Neutral position: the spring return the switch to center (after it has been used to toggle lights ON or OFF).
Key 50: Landing Lights OFF (down position)
-->
<part>
<name>bell407_landing_lt_switch</name>
<animation>
<parameter>
<code>
<!-- Key 25: Neutral position: the spring return the switch to center (after it has been used to toggle lights ON or OFF) -->
(A:Light Taxi, bool) ! (L:407_LandingLT_SwPositionControl, number) 1 == and
(A:Light Taxi, bool) (L:407_LandingLT_SwPositionControl, number) -1 == and
or
if{ 0 (>L:407_LandingLT_SwPositionControl, number) }
<!-- Key 0: Landing Lights ON (up position) -->
(L:407_LandingLT_SwPositionControl, number) 1 ==
if{
(A:Electrical Master Battery,bool) (A:Light Taxi, bool) ! and
if{ (>K:TOGGLE_TAXI_LIGHTS) }
}
<!-- Key 50: Landing Lights OFF (down position) -->
(L:407_LandingLT_SwPositionControl, number) -1 ==
if{
(A:Electrical Master Battery,bool) (A:Light Taxi, bool) and
if{ (>K:TOGGLE_TAXI_LIGHTS) }
}
<!-- Switch Position Control: it should drive the animation -->
(L:407_LandingLT_SwPositionControl, number) s0 0 < 50 * l0 0 == 25 * +
</code>
<lag>100</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>ON (LMB)/OFF (RMB)</tooltip_text>
<mouse_flags>LeftSingle+RightSingle</mouse_flags>
<callback_code>
(M:Event) 'LeftSingle' scmp 0 ==
if{
(L:407_LandingLT_SwPositionControl, number) ++ 1 min (>L:407_LandingLT_SwPositionControl, number)
<!-- Click Sound Effect -->
1 (>L:Bell_407_Click,number)
}
(M:Event) 'RightSingle' scmp 0 ==
if{
(L:407_LandingLT_SwPositionControl, number) -- -1 max (>L:407_LandingLT_SwPositionControl, number)
<!-- Click Sound Effect -->
1 (>L:Bell_407_Click,number)
}
</callback_code>
</mouserect>
</part>
The problem is that the switch is never going to its ON position (key 0), the "spring" doesn't do its job and the lights do nothing...
Any hint?
In advance, thank you.
Sergio.
Last edited: