Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    2. News

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

BH Team

MoonLoader

Recommended Posts

guru_guru

Gotta say this is a cool mod, however I partially ran into the same issue as Junior.

 

So most of the scripts I installed are inside the scripts folder while a few others such as ModLoader, SkyUI, Mobile Style Loading etc. are in the root directory. Once I installed MoonLoader, SkyUI couldn't find GInput anymore, even though it was installed. I moved GInput in the root directory and game worked fine at the menu, however once I started a new game, it was loading like the vanilla game, even though I have the Mobile Style Loading mod installed.

 

This made me realize that the scripts folder is apparently ignored when using this mod. I tried moving the mod's asi and the folder inside the scripts folder, along GInput, and this partially fixed my issue, however only a few mods were actually loaded, which I belive they are the ones that are loaded prior to this mod (SkyUI loaded, meaning that GInput loaded, which is loaded before this mod, however SkyGFX and SilentPatch weren't, which are loaded after this mod). Moonloader's scripts however worked fine (tested the BetterSkybox mod which uses Moonloader now)

 

Is it possible to make this mod less location dependent?

It's actually moonloader that is causing that,not letting asis from /script to be loaded.

Moving every asi to root folder fixes the loading for me.(Idk about asis in /modloader though, I usually don't put them there)

Share this post


Link to post
Share on other sites
Jinx.

Modloader is in the root directory, and prior to installing this mod everything worked nicely. The scripts folder is not inside modloader folder, though.

Share this post


Link to post
Share on other sites
guru_guru

osh*t I thought this was modloader's thread lmao.

But possible solution remains the same,move all asis to root folder.

Still is really weird that moonloader messes up the loading of asis, I wish they could fix that.

Share this post


Link to post
Share on other sites
BH Team

Yes, there was a problem in MoonLoader and it already fixed in v.024. Fix is published but not yet released officially, there was a few things needed to be tested before.

For now you can download v.024 from here or wait until v.025 will be released in the coming days.

Share this post


Link to post
Share on other sites
BH Team

Okay, update is out. Two updates, actually. Here is the changelog:

.024-beta
New
  • Added game version checking for compliance with the supported
  • New functions for retrieving handles of all objects, characters and vehicles: getAllObjects, getAllChars, getAllVehicles
  • Functions for showing mouse cursor and locking player controls: showCursor, lockPlayerControl, isPlayerControlLocked
  • Functions for working with the map icons: setBlipCoordinates, setTargetBlipCoordinates, placeWaypoint, removeWaypoint
  • New property script.this - analogue of function 'thisScript'
  • Function memory.hex2bin for converting a Hex-sequence into binary data
Changes
  • Updated internal dependencies. Many of fixes and some new features like stack traceback on error
  • Function setVirtualKeyDown now can emulate mouse buttons press
  • From now on opcode-functions registers right after loading scripts file (i.e before execution), so function isOpcodesAvailable is not needed anymore
  • Scripts won't unload automatically if they include any event handler
Fixes
  • Some of internal hooks have been redesigned for thread-safety for compatibility with external impacts - fixes random crashes for some users
  • Solved problem with loading asi-plugins from 'scripts' folder
  • Fixed incorrect work of function findAllRandomObjectsInSphere
  • Fixed crash when calling function 'print' without parameters
  • Fixed file search handle releasing - if function findClose was used, a handle was released again by the garbage collector
  • Fixed bug because of which events registered with addEventHandler function were not counted
  • Functions printStyledString, printString and printStringNow won't rewrite each other's text
  • (SAMPFUNCS) Fixed loading fonts and textures functions - unsuccessful loading could lead to UB
  • (SAMP) Fixed bug in RakNet events that could lead to crash if an error occured inside the event handler
.025-beta
New
  • Implemented DirectX hook and added events onD3DDeviceLost, onD3DDeviceReset, onD3DPresent
  • Function memory.strptr for getting raw pointer of Lua-string
  • Function getFolderPath for getting paths of user's and system's directories
  • Function getTimeStepValue replacing opcodes 0078, 0079, 007A, 007B, 007C, 007D, 007E, 007F, 0080, 0081, 0082 and 0083
  • Function getD3DDevicePtr, returning address of game's IDirect3DDevice9
  • Distro now includes libraries 'lua-iconv' and 'encoding' that can help developers with different text encodings. Also library 'windows' was included, currently it contains only window message ids.
Changes
  • All steps of Lua-script initialization now carried out only after loading and checking script. Thereby script loading is faster when it goes to failure.
Fixes
  • Fixed incorrect return types of getCharAnimCurrentTime and getCharAnimTotalTime
  • Fixed thread property 'work_in_pause' reset when restarting active thread

Changelog in Russian on our wiki: https://blast.hk/wiki/moonloader:changelog

Edited by BH Team

Share this post


Link to post
Share on other sites
BH Team

Wanna show something to devs, I don't like posting lots of code in this thread, but the development thread is somewhat hidden from eyes, so I posting it here.
Here is the primitive example with new events introduced in .025. It shows how to draw anything over the game's picture using DirectX APIs directly from lua.
Note that via CLEO, MoonLoader and SAMPFUNCS it was not possible to draw post-effects and symbols from symbolic fonts, and in general everything was limited to primitive elements.
Now you can do it with MoonLoader:
zaO1L2Pm.jpg

Don't be scared of many lines of weird code, the big part is occupied by FFI declarations.

Code:

 

local key = require 'vkeys'local ffi = require 'ffi'ffi.cdef [[typedef struct stRECT{    int left, top, right, bottom;} RECT; typedef struct stID3DXFont{    struct ID3DXFont_vtbl* vtbl;} ID3DXFont; struct ID3DXFont_vtbl{    void* QueryInterface; // STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;    void* AddRef; // STDMETHOD_(ULONG, AddRef)(THIS) PURE;    uint32_t (__stdcall * Release)(ID3DXFont* font); // STDMETHOD_(ULONG, Release)(THIS) PURE;     // ID3DXFont    void* GetDevice; // STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE;    void* GetDescA; // STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE;    void* GetDescW; // STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE;    void* GetTextMetricsA; // STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;    void* GetTextMetricsW; // STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;     void* GetDC; // STDMETHOD_(HDC, GetDC)(THIS) PURE;    void* GetGlyphData; // STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;     void* PreloadCharacters; // STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;    void* PreloadGlyphs; // STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;    void* PreloadTextA; // STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;    void* PreloadTextW; // STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;     int (__stdcall * DrawTextA)(ID3DXFont* font, void* pSprite, const char* pString, int Count, RECT* pRect, uint32_t Format, uint32_t Color); // STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;    void* DrawTextW; // STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;     void (__stdcall * OnLostDevice)(ID3DXFont* font); // STDMETHOD(OnLostDevice)(THIS) PURE;    void (__stdcall * OnResetDevice)(ID3DXFont* font); // STDMETHOD(OnResetDevice)(THIS) PURE;}; uint32_t D3DXCreateFontA(void* pDevice, int Height, uint32_t Width, uint32_t Weight, uint32_t MipLevels, bool Italic, uint32_t CharSet, uint32_t OutputPrecision, uint32_t Quality, uint32_t PitchAndFamily, const char* pFaceName, ID3DXFont** ppFont);]] local d3dx9_43 = ffi.load('d3dx9_43.dll') function d3dxfont_create(name, height, charset)    charset = charset or 1    local d3ddev = ffi.cast('void*', getD3DDevicePtr())    local pfont = ffi.new('ID3DXFont*[1]', {nil})    if tonumber(d3dx9_43.D3DXCreateFontA(d3ddev, height, 0, 600, 1, false, charset, 0, 4, 0, name, pfont)) < 0 then        return nil    end    return pfont[0]end function d3dxfont_draw(font, text, rect, color, format)    local prect = ffi.new('RECT[1]', {{rect[1], rect[2], rect[3], rect[4]}})    return font.vtbl.DrawTextA(font, nil, text, -1, prect, format, color)end function onD3DDeviceLost()    if fonts_loaded then        font_arial.vtbl.OnLostDevice(font_arial)        font_wingdings.vtbl.OnLostDevice(font_wingdings)    endend function onD3DDeviceReset()    if fonts_loaded then        font_arial.vtbl.OnResetDevice(font_arial)        font_wingdings.vtbl.OnResetDevice(font_wingdings)    endend function onD3DPresent() -- in this event all the drawing operations are performed using DirectX    if draw then        callFunction(0x007037C0, 2, 2, 0x40, 1) -- draw grain post-effect, it is used by game for night and thermal vision        callFunction(0x007030A0, 1, 1, representFloatAsInt(20.0)) -- draw blur post-effect        if fonts_loaded then            d3dxfont_draw(font_arial, 'Arial test string', {10, 10, 600, 200}, 0xFF88DD44, 0) -- just a regular text            local sw, sh = getScreenResolution()            local str = ''            for i = 33, 255 do str = str .. string.char(i) end            d3dxfont_draw(font_wingdings, str, {10, 60, sw, sh}, 0xFFDDAA00, 0x10) -- display all characters of the font Wingdings        end    endend function onExitScript()    if fonts_loaded then        font_arial.vtbl.Release(font_arial)        font_wingdings.vtbl.Release(font_wingdings)    endend function main()    draw = true    font_arial = d3dxfont_create('Arial', 64)    font_wingdings = d3dxfont_create('Wingdings', 72, 2)    fonts_loaded = trueend

 

 

The example itself is not impressive, I know, but this feature gives opportunities to make impressive things. This can be used for even more, for example, you can create dll-module with lua bindings for existing GUI solution.

Edited by BH Team

Share this post


Link to post
Share on other sites
guru_guru

Perhaps you should move the development thread to the Tools section.Coding section is used more like "Help me with this code"

Share this post


Link to post
Share on other sites
JustSomeAussie

I downloaded the moonloader setup and ran it through virustotal.com and it got 4 detections, so i'm kinda worried about running it. I'm aware they could be false-positives, but they could also be real threats.

Share this post


Link to post
Share on other sites
SHIFAAH9

Great Just great would this day get any better...?

 

 


 

i was just wondering can the moonloader's files (.lua) work fine if created using Microsoft visual studio Code...?

They had no problem when they were edited by MSVSC....(don't know if it will be different when creating one)

Just asking Because NotePad ++ and atom are the only one's recommended....

Share this post


Link to post
Share on other sites
Davve95

Sorry for a minor bump, but I need help.

(And unnecessary to open a new topic for it)

 

Anyway: I tried to load the weapon spawn script, but nothing happned in-game.

 

 

 

 

  [22:30:44.667563] (system)    Session started.[22:30:44.667563] (debug)    Module handle: 0F900000MoonLoader v.025-beta loaded.Developers: FYP, hnnssy, EvgeN 1137Copyright © 2016, BlastHack Teamhttp://blast.hk/moonloader/[22:30:44.667563] (info)    Working directory: B:\Spel\GTA SA (för sa-mp map editor)\moonloader[22:30:44.667563] (debug)    FP Control: 0009001F[22:30:44.667563] (debug)    Game: GTA SA 1.0.0.0 US[22:30:44.667563] (system)    Installing pre-game hooks...[22:30:44.668563] (system)    Hooks installed.[22:30:45.090587] (debug)    Initializing opcode handler table[22:30:45.090587] (debug)    package.path = B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?\init.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?\init.lua;.\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?\init.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?\init.luac;.\?.luac[22:30:45.090587] (debug)    package.cpath = B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.dll;[22:30:45.090587] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\AutoReboot.lua'...[22:30:45.090587] (debug)    New script: 08A5C754[22:30:45.092587] (system)    ML-AutoReboot: Loaded successfully.[22:30:45.092587] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\check-moonloader-updates.lua'...[22:30:45.092587] (debug)    New script: 08A5DA9C[22:30:45.093588] (system)    Check MoonLoader Updates: Loaded successfully.[22:30:45.093588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\reload_all.lua'...[22:30:45.094588] (debug)    New script: 08A5DC44[22:30:45.094588] (system)    ML-ReloadAll: Loaded successfully.[22:30:45.094588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\SF Integration.lua'...[22:30:45.094588] (debug)    New script: 08A5EDEC[22:30:45.096588] (system)    SF Integration: Loaded successfully.[22:30:45.096588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\weapon menu.lua'...[22:30:45.096588] (debug)    New script: 08A62F94[22:30:45.098588] (system)    Weapon Menu: Loaded successfully.[22:30:55.615189] (system)    Installing post-load hooks...[22:30:55.615189] (system)    Hooks installed.[22:32:35.027875] (system)    Unloading...[22:32:35.027875] (system)    ML-AutoReboot: Script terminated. (08A5C754)[22:32:35.027875] (system)    Check MoonLoader Updates: Script terminated. (08A5DA9C)[22:32:35.028875] (system)    ML-ReloadAll: Script terminated. (08A5DC44)[22:32:35.028875] (system)    SF Integration: Script terminated. (08A5EDEC)[22:32:35.028875] (system)    Weapon Menu: Script terminated. (08A62F94)[22:32:35.162883] (system)    Session terminated. 

 

 

Share this post


Link to post
Share on other sites
skatefilter5

what about 2nd player actor, all i see is just player_ped known as player actor, I want 2nd player's voice audio in different actors, and also how you get CJ to change voice for lua script when switching actors like samp - i want it in single player. not ped.ide (locked one audio forever)

Edited by skatefilter5

Share this post


Link to post
Share on other sites
gtav_clover

This is what happens when starting a New Game when one is already running if Moonloader is installed:

 

 

2644ysx.png

Info:

OS: Win XP Pro SP3

All VC Redistributable Packages installed

NO Mods (Not even CLEO)

All DotNet Framework Packages installed

 

Log:

[16:08:59.156250] (system) Session started.
[16:08:59.156250] (debug) Module handle: 02460000

MoonLoader v.025-beta loaded.
Developers: FYP, hnnssy, EvgeN 1137

Copyright © 2016, BlastHack Team
http://blast.hk/moonloader/

[16:08:59.156250] (info) Working directory: D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader
[16:08:59.156250] (debug) FP Control: 0009001F
[16:08:59.156250] (debug) Game: GTA SA 1.0.0.0 US
[16:08:59.156250] (system) Installing pre-game hooks...
[16:08:59.171875] (system) Hooks installed.
[16:09:00.109375] (debug) Initializing opcode handler table
[16:09:00.109375] (debug) package.path = D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?\init.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?\init.lua;.\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?\init.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?\init.luac;.\?.luac
[16:09:00.109375] (debug) package.cpath = D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.dll;
[16:09:00.109375] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\AutoReboot.lua'...
[16:09:00.109375] (debug) New script: 042F1FC4
[16:09:00.109375] (system) ML-AutoReboot: Loaded successfully.
[16:09:00.109375] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\quickmap.lua'...
[16:09:00.109375] (debug) New script: 042F4874
[16:09:00.125000] (system) QuickMap: Loaded successfully.
[16:09:00.125000] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\RapidFire.lua'...
[16:09:00.125000] (debug) New script: 042F5A94
[16:09:00.125000] (system) RapidFire: Loaded successfully.
[16:09:09.234375] (system) Installing post-load hooks...
[16:09:09.234375] (system) Hooks installed.
[16:09:34.921875] (error) opcode '044B' call caused an unhandled exception
[16:09:44.437500] (system) Unloading...
[16:09:44.437500] (system) ML-AutoReboot: Script terminated. (042F1FC4)
[16:09:44.437500] (system) QuickMap: Script terminated. (042F4874)
[16:09:44.437500] (system) RapidFire: Script terminated. (042F5A94)
[16:09:44.453125] (system) Session terminated.

 

Does not happen if no scripts are installed. Game crashes even if an exampe script is installed.

Edited by gtav_clover

Share this post


Link to post
Share on other sites
Davve95

Can someone help me with my problem aswell?

Share this post


Link to post
Share on other sites
SHIFAAH9

@gtav_clover

 

Try To use "NoDEP.asi" to fix or do it manually in control panel

Share this post


Link to post
Share on other sites
gtav_clover

@gtav_clover

 

Try To use "NoDEP.asi" to fix or do it manually in control panel

Thanks for the suggestion. I tried both, together and separately. Didn't work.

The same error as above.

Loading a saved game works fine. Error only occurs when starting a new game.

I think is the problem:

 

From log:

[16:09:34.921875] (error) opcode '044B' call caused an unhandled exception

But I didn't even install CLEO!

 

Edited by gtav_clover

Share this post


Link to post
Share on other sites
BH Team

Sorry for no answers for long, completely forgot about this topic...

 

Sorry for a minor bump, but I need help.

(And unnecessary to open a new topic for it)

 

Anyway: I tried to load the weapon spawn script, but nothing happned in-game.

 

 

 

 

  [22:30:44.667563] (system)    Session started.[22:30:44.667563] (debug)    Module handle: 0F900000MoonLoader v.025-beta loaded.Developers: FYP, hnnssy, EvgeN 1137Copyright © 2016, BlastHack Teamhttp://blast.hk/moonloader/[22:30:44.667563] (info)    Working directory: B:\Spel\GTA SA (för sa-mp map editor)\moonloader[22:30:44.667563] (debug)    FP Control: 0009001F[22:30:44.667563] (debug)    Game: GTA SA 1.0.0.0 US[22:30:44.667563] (system)    Installing pre-game hooks...[22:30:44.668563] (system)    Hooks installed.[22:30:45.090587] (debug)    Initializing opcode handler table[22:30:45.090587] (debug)    package.path = B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?\init.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?\init.lua;.\?.lua;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?\init.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?.luac;B:\Spel\GTA SA (för sa-mp map editor)\moonloader\?\init.luac;.\?.luac[22:30:45.090587] (debug)    package.cpath = B:\Spel\GTA SA (för sa-mp map editor)\moonloader\lib\?.dll;[22:30:45.090587] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\AutoReboot.lua'...[22:30:45.090587] (debug)    New script: 08A5C754[22:30:45.092587] (system)    ML-AutoReboot: Loaded successfully.[22:30:45.092587] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\check-moonloader-updates.lua'...[22:30:45.092587] (debug)    New script: 08A5DA9C[22:30:45.093588] (system)    Check MoonLoader Updates: Loaded successfully.[22:30:45.093588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\reload_all.lua'...[22:30:45.094588] (debug)    New script: 08A5DC44[22:30:45.094588] (system)    ML-ReloadAll: Loaded successfully.[22:30:45.094588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\SF Integration.lua'...[22:30:45.094588] (debug)    New script: 08A5EDEC[22:30:45.096588] (system)    SF Integration: Loaded successfully.[22:30:45.096588] (system)    Loading script 'B:\Spel\GTA SA (för sa-mp map editor)\moonloader\weapon menu.lua'...[22:30:45.096588] (debug)    New script: 08A62F94[22:30:45.098588] (system)    Weapon Menu: Loaded successfully.[22:30:55.615189] (system)    Installing post-load hooks...[22:30:55.615189] (system)    Hooks installed.[22:32:35.027875] (system)    Unloading...[22:32:35.027875] (system)    ML-AutoReboot: Script terminated. (08A5C754)[22:32:35.027875] (system)    Check MoonLoader Updates: Script terminated. (08A5DA9C)[22:32:35.028875] (system)    ML-ReloadAll: Script terminated. (08A5DC44)[22:32:35.028875] (system)    SF Integration: Script terminated. (08A5EDEC)[22:32:35.028875] (system)    Weapon Menu: Script terminated. (08A62F94)[22:32:35.162883] (system)    Session terminated. 

 

 

Judging by the log, you have no problems with "weapon menu.lua", looks like it just doesn't activate. Try to change keys to something like this:

keysToggle = {VK_SHIFT, VK_H}

 

i was just wondering can the moonloader's files (.lua) work fine if created using Microsoft visual studio Code...?

They had no problem when they were edited by MSVSC....(don't know if it will be different when creating one)

Just asking Because NotePad ++ and atom are the only one's recommended....

Sure. You can use any text editor.

 

what about 2nd player actor, all i see is just player_ped known as player actor, I want 2nd player's voice audio in different actors, and also how you get CJ to change voice for lua script when switching actors like samp - i want it in single player. not ped.ide (locked one audio forever)

I belive you can do something like this to get second player handles:

 

local gglob = require 'game.globals'function main()  while not isPlayerPlaying(PLAYER_PED) do wait(0) end  PLAYER2_HANDLE = getGameGlobal(gglob.SECOND_PLAYER)  PLAYER2_PED = getGameGlobal(gglob.SECOND_PLAYER_ACTOR) -- probably, you need to create second player's actor yourself  -- and use PLAYER2_HANDLE, PLAYER2_PED in all appropriate functionsend
On the second question, i think samp patches some parts of game to get it working, so perhaps you will have to implement these patches for SP.

 

This is what happens when starting a New Game when one is already running if Moonloader is installed:

 

 

2644ysx.png

Info:

OS: Win XP Pro SP3

All VC Redistributable Packages installed

NO Mods (Not even CLEO)

All DotNet Framework Packages installed

 

Log:

[16:08:59.156250] (system) Session started.

[16:08:59.156250] (debug) Module handle: 02460000

 

MoonLoader v.025-beta loaded.

Developers: FYP, hnnssy, EvgeN 1137

 

Copyright © 2016, BlastHack Team

http://blast.hk/moonloader/

 

[16:08:59.156250] (info) Working directory: D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader

[16:08:59.156250] (debug) FP Control: 0009001F

[16:08:59.156250] (debug) Game: GTA SA 1.0.0.0 US

[16:08:59.156250] (system) Installing pre-game hooks...

[16:08:59.171875] (system) Hooks installed.

[16:09:00.109375] (debug) Initializing opcode handler table

[16:09:00.109375] (debug) package.path = D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?\init.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?\init.lua;.\?.lua;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?\init.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?.luac;D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\?\init.luac;.\?.luac

[16:09:00.109375] (debug) package.cpath = D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\lib\?.dll;

[16:09:00.109375] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\AutoReboot.lua'...

[16:09:00.109375] (debug) New script: 042F1FC4

[16:09:00.109375] (system) ML-AutoReboot: Loaded successfully.

[16:09:00.109375] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\quickmap.lua'...

[16:09:00.109375] (debug) New script: 042F4874

[16:09:00.125000] (system) QuickMap: Loaded successfully.

[16:09:00.125000] (system) Loading script 'D:\Games\GTA SA\Grand Theft Auto San Andreas Game\moonloader\RapidFire.lua'...

[16:09:00.125000] (debug) New script: 042F5A94

[16:09:00.125000] (system) RapidFire: Loaded successfully.

[16:09:09.234375] (system) Installing post-load hooks...

[16:09:09.234375] (system) Hooks installed.

[16:09:34.921875] (error) opcode '044B' call caused an unhandled exception

[16:09:44.437500] (system) Unloading...

[16:09:44.437500] (system) ML-AutoReboot: Script terminated. (042F1FC4)

[16:09:44.437500] (system) QuickMap: Script terminated. (042F4874)

[16:09:44.437500] (system) RapidFire: Script terminated. (042F5A94)

[16:09:44.453125] (system) Session terminated.

 

 

Does not happen if no scripts are installed. Game crashes even if an exampe script is installed.

Yep, there is a bug in MoonLoader, it will be fixed in the upcoming update.

Share this post


Link to post
Share on other sites
DanielleLittle25

Great upgrades. I would like to use it! I'm just ordering my assignments and start.

Share this post


Link to post
Share on other sites
amirab
Posted (edited)

I think something's wrong with raknet , I tried readin RPC_CreateObject , which is RPC 44 , everything works fine till syncRotation (yeah dude , FYP used data.unk2 , I think he may not know what it is) , after that , it's TexturesCount , and it return 103 ! no matter how many Material you use (I'm not talking about 0 materials , matrial > 0)

 

Hope you fix that as soon as possible because I tested it in C++ for .asi , works fine , it's MoonLoader or SAMPFUNCS's

 

 

Thanks btw.

Edited by amirab

Share this post


Link to post
Share on other sites
BH Team
Posted (edited)
Update v.026.2
The main changes in this version are the significant improvement in error handling and the complete cessation of dependence in CLEO. In addition, all the opcodes for drawing 2D-elements on the screen from SAMPFUNCS have been replaced with built-in functions, and therefore only functions for working with SA-MP and DXUT are remained from the functions of SAMPFUNCS.
Improvement of error handling became possible due to upgrade to LuaJIT 2.1.0-beta3, from now on MoonLoader guarantees the reliability of processing all errors in scripts (except for errors in direct interaction with the process memory) and will display more detailed diagnostic information. In LuaJIT 2.1 there are several other useful changes.
A painless transition from dependency in CLEO was made possible by implementing a sound system from CLEO to MoonLoader, so backward compatibility in scripts that use functions for audio playback is not violated. The borrowing of the sound system from CLEO was carried out with the permission of the author of the library, so many thanks to the CLEO developers.
In the rest, was added a few small features and bug fixes.
With all this said, these two big changes fixes two main issues in MoonLoader that were noted in this topic. There are more things to do, but we're getting closer!
Compiled Lua-scripts (.luac) for earlier versions of MoonLoader will not work on this and the following, and vice versa, so a convincing request to the developers: recompile your scripts to the new version or publish the source code, if possible. It is necessary to speed up a process of transition to the new version and that users do not have to choose between new and old versions.
All changes:

 

New

Changes

  • Scripts will continue executing as long as they have active threads, even if execution of main is completed and there is no registered events in the script
  • Call to script_moonloader will cause script to die with an error if MoonLoader version is not consistent
  • Function isOpcodesAvailable is obsolete now and always returns true
  • New optional argument charset was added to the renderCreateFont, it allows to specify a desired encoding
  • To functions renderGetFontDrawTextLength and renderFontDrawText was added optional argument ignoreColorTags, allowing to disable parsing of colortags
  • Function getGameVersion return more detailed information about game version

Fixes

 

Edited by BH Team

Share this post


Link to post
Share on other sites
UMGEEK

It would be nice if it had extension also for Visual Studio Code.

Share this post


Link to post
Share on other sites
guru_guru

It would be nice if it had extension also for Visual Studio Code.

 

I second that

Share this post


Link to post
Share on other sites
SHIFAAH9
Posted (edited)

 

It would be nice if it had extension also for Visual Studio Code.

 

I second that

 

I Third that..

 

VSC is Just awesome...(at least for Me it is.)

Edited by SHIFAAH9

Share this post


Link to post
Share on other sites
BH Team

It would be nice if it had extension also for Visual Studio Code.

It would be, it was in plans, but unfortunately I can't work on this for now. You can try the package vscode-lua and this for the time being.

Share this post


Link to post
Share on other sites
UMGEEK
Posted (edited)

 

It would be nice if it had extension also for Visual Studio Code.

It would be, it was in plans, but unfortunately I can't work on this for now. You can try the package vscode-lua and this for the time being.

 

thanks for the attention!

 

I started doing this days ago.

 

link (pt-br)

Edited by UMGEEK

Share this post


Link to post
Share on other sites
DavidRO99

Been using this for the past 5-6 months, can say it's absolutely great and mod developing has gotten much easier since then, but I notice one thing is missing, a way to upload data to a MySQL database (so I can keep track of all my mod's users), or just to contact the internet in any way.

Share this post


Link to post
Share on other sites
KaizoM

[sorry for use Google Translate]

 

I really love Moonloader, actually I am studying Python lenguaje and I had never seen LUA but it's similar. But I have a problem, which is that I love writing with good spelling (in my language, in English I write like sh..), and apparently Moonloader has another interpretation to write Latin Spanish characters. I mean, in .GXT or CLEO to represent, for example, the á, é, í, ó, ú I must put other special characters and print them to me wonderfully. In LUA ... nothing, I doesn't print what I'm looking for, only the ó is well displayed but leaves a space for some reason.

The direct question would be, is there any way to write special Latin characters in LUA or not?
Example for Latin characters in GXT displayed correctly in DYOM
correcto.png
In Moonloader... How I can do that?
Moonloader.png

Share this post


Link to post
Share on other sites
Vills SkyTerror

I heard MTA uses similar script. So is it possible to use those directly in moonloader? For example, dynamic vehicle sounds.

Share this post


Link to post
Share on other sites
SHIFAAH9

No.

Share this post


Link to post
Share on other sites
DarthRickraft
Posted (edited)

Nothing

Edited by DarthRickraft
Wrong Forum

Share this post


Link to post
Share on other sites
skatefilter5

how do you enable interior to enter and garage while in 2 player and where is that lua location at?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 2 Users Currently Viewing
    0 Members, 0 Anonymous, 2 Guests

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.