Paul Surgeon wrote:

Would anyone object if I tied nasal code specific to scenarios into FG aircraft?

Currently there isn't a way to load nasal code when a scenario is loaded and the only feasible way seems to be to add a check in the aircraft config files and then load a specific nasal script if a scenario is running. In my opinion it's an architectural no-no but at the moment it's the path of least resistance.

Reason : I was considering adding training scenarios to FG similar to what can be found in MSFS2004.

I either need to lock the scenarios to a specific aircraft like the 172 and dissallow the user from selecting other suitable aircraft like the J3Cub, 182, Cirrus SR20, etc. or I need to modify a whole stack of aircraft and give the user to option of learning in their favourite aircraft.

I'm pretty sure that any scripts you drop into the $FG_ROOT/data/Nasal/ directory will be automatically loaded. You can use a timer hack to have the script run every iteration. You could probably check the status of a property you create to run the script or just skip the whole thing ...

if ( getprop("/sim/paul-surgeon/training/scripts-enabled") ) {
 train();
} else {
 # do nothing
}

That means the code would be loaded and occupy space no matter what, but it would only get executed if the enable flag was set to true.

Perhaps there is a better way to conditionally load nasal code (but not on a per-aircraft basis?)

For what it's worth, I think a set of training scripts (with some corresponding documentation) would be a great addition to FlightGear. You might consider setting up some basic user setable parameters so the scripts could easily be adapted to a variety of aircraft ... things like basic target speeds for the manuevers, number of engines, perhaps flags to specify what equipment is available ... then the scripts could intelligently fail things at inopportune times.

If you have any questions about setting up weather parameters or setting an initial aircraft location, heading, altitude, speed, just holler ... that stuff should all be 'easily' doable from scripts.

Note also that you could do much, if not all of this from an external perl/python script as well and interface to FG through the network interface.

101 ways to skin a cat ...

Regards,

Curt.

--
Curtis Olson        http://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:        2f585eeea02e2c79d7b1d8c4963bae2d



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to