A command-line tool to help game modders build string resources for Diablo II: Resurrected.
Project description
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 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
-
Extract
item-names.jsonfile at/data/local/lng/stringsfrom game data storage by CascView. -
Write a recipe file
example.recipewith following:
Text[qf1]: Example
- Run the following command to build a new string table:
charsi build --recipe-file=example.recipe item-names.json > new-item-names.json
-
Replace file
/data/local/lng/strings/item-names.jsonwithnew-item-names.jsonin your mods. -
Check in game, item name
Khalim's Flailhas been replaced withExample.
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:
-
Single string:
Instruction[qf1]: ... # for Khalim's Flail -
By range:
Instruction[qf1~qhr]: ... # all Khalim's stuffs -
Discrete
Instruction[qey, qhr]: ... # Khalim's Eye and Heart
Built-in Instructions
Text: Replace string textsColor: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b5d807262088fc2548cc29073adb5500c20f8aec5c762a76c12ebf502645bd3
|
|
| MD5 |
3b886e9b5d3b49a2d35ccd2836c97dde
|
|
| BLAKE2b-256 |
da224b8f4a53006662529fa96be386127852f71982d8da2033fa899e440b22d6
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2031b61358a71c82e11f0298132e952d97d821f0f00f8463f84bdd309f6d104b
|
|
| MD5 |
6e8d335a54b5f8176e415024730924ac
|
|
| BLAKE2b-256 |
80cc00d4e67f002020b03ead7240abbeeb61e15ca991f7b040861e675f77f1a9
|