[Flightgear-devel] Nasal question

2004-02-10 Thread Josh Babcock
Is there a way to assign an instantaneous joystick button, but not have the value jump directly from one value to another? Currently I have the following code in my joystick file but it results in the brakes snapping on and off. I wanted to get a smoother transition to be more realistic in gr

[Flightgear-devel] nasal question

2004-03-14 Thread David Culp
I want the 737's heading bug to be set to the aircraft's current magnetic heading at startup. I put a nasal script in 737-jsbsim-set.xml like this: setprop("/autopilot/settings/heading-bug-deg", getprop("/orientation/heading-magnetic-deg")); The problem is that t

[Flightgear-devel] Nasal - Question

2004-06-17 Thread Vivian Meazza
I have hit a snag while writing some Nasal script for the Spitfire model: I put this in the spitfireIIa-set.xml file 1 1 I then try to access it elsewhere. This works: nasal setprop("controls/engines/engine/m

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() func

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Josh Babcock
Andy Ross wrote: 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 repeatable

Re: [Flightgear-devel] Nasal question

2004-02-10 Thread Josh Babcock
Never mind. I just remembered interpolate. This works perfectly. Josh Left Brake true nasal interpolate("/controls/gear/brake-left", props.globals.getNode("/controls/gear/brake-left").getValue(), 0, 1, 0.1) true nasal interpolate("/controls/gear/brake-left", props.globals.getNod

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

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-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 1 1 I then try to access it elsewhere. This works: nasal
setprop("controls/engines/engine/magne

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 1 1 I then try to access it elsewhere. This works: nasal setprop("cont

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 1 1 I then try to access it elsewhere. This works: nasal

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 > >>> > >>> > >>> 1 > >>>

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 j

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

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 a

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 > *switc

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); >