- Lua Programming Language — the heart of MoonLoader. Lua is one of the most popular scripting languages, it has huge community, Lua is very widely used in game development, it's very simple but also very flexible programming language.
- Very easy to learn — despite it is a simple language there are a lot of tutorials, guides, books, courses and answered questions
- Great community — lots and lots ready-made solutions, almost every programming universal objective is solved
- Simple and powerful
- No programming limits (compared to SCM)
- No compilation needed
- Safety and error handling
- Built-in debugging tools
- Good and straightforward API
- And much more...
- MoonLoader uses LuaJIT — a just-in-time compiler for Lua and the fastest scripting engine
- FFI — FFI is an embedded library in LuaJIT, it provides direct interface between Lua and process memory and gives ability to directly call functions in memory, access data structures, pass Lua-functions to memory and even write on Assembly with DynASM from pure Lua. And, as everyone knows, all this is an integral part of gamemodding
- Script Management — script management system allows to obtain information about scripts and manipulate scripts execution
- Compilation is not Necessary — scripts can be compiled but it's not required, and if the script is open source every user can edit it without any preparation
- Error Handling — MoonLoader handles as many errors as it can. If CLEO-script dies because of an error then the whole game dies, but if Lua-script dies due to an error — it just prints the error to the log and stops script execution
- No Dependencies — the only two things are required is installed ASI Loader and version 1.0US of GTA: San Andreas
- Compatible With SA-MP — MoonLoader is meant to be compatible with both sigleplayer game and SA-MP
- Events — track such events like starting new game, window messages, quitting game, stopping script, etc.
- Atom as an Official IDE — Atom is great code editor, it's modern and completely customizable. MoonLoader has its own package for Atom to provide smart autocompletion, function search and error highlighting. Notepad++ also has an official MoonLoader support. If you don't like Atom for some reason, you can choose any text editor, even the standard Notepad. There are really no requirements for any special tools
- Early Stage Loading — Lua scripts loads just after game starts but there are two stages of loading: the "initialization stage" right after game launch and the "active stage" when game loaded
- Separate Save Game System — event-based game saving system allows to control when player starts a new game, loads a game or saves it
- Inter-Script Communication — scripts can exchange data and interact with each other through the export-import feature (it's not the standard function 'require')
- Synchronous Scripting Threads — scripting threads makes synchronous multitasking a lot easier
- Standard Libraries — distro includes some standard libraries with the common development tools
- And of course a bunch of new functions
NOTES AND PLANS
After almost a year of open alpha-testing MoonLoader finally got a beta-testing status. The stability of its work has been verified by time and by many users, but there are some things that you need to be informed about.
Originally was planned that MoonLoader will support all versions of GTA: SA but with increasing functionality it's began to become a more difficult task and in the end it was decided that only v1.0US will be supported, maybe in the future it will change, but not now and there is no promises. Anyway it's not a big problem — most of mods supports only v1.0US as well and this version is most common for modding.
MoonLoader has lack of documentation in English, official wiki is ok but currently it's all in Russian (but has the embedded Google Translate). Another thing is that many of conventional scripting opcodes are not described on our wiki (but you can find descriptions over the Internet, eg on GTAGModding).
Audiostream functions still requires installed CLEO due to the comparative complexity of the implementation. DXUT, SA-MP and some render functions requires SAMPFUNCS installed, because they are opcodes from SAMPFUNCS. If you don't use these functions, CLEO or SAMPFUNCS is not required.
Since MoonLoader emulates SCM opcodes to provide all familiar game scripting functions, it makes small speed overhead for these functions compared to SCM — it is the cost for the all standard scripting functionality, but in most cases MoonLoader is faster than SCM. The most common opcodes are gradually replaced with built-in functions in newer versions.
Lua has no native support of thread saving into the file and MoonLoader doesn't support this as well. But it's not that bad, there is event-based game saving system that provides full control over saving and loading game.
As was said before, MoonLoader handles as much errors as it can, but due to several LuaJIT circumstances some errors cannot be handled properly without hurting performance, so they aren't handled (error message still outputs to the log file).
At this moment MoonLoader already has all necessary concepts and new functionality (like more game functions) can be easily implemented via dll and lua modules. The current plans is to add good rendering API and fix some of issues listed above.
If you are interested in Lua script development check the getting started guide.
FYP, hnnssy, EvgeN 1137
DK22Pac, MISTER_GONWIK, 4el0ve4ik, EXPORT, Garrus
Installation: run setup-moonloader.exe and follow steps of the installation master
Download Archive (for manual installation. Doesn't include extension for Notepad++)
Installation: extract all files from downloaded archive to the GTA: San Andreas root folder (make sure you have ASI Loader installed)
Download Script Examples
Follow the script installation instructions or just copy all content related to the script into the 'moonloader' folder located in the game's root directory.
Wiki (Translated via Google Translate from Russian): main page; all pages related to MoonLoader
Lua Mods on BlastHack (some of them are available in archive with examples, but the threads in the forum have descriptions)
Official Russian Thread
Official Russian Development Thread