- Messages
- 1,450
- Country
-
Hello lads
Recently, I made a comment on the showroom and Heretic came with and idea. I know this have been said before but I will do it anyway. I have this code working for a 3 way starter switch; it is working as it should and I am trying to make it work as an animated part in the VC. Both engines are simulated as "Engine 2" and "Engine 3". Engine 1 is used to work with animations in both rotors in my Bell 429. I will start showing the code in the 2D gauge:
Now, I have set 3 different mouse areas. From left to right: Starter 2 acting, Center is the neutral position for both starters and the right position is for starter 3.
Heretic suggested I use a control to animate the switch. He used a different variable, however the code is the same:
And now, the "funny" part for me. This is my attempt using the control in order to have a direct interaction between the controller in the 3D object and the 2D gauge. I don't know what I am doing (LOL), but there you go:
Now the "new mouse areas" with the controller:
If I understood well, the part code (FS9) should be something like this:
I am starting to grasp the idea; however a funny sensation is just behind me: I'm complicating everything and just don't know what's wrong. Any ideas certainly will be very welcome.
All the best,
Sergio.
Recently, I made a comment on the showroom and Heretic came with and idea. I know this have been said before but I will do it anyway. I have this code working for a 3 way starter switch; it is working as it should and I am trying to make it work as an animated part in the VC. Both engines are simulated as "Engine 2" and "Engine 3". Engine 1 is used to work with animations in both rotors in my Bell 429. I will start showing the code in the 2D gauge:
HTML:
<!-- Starter Behavior -->
<Element>
<Select>
<Value>
(A:Turb eng2 N1, percent) 55 >
if{ 0 (>L:Eng2StarterSwitch, bool) }
(A:Turb eng3 N1, percent) 55 >
if{ 0 (>L:Eng3StarterSwitch, bool) }
(L:Eng2StarterSwitch, bool) 1 ==
if{ (L:Eng3Running,bool)
if{ (A:General Eng3 Master Alternator, bool) 1 == (A:Turb eng3 N1, percent) 60 > &&
if{ (>K:TOGGLE_STARTER2) }
}
els{ (A:Electrical Master Battery,bool)
if{ (>K:TOGGLE_STARTER2) }
}
}
(L:Eng3StarterSwitch, bool) 1 ==
if{ (L:Eng2Running,bool)
if{ (A:General Eng2 Master Alternator, bool) 1 == (A:Turb eng2 N1, percent) 60 > &&
if{ (>K:TOGGLE_STARTER3) }
}
els{ (A:Electrical Master Battery,bool)
if{ (>K:TOGGLE_STARTER3) }
}
}
</Value>
</Select>
</Element>
Now, I have set 3 different mouse areas. From left to right: Starter 2 acting, Center is the neutral position for both starters and the right position is for starter 3.
HTML:
<!-- M O U S E E V E N T L O G I C -->
<!-- Starter Switches -->
<Area Left="490" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
1 (>L:Eng2StarterSwitch, bool)
</Click>
</Area>
<Area Left="527" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
0 (>L:Eng2StarterSwitch, bool)
0 (>L:Eng3StarterSwitch, bool)
</Click>
</Area>
<Area Left="564" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
1 (>L:Eng3StarterSwitch, bool)
</Click>
</Area>
Heretic suggested I use a control to animate the switch. He used a different variable, however the code is the same:
HTML:
<!-- This is a Mouse area for the 2D panel -->
<Area Left="139" Top="340" Width="42" Height="52">
<Tooltip>Starter (Position: %((L:429_Starter_switch_control, number))%!1.0f!)</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle" Repeat="Yes">
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:429_Starter_switch_control, number) ++ 2 min (>L:429_Starter_switch_control, number) }
(M:Event) 'RightSingle' scmp 0 ==
if{ (L:429_Starter_switch_control, number) -- 0 max (>L:429_Starter_switch_control, number) }
</Click>
</Area>
And now, the "funny" part for me. This is my attempt using the control in order to have a direct interaction between the controller in the 3D object and the 2D gauge. I don't know what I am doing (LOL), but there you go:
HTML:
<!-- Starter Behavior -->
<Element>
<Select>
<Value>
(A:Turb eng2 N1, percent) 55 >
if{ 0 (>L:Eng2StarterSwitch, bool) }
(A:Turb eng3 N1, percent) 55 >
if{ 0 (>L:Eng3StarterSwitch, bool) }
(L:Eng2StarterSwitch, bool) 1 == (L:429_Starter_switch_control, number) 1 == &&
if{ (L:Eng3Running,bool)
if{ (A:General Eng3 Master Alternator, bool) 1 == (A:Turb eng3 N1, percent) 60 > &&
if{ (>K:TOGGLE_STARTER2) }
}
els{ (A:Electrical Master Battery,bool)
if{ (>K:TOGGLE_STARTER2) }
}
}
(L:Eng3StarterSwitch, bool) 1 == (L:429_Starter_switch_control, number) 2 == &&
if{ (L:Eng2Running,bool)
if{ (A:General Eng2 Master Alternator, bool) 1 == (A:Turb eng2 N1, percent) 60 > &&
if{ (>K:TOGGLE_STARTER3) }
}
els{ (A:Electrical Master Battery,bool)
if{ (>K:TOGGLE_STARTER3) }
}
}
</Value>
</Select>
</Element>
Now the "new mouse areas" with the controller:
HTML:
<Mouse>
<!-- Starter Switches with three click areas-->
<Area Left="490" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
1 (>L:Eng2StarterSwitch, bool)
(L:429_Starter_switch_control, number) ++ 2 % (L:429_Starter_switch_control, number)
</Click>
</Area>
<Area Left="527" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
0 (>L:Eng2StarterSwitch, bool)
0 (>L:Eng3StarterSwitch, bool)
(L:429_Starter_switch_control, number) ++ 2 % (L:429_Starter_switch_control, number)
</Click>
</Area>
<Area Left="564" Top="30" Width="35" Height="35">
<Cursor Type="Hand"/>
<Click Repeat="Yes" MouseWheelFlip="No">
1 (>L:Eng3StarterSwitch, bool)
(L:429_Starter_switch_control, number) ++ 2 % (L:429_Starter_switch_control, number)
</Click>
</Area>
</Mouse>
If I understood well, the part code (FS9) should be something like this:
HTML:
<!-- This is an attempt to implement the same Mouse area embeded in the correspondig 3D object (FS9) -->
<part>
<name>bell429_starter_switch</name>
<animation>
<parameter>
<code>1 (L:429_Starter_switch_control) - 25 *</code>
<lag>100</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<Tooltip>Starter (Position: %((L:429_Starter_switch_control, number))%!1.0f!)</Tooltip>
<mouse_flags>LeftSingle+RightSingle</mouse_flags>
<callback_code>
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:429_Starter_switch_control, number) ++ 2 min (>L:429_Starter_switch_control, number) }
(M:Event) 'RightSingle' scmp 0 ==
if{ (L:429_Starter_switch_control, number) -- 0 max (>L:429_Starter_switch_control, number) }
</callback_code>
</mouserect>
</part>
I am starting to grasp the idea; however a funny sensation is just behind me: I'm complicating everything and just don't know what's wrong. Any ideas certainly will be very welcome.
All the best,
Sergio.