[Flightgear-devel] Nasal in scenery object XML files

2006-03-01 Thread Melchior FRANZ
FYI: I've now added Nasal support for scenery objects to my copy of
sg  fg. This can be used for 'intelligent' objects -- special lighting
features, specific lighthouse signals, things that couldn't be done
with animations alone. The code is run as soon as the tile loader
decided to load the model. It can use listeners and timers and so
run as long as it wishes. If the object is removed from memory,
then a variable is changed in the object's namespace, so that the
code can stop itself. An optional destructor part can be used for
further cleanup (remove listeners etc.)

The required changes for sg  fg are minimal, but because of the
nearing release I better send the patches for review after the
release. See below for an example.

m.



?xml version=1.0?
PropertyList
pathhelipad.ac/path

nasal
script
f = func {
if (!valid) { return }
print(Hello, I'm the helipad!);
settimer(f, 5);
}
f();
/script

script   !-- optional destructor --
print(Bye, bye!)
/script
/nasal

animation
typenoshadow/type
object-namehelipad/object-name
/animation
/PropertyList


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Nasal in scenery object XML files

2006-03-01 Thread Josh Babcock
Melchior FRANZ wrote:
 FYI: I've now added Nasal support for scenery objects to my copy of
 sg  fg. This can be used for 'intelligent' objects -- special lighting

Can you make a patch available for those of us that want to experiment
with this?

Josh



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Nasal in scenery object XML files

2006-03-01 Thread Roberto Inzerillo
 FYI: I've now added Nasal support for scenery objects to my copy of
 sg  fg. This can be used for 'intelligent' objects -- special lighting
 features, specific lighthouse signals, things that couldn't be done
 with animations alone.

That is great! Thank you Melchior :-)
That will open new horizons to people like me who like adding nice widgets
to the scenery. Serious air flight 'addicted' ones will be pleased with more
realistic environment too, of course :-)

I was trying to get realistic lighthouse signals with the former animation
system but that has a few limitations which cannot be overcome with any
amount of fantasy. I hope Nasal scripting will help more.

 The code is run as soon as the tile loader
 decided to load the model. It can use listeners and timers and so
 run as long as it wishes. If the object is removed from memory,
 then a variable is changed in the object's namespace, so that the
 code can stop itself. An optional destructor part can be used for
 further cleanup (remove listeners etc.)

Is there any chance we can get a nasal-modified binary for Win platform to
play with as soon as something works in an acceptable stable way? I'd
appreciate that a lot.

   cheers,
 Roberto

-- 
Feel free mit GMX FreeMail!
Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Nasal in scenery object XML files

2006-03-01 Thread Andy Ross
Melchior FRANZ wrote:
 If the object is removed from memory, then a variable is changed in
 the object's namespace, so that the code can stop itself.

Rather than set this from C++ code, why not use:

 An optional destructor part can be used for further cleanup (remove
 listeners etc.)

Which can do it all from Nasal with just a single line.  And defining
it as the second script tag seems clumsy to me; how about calling
it on-unload or destroy or something similar?

Andy


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Nasal in scenery object XML files

2006-03-01 Thread Olaf Flebbe
Is there any chance we can get a nasal-modified binary for Win platform toplay with as soon as something works in an acceptable stable way? I'd
appreciate that a lot.If the code is in CVS  (and to be turned on manually) or in a reasonable clean patch, I can supply you with a windows build. Just ask with a private mail.