Andy Ross writes:
> Curtis L. Olson wrote:
> > David, (Andy?)
> >
> > It appears that in the latest cvs, we have lost the ability to control
> > the engines independently.
> 
> This one is mine.  The recent Nasal stuff contains a rework of the
> engine handling to allow for arbitrary numbers of engines, and avoid
> the "why are there 10 engines on the skyhawk?" issue.
> 
> > Previously you could type <Shift-1> <Shift-2> <Shift-3> ... etc. to
> > select an engine.  Then '{' and '}' would select the magnetos.
> > Finally, "space bar" would kick in the starter motor for as long as it
> > was depressed.
> 
> Let me take a look.  I presume you're seeing this with the DC-3?  The
> code (selectEngine(), stepMagnetos() and startEngine() in
> controls.nas) looks more or less correct at first reading.  I'm pretty
> sure I remember testing this with a multiengine aircraft...

Andy,

The following line is failing in the stepMagneto() and startEngine()
functions.  If the first engine is selected, this returns 1 for every
engine.  If any other engine is selected, this returns 0.

        select = sel.getChild("engine", i);

Could there be a bug in this form of getChild()?

If I rewrite the function to avoid using getChild() things work again,
for instance:

startEngine = func {
    sels = props.globals.getNode("/sim/input/selected").getChildren("engine");
    engs = props.globals.getNode("/controls/engines").getChildren("engine");
    count = size(sels);
    if (size(engs) < count) {
        count = size(engs);
    }
    for(i=0; i<count; i=i+1) {
        if(sels[i].getValue()) {
            engs[i].getNode("starter").setBoolValue(1);
        }
    }
}

Thanks,

Curt.
-- 
Curtis Olson   HumanFIRST Program               FlightGear Project
Twin Cities    curt 'at' me.umn.edu             curt 'at' flightgear.org
Minnesota      http://www.flightgear.org/~curt  http://www.flightgear.org

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to