Changes

Jump to: navigation, search

Custom blackout system

510 bytes added, 12:32, 22 November 2016
Install in an aircraft: Made it compatible with 2017.1.0
## Author: Nikolai V. Chr. ##
## ##
## Version 1.03 04 License: GPL 2.0 ##
## ##
###################################################################################
 
var redout_loop = func {
setprop("sim/rendering/redout/enabled", 1);# enable the Fg default redout/blackout system.
setprop("sim/rendering/redout/parameters/blackout-onset-g", blackout_onset);
setprop("sim/rendering/redout/parameters/blackout-complete-g", blackout_fast);
setprop("sim/rendering/redout/parameters/redout-onset-g", redout_onset);
setprop("sim/rendering/redout/parameters/redout-complete-g", redout_fast);
setprop("sim/rendering/redout/parameters/onset-blackout-sec", blackout_onset_time);
setprop("sim/rendering/redout/parameters/fast-blackout-sec", blackout_fast_time);
setprop("sim/rendering/redout/parameters/onset-redout-sec", redout_onset_time);
setprop("sim/rendering/redout/parameters/fast-redout-sec", redout_fast_time);
setprop("sim/rendering/redout/parameters/recover-fast-sec", fast_time_recover);
setprop("sim/rendering/redout/parameters/recover-slow-sec", slow_time_recover);
}
var blackout_loop = func {
var timer = maketimer(0, func blackout_loop() );
timer.start();
 
if (getprop("sim/rendering/redout/internal/log/g-force") == nil) {
var timer = maketimer(0, func blackout_loop() );
timer.start();
} else {
var timer = maketimer(0.5, func redout_loop() );
timer.start();
}
}
removelistener(blackout_init_listener);
}, 0, 0);
 
 
var test = func (blackout_onset, blackout_fast, blackout_onset_time, blackout_fast_time) {
var blackout_onset_log = math.log10(blackout_onset);
var blackout_fast_log = math.log10(blackout_fast);
 
var g = 5;
print();
while(g <= 20) {
 
var g_log = g <= 1?0:math.log10(g);
 
var curr_time = math.log10(blackout_onset_time) + ((g_log - blackout_onset_log) / (blackout_fast_log - blackout_onset_log)) * (math.log10(blackout_fast_time) - math.log10(blackout_onset_time));
 
curr_time = math.pow(10, curr_time);
 
curr_time = clamp(curr_time, 0, 1000);
 
printf("%0.1f, %0.2f", g, curr_time);
 
g += .5;
}
print();
}
</syntaxhighlight>
549
edits

Navigation menu