Howto:Write simple scripts in Nasal
Introduction: Nasal is a scripting language available in FlightGear which opens up a world of possibilities for aircraft modellers. Here, as an example, we will create a script to convert engine temperatures from degF to degC, as required by the Fokker50 instruments.
Creating the nasal file: As with many other things in FG, nasal functions can live in many different places. Here, however, we're going to create a "Systems" directory under the Main fokker50 directory. Later, other files might be added to this directory; an electrical system, functions to control other cockpit indicators, etc.
Within that new fokker50/Systems directory then, create an empty plain text file, we'll call it "degftodegc.nas". Note that many different functions can live in the same .nas file; this could be renamed to something more generic later if other similar functions are added to it in time.
Now, as always add a helpful comment at the top of the file;
# Converts degF to degC