Post a sample logic
<!-- Gun Cam, Disable AP submode for simulating Weapon system -->
(A:AUTOPILOT YAW DAMPER, bool) (A:CIRCUIT AUTOPILOT ON, Bool) * 0 == if{
(E:ABSOLUTE TIME, enum) (>L:GCR_Heat_Run, enum)
-1 d (>L:GCR_On, enum) (>L:GCR_Act, enum)
}
els{
(L:GCR_Heat_Run, enum) 0 > if{ (E:ABSOLUTE TIME, enum) (L:GCR_Heat_Run, enum) - (>L:GCR_Heat_Act, enum) }
(L:GCR_Heat_Act, enum) 30 > if{ 1 (>L:GCR_On, enum) 0 d (>L:GCR_Heat_Run, enum) (>L:GCR_Heat_Act, enum) }
(L:GCR_Heat_Act, enum) 10 / int (>L:GCR_Heat, enum)
(A:BRAKE INDICATOR, Percent) (L:GCR_On, enum) * 25 > (A:GEAR HANDLE POSITION, Bool) 1 < and if{
(L:GCR_Act, enum) 1 < if{ (>K:CAPTURE_SCREENSHOT) 1 (>L:GCR_Act, enum) }
} els{ -1 (>L:GCR_Act, enum) }
}
(A:AUTOTHROTTLE ACTIVE, bool) 1 == if{
(>K:AP_MACH_OFF) (>K:AP_PANEL_MACH_OFF)
(>K:AP_AIRSPEED_OFF) (>K:AP_PANEL_SPEED_OFF)
}
(A:AUTOPILOT TAKEOFF POWER ACTIVE, bool) 1 == if{ (>K:AUTO_THROTTLE_TO_GA) }
(A:AUTOPILOT MASTER, bool) 1 == if{
(>K:AP_WING_LEVELER_OFF) (>K:AP_ALT_HOLD_OFF)
(>K:AP_NAV1_HOLD_OFF) (>K:AP_HDG_HOLD_OFF)
(A:AUTOPILOT ATTITUDE HOLD, bool) 1 == if{ (>K:AP_ATT_HOLD) }
}
<!-- Gun Cam, Disable AP submode for simulating Weapon system -->
<!-- Gear Brake, Gun fire -->
(A:GEAR HANDLE POSITION, Bool) 0 > if{
(A:LIGHT STROBE, Bool) 1 == if{ (>K:STROBES_TOGGLE) }
(A:LIGHT BEACON, Bool) 1 == if{ (>K:TOGGLE_BEACON_LIGHTS) }
(A:BRAKE INDICATOR, Percent) 5 > (A:NOSEWHEEL LOCK ON, Bool) 1 < and if{
(A:FOLDING WING HANDLE POSITION, Bool) 0 == if{ (>K:TOGGLE_WING_FOLD) }
}
els{
(A:FOLDING WING HANDLE POSITION, Bool) 1 == if{ (>K:TOGGLE_WING_FOLD) }
}
}
els{
(A:FOLDING WING HANDLE POSITION, Bool) 1 == if{ (>K:TOGGLE_WING_FOLD) }
(L:N37_Qty, enum) 0 > (A:BRAKE RIGHT POSITION, Percent) 5 > and if{
(A:LIGHT BEACON, Bool) 0 == if{ (>K:TOGGLE_BEACON_LIGHTS) (L:N37_Fired, enum) 1 + (>L:N37_Fired, enum) }
}
els{
(A:LIGHT BEACON, Bool) 1 == if{ (>K:TOGGLE_BEACON_LIGHTS) }
}
(L:N23_Qty, enum) 0 > (A:BRAKE LEFT POSITION, Percent) 5 > and if{
(A:LIGHT STROBE, Bool) 0 == if{ (>K:STROBES_TOGGLE) (L:N23_Fired, enum) 2 + (>L:N23_Fired, enum) }
}
els{
(A:LIGHT STROBE, Bool) 1 == if{ (>K:STROBES_TOGGLE) }
}
}
<!-- Gear Brake, Gun fire -->
1,All variables borrow to functional system will change or disable it`s default function both in aircraft.cfg and air file, they will not affect aircraft flight controls.
2,Make yaw damper variable for gun camera power bus switch, when it on, gun camera (GCR) will have 30 sec for heating and powerup for operating.
3,When gun camera ready, aircraft in flight and gear up(means normal flight condition for combat or trainning), press brake button as trigger to starting gun fring and screenshot taken.
4, (A:AUTOPILOT MASTER, bool) for arm N37 gun, (A:AUTOTHROTTLE ACTIVE, bool) for arm Ns23 guns, so their submods been disable in my logic code.
5, beacon light and strobe light variables for simulate gun fire, it limited by ammo qty local variables (L:N23_Qty, enum) and (L:N37_Qty, enum) , the ammo qtys setting via payload station weight, and load on guns via weapon arming and loading stage, when press trigger to firing rounds, (L:N23_Fired, enum) (L:N37_Fired, enum) variables will count fired rounds, so the current remain ammo rounds will feed date to qtys variables. when qtys running to 0, gun and gunfire effects inops by press trigger button.
Because brakes will have functional when wheel brakes on ground, so it must set a conditional judgement to avoid it operate gun firing in none combat flight. I put gear down for this judgement.
6,but gun camera still can be operated when guns running out of ammo, it will using in trainning course have no living weaopns.
7, (A:FOLDING WING HANDLE POSITION, Bool) toggle pneumatic brake sound effect when aircraft brake on ground, it will release fold condition when aircraft reach rolling speed on runway to avoid wings folding affect the flight controls.