A development environment for Balatro mods, providing essential utilities and API definitions to streamline the modding process.
This environment is designed to enhance mod development using the Lua Language Server.
This environment is optimized for modding with lovely-injector and smods (formerly Steamodded). It includes:
- love2d API definitions (
love2d-dev
): Comprehensive API support for LOVE2D. - smods definitions (
smods-dev
): Simplified access to smods functions. - Balatro definitions (
balatro-dev
): Enhances development with Balatro-specific APIs.
Note: This environment requires the Sumneko Lua Language Server.
To set up this development environment, follow these steps:
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/LnxFCA/balatro-mod-env.git dev
-
Initialize submodules (if not already done):
git submodule update --init --recursive
-
Configure the Lua Language Server by creating a
.luarc.json
file in the workspace root with the following content:{ "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", "workspace.library": [ "dev/love2d-dev", "dev/balatro", "dev/balatro-dev", "dev/smods/src", "dev/smods-dev" ], "diagnostics.disable": [ "lowercase-global" ] }
-
Replace
dev
with your repository (clone) folder name if it's different. -
Extract Balatro's source files into a
balatro
directory within the repository. Tools like 7zip or p7zip can be used for this step.
For more information on the language server configuration, see: https://luals.github.io/wiki/configuration/.
No additional setup is needed in your mod's source files.
This section also applies to WSL (Windows Subsystem for Linux).
This a guide for Linux users on how to use the tools here.
Ensure you have the following tools installed:
cargo
for building thelovely-injector
library.- A compatible Lua interpreter (if testing Lua code outside of Balatro).
- Love2D (
love
) for running the game.
-
Compile lovely:
cd lovely/crates && cargo build --release
-
Use provided scripts:
-
install
: Installs mod files for development or release. Include aVERSION
file for releases. -
run
: Launches the game with lovely-injector and smods enabled.
Examples:
-
Install for development:
MODNAME=my-mod-dir ./dev/install
-
Create release files:
MODNAME=my-mod-dir DESTDIR=/tmp/balatro-mods ./dev/install release
-
Run with lovely-injector and smods only:
./dev/run
-
Run vanilla game:
NOLOVELY=true ./dev/run
This project is licensed under the GNU General Public License v3 or later. However, it includes submodules governed by their own licenses. Refer to each submodule's directory for specific licensing terms.
For more information, see the LICENSE
file in this repository.