I'm testing a nasal script which includes several subscripts by io.include(). I work on the scripts in an external editor and perform the main script test.nas from the nasal console by
- Code: Select all
io.load_nasal("~/.fgfs/Aircraft/Testflyer/Nasal/test.nas");
Changes at the script test.nas take effect whenever I save the file and press Execute. But the logical contents of the included files (which contain classes and hashes) is not updated unless I restart Flightgear. I think it's because any included file is loaded only once in the current context. To reload the file the current context has to be deleted.
The need to restart the simulator on every change at one of the sub files is very annoying and frustrating. In the Debug menu there are many options to restart the Network, Autopilot, HUD, Materials, Scenery etc. Why not an option to Restart/Reset Nasal?
Is there any way to restart/reset the nasal system or the current context without restarting the whole program? Or is there any other option to re-include the sub files or "undefine" hashes and classes defined there?
Any help is welcome. Thanks in advance.
Autowings