Re: Another Nasal issue
Posted: Thu Oct 05, 2017 6:45 pm
oh that's good.
Im still clueless
Im still clueless
An independent forum for FlightGear users and developers
https://thejabberwocky-net.brendtandbrendt.com/~brendta1/thejabberwocky/
https://thejabberwocky-net.brendtandbrendt.com/~brendta1/thejabberwocky/viewtopic.php?f=15&t=1142
it0uchpods wrote:Hi
Is there still an issue? If so, maybe I can help solve it.
Can you post your latest revision of the code, and the exact error?
Kind Regards,
Josh
Code: Select all
#### Set Diesel idle level/cutoff with throttle position and mixture with altitude.
var pos_throttle = props.globals.getNode("controls/engines/engine[0]/throttle");
var pos_mixture = props.globals.getNode("controls/engines/engine[0]/mixture");
var pos_gear = props.globals.getNode("gears/gears[1]/wow");
var pos_alt = props.globals.getNode("instrumentation/altimeter/pressure-alt-ft");
setlistener("/controls/engines/engine[0]/throttle", func {
var throttle = pos_throttle.getValue();
if (throttle >= 0.05) { pos_mixture.setValue(1.0); return 0; }
if (throttle > 0) { pos_mixture.setValue(0.068); return 0; }
pos_mixture.setValue(0);
});
#### Set mixture to alt level
setlistener("/gears/gears[1]/wow", func {
var gear = pos_gear.getValue();
if (gear = false) { pos_gear.setValue(1.0); return 0;
if (gear = true) { pos_mixture.setValue(1.0); return 0;
var alt = pos_alt.getValue();
var mixture = "controls/engines/engine[0]/mixture";
if (alt >= 15000) { pos_mixture.setValue(0.59); return 0;
## }
## if (getprop(alt) < 15000) {
## setprop (mixture, 0.59);
## }
if (alt >= 10000) { pos_mixture.setValue(0.71); return 0;
## }
## if (getprop(alt) < 10000) {
## setprop (mixture, 0.82);
## }
if (alt >= 5000) { pos_mixture.setValue(0.84); return 0;
## }
## if (getprop(alt) < 5000) {
## setprop (mixture, 0.94);
## }
if (alt > 3000) { pos_mixture.setValue(0.91); return 0;
## }
var MixtureInit = func {
var AltInit = func {
settimer(env_effects, 2);
settimer(mixture_loop, 3);
settimer(alt_loop, 3);
# Delay startup a bit to allow things to initialize
# }
Code: Select all
var mixture = "controls/engines/engine[0]/mixture";
Code: Select all
var mixture = getprop("controls/engines/engine[0]/mixture");