Modules.nas: Difference between revisions

Jump to navigation Jump to search
m
Line 13: Line 13:
In ''modules.nas'' the class ''Module'' is defined.  
In ''modules.nas'' the class ''Module'' is defined.  
A module object holds information about the path and filename of the Nasal script and supports unloading and reloading the code at runtime
A module object holds information about the path and filename of the Nasal script and supports unloading and reloading the code at runtime
(e.g. without restarting Flightgear as a whole) by tracking some critical resources like listeners and timers.
(e.g. without restarting Flightgear as a whole) by tracking some critical resources like [[Listener|listeners]] and [[Timers|timers]].


Parts of this functionality where added to the addons manager earlier and have been extracted now to avoid code duplication.
Parts of this functionality were added to the [[Addons|addons]] manager earlier and have now been extracted to avoid code duplication.


=== Differences between add-ons and modules ===
=== Differences between add-ons and modules ===
While there are many similarities between add-ons and modules, some words on the differences:  
While there are many similarities between add-ons and modules, some words on the differences:  


Modules are distributed with Flightgear as part of FGDATA.
Modules are distributed with FlightGear as part of Fgdata.
Add-ons have to be downloaded separatly by a flightgear user from wherever the author of the add-on publishes the add-on.
Add-ons have to be downloaded separately by a FlightGear user from wherever the author of the add-on publishes the add-on.


Modules can be loaded e.g. by an aircraft if the aircraft developer wants to make use of the module.
Modules can be loaded e.g. by an aircraft if the aircraft developer wants to make use of the module.
Add-ons are selected by the user before launching Flightgear, thus they may or may not be available at runtime.
Add-ons are selected by the user before launching FlightGear, thus they may or may not be available at runtime.


== Nasal modules ==
== Nasal modules ==

Navigation menu