Quantcast

Jump to content

» «
Photo

MoonLoader

SA Released
52 replies to this topic
BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#1

Posted 02 July 2017 - 06:12 PM Edited by BH Team, 4 days ago.

moonloader.png

v.023-beta

 
 

WHAT IS MOONLOADER
MoonLoader is a modification for GTA: San Andreas that brings new ability to use Lua scripts made by mods creators. With Lua scripts you can change some game aspects, expand gameplay and add new features. MoonLoader provides to developers extensive functionality for modding, it includes all familiar capabilities that CLEO has, and also combines many new features that were not previously available together in any GTA: SA modding framework. It is still a young modification and hasn't yet spread widely, but there are some scripts already made, and it aims to become the complete modern CLEO replacement!

 

FEATURES

  • 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
  • FFIFFI 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.
 
DEVELOPERS
    FYP, hnnssy, EvgeN 1137
 
SPECIAL THANKS
    DK22Pac, MISTER_GONWIK, 4el0ve4ik, EXPORT, Garrus
 
DOWNLOAD
Download Installer
    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

SCRIPT INSTALLATION
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.

LINKS
Development Thread
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

  • Wesser, -Anti-, Blackbird88 and 32 others like this

exp0rt
  • exp0rt

    Player Hater

  • Members
  • Joined: 08 Oct 2014
  • Russia

#2

Posted 02 July 2017 - 06:15 PM

great job, guy


BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#3

Posted 02 July 2017 - 07:31 PM

Here is the development thread: http://gtaforums.com...er-development/

  • Ruvix likes this

Stierlitz
  • Stierlitz

    gta grozny

  • Members
  • Joined: 05 Oct 2013
  • Russia
  • Best Conversion 2016 [GTA: Underground]

#4

Posted 02 July 2017 - 07:32 PM

Finally, this is explained in English. Good work.


