GithubHelp home page GithubHelp logo

Balamod

Mod loader, Injector and Decompiler that supports in-game code injection for Balatro

Balamod Discord

Summary

Easy Install

Important

Balamod currently don't work on macOS i86, but it will work on ARM64 aka M1/M2/M3.

Balamod has now a GUI installer

How to Install Mods

Yon can directly install mods from the in game mod menu or just put your mods in the mods folder

  • Windows: C:\Users\<username>\AppData\Roaming\Balatro aka %APPDATA%\Balatro
  • macOS: ~/Library/Application Support/Balatro
  • Linux: ~/.local/share/Steam/steamapps/compatdata/2379780/pfx/drive_c/users/steamuser/AppData/Roaming/Balatro

CLI Usage

Initially, Balamod searches for all Balatro installations. If a single installation is found, it becomes the default. For multiple installations, a prompt will allow you to select one. In case no installation is detected, you will be prompted to specify one using the -b flag.

Warning

Since balamod is now fully external, the usage of -x should not be used anymore.

Example of usages

  • Basic Help

    ./balamod --help
  • Full Auto-Injection of the Mod Loader

    ./balamod -a
  • Injecting a File into the Game

    ./balamod -x -i <file> -o <game_file_name>
  • Example to patch an asset file

    ./balamod -x -i balatro.png -o ressources/textures/x2/balatro.png
  • Decompiling the game

    ./balamod -d

    or to decompile it into multiple folders,

    ./balamod -d -o MyCustomFolder

If you want to inject game code, you will need to compress it with -c Example to inject a Lua file:

./balamod -x -c -i Balatro.lua -o DAT1.jkr

Modding

Documentation moved to balamod.github.io

For a complete example see example-mod which shows events, api, injection and a github action for release

How to Use Code Injection

Before the game starts, Balamod will retrieve all the code and store it in a map where one file equals to one key. It allows Balamod to know the current state of the game code, and to overwrite parts of it already loaded by the engine.

To use it, you will need 3 elements:

  • The Lua file where you want to inject your code,
  • The function name,
  • The part of the code you want to replace.

The inject function takes 4 parameters which are the 3 elements seen above and the new code as 4th parameter. In the mod, it replaces the part that manages the number of cards to be activated very simply like that:

local to_replace = 'amount = amount or 1' -- old code
local replacement = 'amount = ' .. planet_multiplicator_strength -- new code
local fun_name = "level_up_hand"
local file_name = "functions/common_events.lua"

inject(file_name, fun_name, to_replace, replacement)

How to find the function names, where to inject code, etc...

You can use the ./balamod -d command to decompile the game and take a look at the code.

balamod's Projects

balamod icon balamod

Modloader/Injector/Decompiler that supports ingame code injection for Balatro (Linux/Windows/Mac)

catalog icon catalog

Catalog of mods installable through the balamod mod menu

lua-https icon lua-https

Fork of https://github.com/love2d/lua-https

mods icon mods

Repository of mods to use with balamod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.