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
/engines
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
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
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
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
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
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
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
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
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
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:
nasal
SetHeadingBug
script
setprop(/autopilot/settings/heading-bug-deg,
getprop(/orientation/heading-magnetic-deg));
/script
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
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
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
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()
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
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
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
18 matches
Mail list logo