--list some things you want to trigger failuresdr_sim_ITT_c = xp.getDataref("sim/flightmodel/engine/ENGN_ITT_c")-- Aqui buscas las DATAREF del motor que quieres que produzca el Fallo ( alta Temperatura, excesivo uso de N1 Mayor a 100 %, Baja presion de aceite, Baja Presion de combustible, Alta Temperatura de Aceite... en FIN --list what failure datarefs you want to faildr_sim_engine_fail1 = xp.getDataref("sim/operation/failures/rel_engfir1")function engineOverStress()--build a timer that begins when the limit is reached, but is destroyed if the limit is no longer reached before the timer goes offlocal timer_overStress = nillocal ITT = xp.getFloatV(dr_sim_ITT_c, 1, 2) --either of my engines in this case--start an argumentif ITT >600 then if (timer_overStress == nil) then timer_overStress = timer.newOneShot("failEngine", 15) --calls failEngine() in 15 seconds unless the pilot reduces ITT! endelseif ITT <600 then if (timer_overStress ~= nil) then timer.stop(timer_overStress) --stops the timer when pilot corrects his erroneous ways end endend------function failEngine()--the dirty work...xp.setInt(dr_sim_engine_fail1, 6) -- Mode 7 inoperative [6]--[[The failure method used in X-Plane has 7 modes-1. always working [0 in lua]2. mean time until failure [1]3. exact time until failure [2]4. fail at exact speed KIAS [3]5. fail at exact altitude AGL [4]6. fail if CTRL f or JOY [5]7. inoperative [6]]]--end
NORCASA 150.000000 0.0000000.005000 0.0148220.007500 0.0179010.012500 0.0225990.025000 0.0306580.050000 0.0408590.075000 0.0478230.100000 0.0531740.150000 0.0612140.200000 0.0672000.250000 0.0714900.300000 0.0740010.350000 0.0750120.400000 0.0748070.450000 0.0731300.500000 0.0697800.550000 0.0651750.600000 0.0595650.650000 0.0531100.700000 0.0459910.750000 0.0384690.800000 0.0308400.850000 0.0232100.900000 0.0155800.950000 0.0079501.000000 0.0003200.000000 0.0000000.005000 -.0148220.007500 -.0179010.012500 -.0225990.025000 -.0306580.050000 -.0408590.075000 -.0478230.100000 -.0531740.150000 -.0612140.200000 -.0672000.250000 -.0714900.300000 -.0740010.350000 -.0750120.400000 -.0748070.450000 -.0731300.500000 -.0697800.550000 -.0651750.600000 -.0595650.650000 -.0531100.700000 -.0459910.750000 -.0384690.800000 -.0308400.850000 -.0232100.900000 -.0155800.950000 -.0079501.000000 -.000320