Nasal Console
| The FlightGear forum has a subforum related to: Nasal Scripting |
| Nasal scripting |
|---|
| Nasal internals |
|---|
FlightGear provides a built-in text editor for writing short pieces of Nasal code, the so called "Nasal Console" is available in FlightGear's menu (Debug > Nasal Console).
The Nasal console is a complete Nasal scripting shell, where you can type and execute Nasal code. Keep in mind though, that it is really only intended for quick hacks, there's currently no way to save or load Nasal modules in $FG_ROOT directly via the console. You can however dump your code to the startup terminal window and paste it to a text file this way.
Usage
In FlightGear's menu (Debug > Nasal Console):
Selecting this item opens a Nasal Console dialog.
The startup/terminal window is also the place where you'll see all the console output created by your scripts (print() statements, logging, warnings/errors etc).
The Nasal console could for example be used to test aircraft functions without having to assign key bindings.
The Nasal console dialog supports several tabs, of which each can hold separate Nasal code snippets, all of which are saved on exit and reloaded next time. This is useful for little tests, or for executing code for which writing a key binding is just too much work, such as "props.dump(props.globals)". It's easy to add more "tabs" (= radio buttons). If you want to add more tabs to hold more code samples, just add more <code> nodes to autosave.xml
The Nasal console dialog supports resizing, Resizing is at the moment done like dragging, but with Ctrl-key pressed (at the beginning). Dialogs expand to North-East, which is a bit unusual and might be changed later. The dialog margins are also sensitive for resizing without pressing the Ctrl-key.