Blue
  • Blue

    The sun is the same in a relative way but you're older

  • Facade Corporation
  • Joined: 09 Apr 2014
  • Portugal
  • Best Total Overhaul 2016 [Shine o' Vice] [Contribution]
    Best Workshop 2016 [Runner-up]

#5

Posted 02 July 2017 - 08:08 PM

Fantastic!

Inadequate
  • Inadequate

    Midnight Emulator

  • Members
  • Joined: 11 Apr 2012
  • None

#6

Posted 02 July 2017 - 08:15 PM Edited by Inadequate, 02 July 2017 - 08:16 PM.

If this is a CLEO replacement (as the description states it)... How can someone to port his CLEO script to MOON without to re-write all from scratch again? And even worse if the original script is very, very long. Or are they compatible between platforms?


BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#7

Posted 02 July 2017 - 08:30 PM Edited by BH Team, 02 July 2017 - 09:08 PM.

If this is a CLEO replacement (as the description states it)... How can someone to port his CLEO script to MOON without to re-write all from scratch again? And even worse if the original script is very, very long. Or are they compatible between platforms?

Nope, they aren't. MoonLoader is intended to be CLEO replacement for new mods. Theoretically, scripts can be converted almost complete automatically, but making converter isn't worth it, it's better to rewrite script manually because then the script may be performed much better with all of those MoonLoader features. It's more a replacement for developers, than for users.


goodidea82
  • goodidea82

    SA Modder

  • Members
  • Joined: 13 Jun 2013
  • Germany

#8

Posted 02 July 2017 - 08:33 PM

Amazing project!

Problem: documentation is not in english http://blast.hk/wiki...s#googtrans(en)

 

Some questions:

- Is the number of local variables unlimited?

- Are the commands executed by the SCM interpreter, or is the execution completely separated from the SCM interpreter?

- Are the datastructures from plugin-sdk included? (or do you plan to do it?)

- Is compatibility with FLA confirmed?

  • BH Team likes this

BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#9

Posted 02 July 2017 - 08:44 PM Edited by BH Team, 02 July 2017 - 09:06 PM.

Amazing project!

Problem: documentation is not in english http://blast.hk/wiki...s#googtrans(en)

 

Some questions:

- Is the number of local variables unlimited?

- Are the commands executed by the SCM interpreter, or is the execution completely separated from the SCM interpreter?

- Are the datastructures from plugin-sdk included? (or do you plan to do it?)

- Is compatibility with FLA confirmed?

1. Yes. Limited only by the RAM, as far as i know.

2. Functions that are opcodes (those who has 'opcode' value in the function list) - yes, but it's not completely executed by the SCM interpreter, it's more like direct opcode handler function calling with some emulation.

3. They aren't. Currently there is no plans in implementing it. It can be easily done via FFI, see the RapidFire.lua from examples.

4. What is "FLA"?


Mubber
  • Mubber

    Modderman

  • Members
  • Joined: 12 Mar 2016
  • Latvia

#10

Posted 02 July 2017 - 08:46 PM Edited by Mubber, 02 July 2017 - 09:16 PM.

- Is compatibility with FLA confirmed?

Ive been running a bunch of Moonloader scripts and many other mods including FLA and havent had any issues.

Compatability seems good with everything

  • BH Team likes this

goodidea82
  • goodidea82

    SA Modder

  • Members
  • Joined: 13 Jun 2013
  • Germany

#11

Posted 02 July 2017 - 09:40 PM Edited by goodidea82, 02 July 2017 - 09:42 PM.

 

Amazing project!

Problem: documentation is not in english http://blast.hk/wiki...s#googtrans(en)

 

Some questions:

- Is the number of local variables unlimited?

- Are the commands executed by the SCM interpreter, or is the execution completely separated from the SCM interpreter?

- Are the datastructures from plugin-sdk included? (or do you plan to do it?)

- Is compatibility with FLA confirmed?

1. Yes. Limited only by the RAM, as far as i know.

2. Functions that are opcodes (those who has 'opcode' value in the function list) - yes, but it's not completely executed by the SCM interpreter, it's more like direct opcode handler function calling with some emulation.

3. They aren't. Currently there is no plans in implementing it. It can be easily done via FFI, see the RapidFire.lua from examples.

4. What is "FLA"?

 

FLA = fastman92limitAdjuster

 

I have looked up the FFI example in RapidFire.lua. Here for the others:

Spoiler

This looks really good I must admit and should be included in the standard in my opinion.

 

>..but it's not completely executed by the SCM interpreter, it's more like direct opcode handler function calling with some emulation

So how is the speed compared to native SCM execution?

  • Crspy likes this

Davve95
  • Davve95

    CJ - You wanna get back down so?

  • Members
  • Joined: 10 Jan 2012
  • Sweden

#12

Posted 02 July 2017 - 09:50 PM Edited by Davve95, 02 July 2017 - 09:50 PM.

Sounds awesome!

Great job! And your English was not bad either.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#13

Posted 02 July 2017 - 10:16 PM Edited by fastman92, 02 July 2017 - 10:19 PM.

Nice project.

I had the same idea, but stopped development of such a project.

You must check if your project is compatible with new ID limits. They are the main problem in other ASI plugins.

Crspy
  • Crspy

    Kick

  • Members
  • Joined: 14 May 2015
  • None

#14

Posted 02 July 2017 - 10:38 PM

Finally you decided to post it here. Great job , your English is good. I've been following your work since v.021 beta.  I am definitely gonna learn this as it seems to have a great future. :)


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#15

Posted 03 July 2017 - 12:29 AM

This looks like a good CLEO replacement and has a bright future, but is it good for Mission Scripting?


BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#16

Posted 03 July 2017 - 08:48 AM Edited by BH Team, 03 July 2017 - 08:53 AM.

FLA = fastman92limitAdjuster

Oh... Can't say, I didn't test it. It should be good, MoonLoader has little amount of hooks and patches to provide better compatibility with other mods.
 

So how is the speed compared to native SCM execution?

Opcode-functions has overhead, it's inevitable, but it's like ~25-45% to the original, so it's ok, doesn't give a huge overload. I should do the benchmarks with comparisons.
 

I had the same idea, but stopped development of such a project.

Yea, heard about that somewhere, but after I started working on MoonLoader.
 

You must check if your project is compatible with new ID limits. They are the main problem in other ASI plugins.

Can you give me a tip how should I do this?
 

This looks like a good CLEO replacement and has a bright future, but is it good for Mission Scripting?

Pretty much. There is all the original game scripting features and game saving/loading system, so yes, why not...
 

And your English was not bad either.

So I can remove this ugly disclaimer?
  • deltaCJ and Crspy like this

Davve95
  • Davve95

    CJ - You wanna get back down so?

  • Members
  • Joined: 10 Jan 2012
  • Sweden

#17

Posted 03 July 2017 - 09:40 AM Edited by Davve95, 03 July 2017 - 09:41 AM.

Yeah, in my opinion it does not seem to be needed. But I'm not a expert either xD.

Zolika1351
  • Zolika1351

    Ladies, hide your titties!

  • Members
  • Joined: 16 Jun 2014
  • Hungary

#18

Posted 03 July 2017 - 10:07 AM

Thank you for this, I always found CLEO scripting harder than lua so this will help me a lot.

  • Crspy likes this

Davve95
  • Davve95

    CJ - You wanna get back down so?

  • Members
  • Joined: 10 Jan 2012
  • Sweden

#19

Posted 03 July 2017 - 01:20 PM

Yeah, me too. I hope this is way easier then CLEO scripting. If so I'd would get started someday.

SilverRST
  • SilverRST

    Big Homie

  • Members
  • Joined: 25 Mar 2013
  • None

#20

Posted 03 July 2017 - 01:46 PM

So this can give the possibility to developers creating graphics scripts which are mostly only available for MTA or SAMP?


Crspy
  • Crspy

    Kick

  • Members
  • Joined: 14 May 2015
  • None

#21

Posted 03 July 2017 - 01:55 PM Edited by Crspy, 03 July 2017 - 01:56 PM.

For people who don't know , here's some cool stuff made with lua scripting for MoonLoader :

 

  • Blackbird88 and Davve95 like this

deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#22

Posted 03 July 2017 - 03:05 PM

These russians man. they're like super humans lol

  • Apu889, Crspy and The_Human like this

deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#23

Posted 03 July 2017 - 04:08 PM Edited by deltaCJ, 03 July 2017 - 04:13 PM.

Hm, sad but none of the scripts are working for me? I put it in the moonloader folder but it doesn't work ingame...

 

 

 

EDIT: f*ck double post sorry....

 

 

EDIT2: Also when I started new game it game me runtime error... I had to uninstall


Crspy
  • Crspy

    Kick

  • Members
  • Joined: 14 May 2015
  • None

#24

Posted 03 July 2017 - 04:11 PM

Hm, sad but none of the scripts are working for me? I put it in the moonloader folder but it doesn't work ingame...

 

 

 

EDIT: f*ck double post sorry....

You sure ?  they work fine for me.


deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#25

Posted 03 July 2017 - 04:14 PM Edited by deltaCJ, 03 July 2017 - 04:17 PM.

You sure ?  they work fine for me.

 

 

 

 

 

Yeah, its weird.

 

I tried the rapid fire and the sprint aim one but none work


BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#26

Posted 04 July 2017 - 06:20 AM

Hm, sad but none of the scripts are working for me? I put it in the moonloader folder but it doesn't work ingame...
 
 
 
EDIT: f*ck double post sorry....
 
 
EDIT2: Also when I started new game it game me runtime error... I had to uninstall

Make sure your GTA: SA version is 1.0US and that you have installed MoonLoader properly. I doubt that the problem can be in the ASI loader, but anyway try Silent's ASI Loader.
If all this is true then the problem is in conflicting mods.

deltaCJ
  • deltaCJ

    BUSTED!

  • Members
  • Joined: 27 Dec 2013
  • None

#27

Posted 04 July 2017 - 06:37 AM

 

Hm, sad but none of the scripts are working for me? I put it in the moonloader folder but it doesn't work ingame...
 
 
 
EDIT: f*ck double post sorry....
 
 
EDIT2: Also when I started new game it game me runtime error... I had to uninstall

Make sure your GTA: SA version is 1.0US and that you have installed MoonLoader properly. I doubt that the problem can be in the ASI loader, but anyway try Silent's ASI Loader.
If all this is true then the problem is in conflicting mods.

 

 

Of course I have GTA SA US 1.0 and I used the installer, I even checked ASI loader and Notepad ++ extension.


MrBellic
  • MrBellic

    [IR]Mr.Bellic

  • Members
  • Joined: 06 Mar 2017
  • None

#28

Posted 04 July 2017 - 06:48 AM

It's great to see it here on GTAForums.It will be awesome if you can add some features like enabling and disabling lua scripts from the game menu (just like the modloader).Good luck with your upcoming projects :)

  • Davve95 likes this

imlove13
  • imlove13

    Player Hater

  • Members
  • Joined: 06 Nov 2015
  • Indonesia

#29

Posted 04 July 2017 - 06:59 AM

Is it possible to Create Shader with LUA script ? @_@ Just Like MTA ...
I heard MTA using LUA script Too.. xD

Goodluck with your Project Btw <3 and Love to see Development .. :))

  • Davve95 likes this

BH Team
  • BH Team

    FYP

  • Members
  • Joined: 08 Aug 2011
  • Russia

#30

Posted 05 July 2017 - 06:35 AM Edited by BH Team, 05 July 2017 - 06:35 AM.

Of course I have GTA SA US 1.0 and I used the installer, I even checked ASI loader and Notepad ++ extension.

Then most likely the problem in the mods conflict. Can you attach your moonloader.log?

It's great to see it here on GTAForums.It will be awesome if you can add some features like enabling and disabling lua scripts from the game menu (just like the modloader).Good luck with your upcoming projects :)

It would be nice, it's even can be done via lua script.

Is it possible to Create Shader with LUA script ? @_@ Just Like MTA ...
I heard MTA using LUA script Too.. xD

Goodluck with your Project Btw <3 and Love to see Development .. :))

Yes, MTA is using Lua, but it has its own API for rendering. Currently MoonLoader has no its own API for rendering, there is just original game possibilities to display some primitives on the screen. Adding rendering API is one of the priority tasks, but unfortunately, I can not even say approximately when it will be done.
  • Thompson98 and Crspy like this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users