Skip to main content

A command-line tool to help game modders build string resources for Diablo II: Resurrected.

Project description

license test version python downloads

Charsi

A command-line tool to help game modders build string resources for Diablo II: Resurrected.

Introduction

In the classic version of Diablo II, there was a very famous hacking tool called Maphack, which could easily configure texts displayed in game. Now in Diablo II: Resurrected, you can directly modify the JSON files to change texts in game, but the workload is high, and it's easy to make mistakes.

charsi-icon Charsi is the blacksmith in the Rogue Encampment in Act I of Diablo II, and can imbue any normal item of the player's choice.

This tool named charsi, can imbue game strings with your recipes which are in a format similar to Maphack configurations.

Quickstart

  1. Extract item-names.json file at /data/local/lng/strings from game data storage by CascView.

  2. Write a recipe file example.recipe with following:

Text[qf1]: Example
  1. Run the following command to build a new string table:
charsi build --recipe-file=example.recipe item-names.json > new-item-names.json
  1. Replace file /data/local/lng/strings/item-names.json with new-item-names.json in your mods.

  2. Check in game, item name Khalim's Flail has been replaced with Example.

How to Use

There are three concepts in Charsi: String Table, Instruction and Recipe.

String Table

Represents JSON files extracted from game data, the target for modding.

Instruction

Tells Charsi what to do when building string tables, is equivalent to a configuration in the d2maphack.cfg.

Format of instructions is:

name[query][language]: arg1, arg2, ...
  • name: Name of instruction
  • query: Specify which strings to operate on
  • language: Optional, specify which language to operate on
  • arg1, arg2, ...: Arguments of instruction, separated by comma

Three ways to query strings:

  1. Single string:

    Instruction[qf1]: ... # for Khalim's Flail
    
  2. By range:

    Instruction[qf1~qhr]: ... # all Khalim's stuffs
    
  3. Discrete

    Instruction[qey, qhr]: ... # Khalim's Eye and Heart
    

Built-in Instructions

  • Text: Replace string texts
  • Color: Set color of string text

Customize Instructions

Instructions are implemented by Lua scripts and put in directory /instructions

APIs for Lua to implement instructions

  • RegisterInstruction(name, fn): Register a new instruction.
  • UnregisterInstruction(name): Unregister an existing instruction.
  • InstructionRegistered(name): Check whether instruction is registered.

Recipe

A collection of instruction for building string tables.

Recipe Tags

You can set tags of recipes in format:

## Tag-name: value

## Language: The default language of instructions in this recipe

Commands

Build a string table with recipe:

charsi build --recipe-file=/path/to/recipe path/to/stringtable

Build string tables with manifest files:

charsi build-manfiest path/to/manifest

Manifest

In JSON format like:

[
    {
        "input": "/path/to/stringtable",
        "output": "/path/to/output",
        "recipes": [
            "/path/to/recipe1",
            "/path/to/recipe2",
            "..."
        ]
    }
]

Directory Structure

  • /instructions/: Lua scripts for instruction handlers

Variables

  • {origin}: Placeholder for original text

Alias

You can set alias to a bunch of keys by putting files in /alias/.

License

Copyright (C) 2022 Garrett HE garrett.he@hotmail.com

The GNU General Public License (GPL) version 3, see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charsi-2.2.0.tar.gz (129.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charsi-2.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file charsi-2.2.0.tar.gz.

File metadata

  • Download URL: charsi-2.2.0.tar.gz
  • Upload date:
  • Size: 129.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for charsi-2.2.0.tar.gz
Algorithm Hash digest
SHA256 8b5d807262088fc2548cc29073adb5500c20f8aec5c762a76c12ebf502645bd3
MD5 3b886e9b5d3b49a2d35ccd2836c97dde
BLAKE2b-256 da224b8f4a53006662529fa96be386127852f71982d8da2033fa899e440b22d6

See more details on using hashes here.

File details

Details for the file charsi-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: charsi-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for charsi-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2031b61358a71c82e11f0298132e952d97d821f0f00f8463f84bdd309f6d104b
MD5 6e8d335a54b5f8176e415024730924ac
BLAKE2b-256 80cc00d4e67f002020b03ead7240abbeeb61e15ca991f7b040861e675f77f1a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page