You are viewing a potentially older version of this package. View all versions.
JoStro-JSUtils-0.2.0 icon

JSUtils

Lets mods add item prototypes, descriptions and custom sprites with simple json configuration files

Date uploaded 2 years ago
Version 0.2.0
Download link JoStro-JSUtils-0.2.0.zip
Downloads 283
Dependency string JoStro-JSUtils-0.2.0

This mod requires the following mods to function

Thunderstore-lovely-0.4.0 icon
Thunderstore-lovely

Lovely is a runtime lua injector for LÖVE 2d

Preferred version: 0.4.0
metherul-nativefs-1.0.1 icon
metherul-nativefs

nativefs replicates a subset of the love.filesystem API, but without LÖVE's path restrictions.

Preferred version: 1.0.1
JoStro-json5-0.1.1 icon
JoStro-json5

Exposes a module for parsing json5 using lovely

Preferred version: 0.1.1

README

JSUtils: A configuration framework for Balatro

JSUtils is a mod that allows mods to define additional item prototypes, item descriptions and sprite atli using a collection of json configuration files. Additional patches for giving items custom atli and correctly adding items into the collection pages are also included.

Usage

The JSON configuration files must be placed directly in a folder named js_utils inside of the appropriate mod's folder.

The following files are supported:

  • centers.json, blinds.json, tags.json and seals.json: Each contain a table that is added to the appropriate item prototype table in Game:init_item_prototypes, for example centers.json is added to G.P_CENTERS.
  • descriptions.json: contains a table of various custom localizations that are added to the descriptions section of the game's localization object. en-us is required as it is defaulted to when a language is not included.
  • asset_atli.json, animation_atli.json: Each contain a list of atlas objects, that are inserted directly into the appropriate lists in Game:set_render_settings. Paths are extrapolated to be relative to <mod_dir>/textures/{1,2}x

Examples

A basic joker added in centers.json. order is modified to be relative to the current mod or is set automiatically, and pos is defaulted to {x = 0, y = 0} when none is provided. The atlas property is also supported for custom atli.

{
  "j_example_joker": {
    "order": 1,
    "name": "Example Joker",
    "unlocked": true,
    "discovered": true,
    "blueprint_compat": true,
    "eternal_compat": true,
    "rarity": 1,
    "cost": 2,
    "effect": "",
    "cost_mult": 1.0,
    "config": {},
    "atlas": "Example"
  }
}

A simple english joker description added in descriptions.json.

{
  "en-us": {
    "Joker": {
      "j_example_joker": {
        "name": "Example Joker",
        "text": [
          "Does nothing special",
          "but it's a mod so that's cool"
        ]
      }
    }
  }
}

A custom atlas added in asset_atli.json, requires a file called example.png located in textures/1x and textures/2x in the mod's folder

[
  {"name":"Example","example.png","px":71,"py":95}
]

CHANGELOG

Version 0.3.0

  • Change config format to json5 (fully backwards compatible with json)
  • Add options to facilitate the creation and usage of custom badges.
  • The following additional config files are supported: misc_loc.json, badge_colours.json

Version 0.2.1

  • Bump Dependency Versions

Version 0.2.0

  • Added support for the order field, modifying it to be relative to the current mod.