Like others said already, this is basically the correct way - why this isn't working for you, remains unclear until you share your exact code and some more details (OS, case sensitive file system ?).
Other than that, I would generally recommend to always have a single one-liner at the bottom of your Nasal code:
- Code: Select all
print("my module loaded successfully");
This is so that you can see if the module is loaded or not - if there are any unhandled parse errors, the parser will bail out and you won't get to see that line.
Also, for testing purposes, I would suggest to put stuff into $FG_HOME/Nasal instead of $FG_ROOT/Nasal, which is generally intended to be read-only on most OS.
Obviously, YMMV - i.e. if you are planning on shipping/sharing your work with others, the latest "best practice" is actually using a dedicated Nasal Addon ($FG_ROOT/Docs/README.addons or see the wiki).
There is also a skeleton add-on that you can use as a template to prototype new-ones.
As far as I've heard, there are also plans being discussed to extend the add-on mechanism so that it also supports networking
If in doubt, it would be best to share more background information/context with us so that we can provide tailored help...