Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Curtis L. Olson
Vivian Meazza wrote: I have hit a snag while writing some Nasal script for the Spitfire model: I put this in the spitfireIIa-set.xml file controls engines engine n=0 magneto-switch type=bool1/magneto-switch magneto-switch type=bool1/magneto-switch /engine

Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Josh Babcock
Curtis L. Olson wrote: Vivian Meazza wrote: I have hit a snag while writing some Nasal script for the Spitfire model: I put this in the spitfireIIa-set.xml file controls enginesengine n=0 magneto-switch type=bool1/magneto-switch magneto-switch

Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Curtis L. Olson
Josh Babcock wrote: Curtis L. Olson wrote: Vivian Meazza wrote: I have hit a snag while writing some Nasal script for the Spitfire model: I put this in the spitfireIIa-set.xml file controls enginesengine n=0 magneto-switch type=bool1/magneto-switch magneto-switch

RE: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Vivian Meazza
Curtis L. Olson Josh Babcock wrote: Curtis L. Olson wrote: Vivian Meazza wrote: I have hit a snag while writing some Nasal script for the Spitfire model: I put this in the spitfireIIa-set.xml file controls enginesengine n=0 magneto-switch

Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Andy Ross
Vivian Meazza wrote: Curtis L. Olson wrote: Right, but the aircraft I have seen have just one *switch* ... off, both, left, right (and sometimes starter power is rolled in too.) If the physical aircraft has a separate switch for each magneto, then the underlying logic should just change

Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Andy Ross
Vivian Meazza wrote: This works: setprop(controls/engines/engine/magneto-switch[0],1); But this doesn't: setprop(controls/engines/engine/magneto-switch[1],1); I can work around it no problem, but I think that it should work. I can see, but can't access ../magneto-switch[1] in the Browse

Re: [Flightgear-devel] Nasal - Question

2004-06-17 Thread David Megginson
Andy Ross wrote: Actually, it might be cleaneast to model the engine control properties as something like: /engines/engine[n]/magneto[0] (boolean) /engines/engine[n]/magneto[1] (boolean) /engines/engine[n]/starter(boolean) And re-write the standard switch binding such that it sets the

RE: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Vivian Meazza
Andy Ross wrote Sent: 17 June 2004 19:36 To: FlightGear developers discussions Subject: Re: [Flightgear-devel] Nasal - Question Vivian Meazza wrote: Curtis L. Olson wrote: Right, but the aircraft I have seen have just one *switch* ... off, both, left, right (and sometimes

RE: [Flightgear-devel] Nasal - Question

2004-06-17 Thread Vivian Meazza
Andy Ross advised Sent: 17 June 2004 19:32 To: FlightGear developers discussions Subject: Re: [Flightgear-devel] Nasal - Question Vivian Meazza wrote: This works: setprop(controls/engines/engine/magneto-switch[0],1); But this doesn't: setprop(controls/engines/engine/magneto

Re: [Flightgear-devel] nasal question

2004-03-14 Thread Andy Ross
David Culp wrote: The problem is that the script is executed while the aircraft's heading is still zero, prior to it being oriented with the runway. Is there a way to have the script execute only after the aircraft is aligned with the runway? As an immediate hack, you can set it up to run

Re: [Flightgear-devel] nasal question

2004-03-14 Thread David Culp
settimer(func { setprop(SRCPROP, getprop(DSTPROP)) }, DELAY); Thanks Andy, six seconds works well for me, which seems like a lot. I wonder how much variation there is among users. It would be nice if we had a standard nasal script, init-complete.nas, that is called after everything else

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Andy Ross
Josh Babcock wrote: I tried propertySlew() but it seems that the value wasn't going to the numbers I supplied, but only slewing for a very short period of time taht wasn't even consistant. You need to mark the bindings repeatable. See the trim bindings for examples. The propertySlew()

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Josh Babcock
Andy Ross wrote: SNIP You need to mark the bindings repeatable. See the trim bindings for examples. Whoops. Typo, or cut-and-past-o I guess. That's what you get for coding with the flu I. Now the brakes go on like I want, but I have the same problem with them coming off. Apparently

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Josh Babcock
Never mind. I just remembered interpolate. This works perfectly. Josh button n=1 descLeft Brake/desc repeatable type=booltrue/repeatable binding commandnasal/command scriptinterpolate(/controls/gear/brake-left, props.globals.getNode(/controls/gear/brake-left).getValue(), 0, 1, 0.1)/script

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Andy Ross
Some quick suggestions: You wrote: interpolate(/controls/gear/brake-left, props.globals.getNode(/controls/gear/brake-left).getValue(), 0, 1, 0.1) Actually, the implementation of interpolate() always starts from the current value of a property, so in fact there's no