Página 1 de 1

[MOON/MoonLoader] Load Scripts from Mod Loader

Enviado: 08 Ago 2020, 20:30
por HzanRsxa2959
Note: If not working with AutoID3000 3002 or later, refer to here.

This is my first script demonstrating the usage of ___SearchModLoaderLog.

Description:
This is a lua script that searches inside Mod Loader for any lua scripts and loads them into MoonLoader.

Requirements:
___SearchModLoaderLog (for 2.0 or below)
AutoID3000 3002 or later (for 3.0 or above)

Download:
1.0 (VERY old and outdated, do not use)
2.0
3.0

Note:
Please read the Drawbacks.

Note: The script file is intentionally named with two underscores so that it is loaded before other scripts. Changing the file name may result in errors.

Usage:
To be loaded, the lua script must have the extension lua or luac, and be inside a subfolder named moonloader\.
Here are some examples:
modloader\lua mods\my mod.lua   => wrong
modloader\lua mods\moonloader\my mod\my mod.lua   => wrong
modloader\moonloader\my mod\my mod.lua   => wrong

modloader\moonloader\my mod.lua   => correct
modloader\lua mods\moonloader\my mod.lua   => correct
modloader\lua mods\moonloader\moonloader mods\subfolder\moonloader\my mod.lua   => correct

Credits:
HzanRsxa2959

Re: [MOON/MoonLoader] Load Scripts from Mod Loader

Enviado: 01 Out 2020, 08:37
por HzanRsxa2959
Drawbacks:
  • Libraries do not work in Mod Loader. It only works for simple scripts that require libraries installed in MoonLoader. (i.e., MoonAdditions and ImGui work if installed in MoonLoader).
  • Most modmakers use MoonLoader directory instead of script directory to look for files, so their scripts are not compatible.
  • Imports do not work
I am trying to solve these problems, but the solution only generates more problems. If anyone can contribute, please help:
f14-ajuda/t4865-lua-modify-package-path-globally#p30658

Re: [MOON/MoonLoader] Load Scripts from Mod Loader

Enviado: 06 Fev 2022, 10:53
por HzanRsxa2959
Note: This method requires AutoID3000 3002 or later.

As of AutoID3000 3002 or later, this mod no longer works because of ___SearchModLoaderLog not working. Follow these steps to make it work again:
  • Go to MoonLoader's scripts folder and delete ___SearchModLoaderLog.lua.
  • Download the latest version of this mod from the main post of this topic.
  • Go to MoonLoader's scripts folder and put __LoadScriptsFromModLoader.lua there. Confirm replacement if asked.
  • Optional: Undo the steps done here.