I have been getting started with the electrical system on my L1011 project. I have to say that the way Asobo has set this up makes it so easy to create a complex system; I just can't get it to work.
I have set up my generators and buses, but I'm having problems with the circuits. I've started out by connecting a fuel pump. After rooting through the default templates, I gather that the only way to turn off a fuel pump is by disabling it's circuit. I've set up my own template to do this as shown below. The button animates correctly, but as far as I can tell, the circuit variable value turns to zero only for a split second before going back to one. (Elsewhere, I put the A value into an L:Var so I can see the value in the L:Var window we have available in development mode.) I can't see anything in my code that would flip the circuit back on and I am using the same code as Asobo.
I just can't figure out what's turning the circuit back on.
I have set up my generators and buses, but I'm having problems with the circuits. I've started out by connecting a fuel pump. After rooting through the default templates, I gather that the only way to turn off a fuel pump is by disabling it's circuit. I've set up my own template to do this as shown below. The button animates correctly, but as far as I can tell, the circuit variable value turns to zero only for a split second before going back to one. (Elsewhere, I put the A value into an L:Var so I can see the value in the L:Var window we have available in development mode.) I can't see anything in my code that would flip the circuit back on and I am using the same code as Asobo.
I just can't figure out what's turning the circuit back on.
Code:
<Template Name ="L1011_FUEL_PUMP_BTNS">
<UseTemplate Name="ASOBO_GT_Anim_Code">
<ANIM_NAME>TANK_PUMP_ANIM_#KEY#</ANIM_NAME>
<ANIM_CODE>(L:L1011_TANK_PUMP_#KEY#,number) 2 *</ANIM_CODE>
<ANIM_LAG>20</ANIM_LAG>
<ANIM_LENGTH>2</ANIM_LENGTH>
</UseTemplate>
<UseTemplate Name="ASOBO_GT_MouseRect">
<TOOLTIPID>#KEY#</TOOLTIPID>
<CURSOR>Hand</CURSOR>
<MOUSEFLAGS_DEFAULT_IM>LeftSingle+LeftRelease</MOUSEFLAGS_DEFAULT_IM>
<CALLBACKCODE_DEFAULT_IM>
(M:Event) 'LeftSingle' scmi 0 == if{ 1 (>L:L1011_TANK_PUMP_#KEY#,number)
(A:CIRCUIT SWITCH ON:#KEY#, Bool) if{
#KEY# (>K:ELECTRICAL_CIRCUIT_TOGGLE)
}
}
(M:Event) 'LeftRelease' scmi 0 == if{ 0 (>L:L1011_TANK_PUMP_#KEY#,number) }
</CALLBACKCODE_DEFAULT_IM>
</UseTemplate>
</Template>
<Component ID="L1011_FUEL_PUMP_1" Node="Cube.233">
<UseTemplate Name="L1011_FUEL_PUMP_BTNS">
<KEY>1</KEY>
</UseTemplate>
</Component>