#AML -- A minimalist but feature rich mod loader

1 messages · Page 1 of 1 (latest)

jaunty flint
#

INSTALLATION: Use an archive utility such as 7-zip to overwrite Balatro's main.lua with the [given one](#1331694321451139094 message). aml.lua is NOT the loader. See notes.

Main features:

  • No modifications* by default: You can use a custom mod menu, or none at all, for example.
  • No global pollution: Mod files have an empty global scope by default, except for the library aml. No global variables define in your mod will pollute other mods or the game code by default.
  • Modular: Mods can define an exports table. Other mods can then use aml.require("library") to access exported functionality.
  • Advanced dependency resolution: You can specify version ranges for dependencies, and also whether the dependencies must be loaded before this mod. (only affects preload and postload call order)

Usage

See [example-mod.lua](#1331694321451139094 message).
preload is called before G:start_up and steam init, while postload is called after.
aml.mods is a list of all mods (will be complete before preload is called). See aml.lua for its format.

*: Except changing the game version text to show you have AML installed.

PS: If you use LuaLS, as VSCode's Lua extension does, you can register the aml.lua as a lua library. This will give some autocomplete for the provided functions.

PPS: This uses the old "replace the balatro file" technique, but just because I haven't had time to look into Lovely yet. You are welcome to port this patch to Lovely, as I suspect it to be pretty easy.

PPPS: "my Byte Patcher mod" is referring to this: https://discord.com/channels/1116389027176787968/1266751398142414928; note that it is not a valid AML mod as it is

#

(aml.lua's reassemble annotation doesn't have fenv; that's just an annotation error)

lucid cairn
#

14 competing standards

jaunty flint
jaunty flint
quick kraken
#

cool project!

#

here's my general "be careful redistributing game files yada yada"

jaunty flint
#

Since main.lua has basically nothing in it and other old-school "replace function" mods already contain modified game code and I haven't seen thunk get mad at them for that I think it's fine

quick kraken
#

sounds good :-)

coarse sand
#

new loader just dropped

#

Also don't you not need to replace game files for this? you can just shove files in the save directory if I'm not misremembering

waxen trellis
#

depends what it does

#

if its just add some code then save injection or just a single lovely patch would be fine

jaunty flint
jaunty flint
quick kraken
#

you can do it though save file ACE 👀

waxen trellis
#

I have a script to ace a save file

#

or well I was using the settings file cause its loaded earlier

#

used it to inject steamodded 0.9.8 cause I felt like it

jaunty flint
# quick kraken you can do it though save file ACE 👀
  1. that means the modded status is synced through steam cloud (currently I have a script that spawns a UI to choose whether to play modded on launch, similar to Steam's native launch options dialog)
  2. that cannot patch anything before settings are loaded
#

also by the way a very horrible thing you can do is to compute the mod info (name, id, version, description, dependencies, etc.) at run time, though since no other mods are guaranteed to be loaded(as your dependencies haven't been computed yet!), the only thing you can really do is to randomize a flavor text in the description.

waxen trellis
#

the before settings are loaded is basically nothing because settings load almost immediatly to apply your fullscreen setting

jaunty flint
# waxen trellis the before settings are loaded is basically nothing because settings load almost...

fun fact, my fullscreen resolution kept reverting because apparently the game loads the fullscreen so eagerly it doesn't check your selected video mode or something and just selects the default(in my case I have a 1080p laptop screen with 125% scaling and balatro kept defaulting to 1600x900). I just modded the game to edit the settings(too lazy to read the settings file), and apparently there is a field to override that eager resolution which can't be set in the settings menu for some reason

waxen trellis
#

thats funny

#

I did make a save editor which can open the settings file if you needed to change it

jaunty flint
#

I actually did make two simple python files where you drag your savefile over it to inflate / deflate back in the demo days

waxen trellis
#

yeah i had started with a simple lua script to do so orignally

#

but it kinda evolvedf