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.
Metadata
Release files for charsi 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| charsi-2.2.0.tar.gz | 129.8 kB | Without provenance | Details for charsi-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| charsi-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for charsi-2.2.0-py3-none-any.whl |
Total release size: 139.1 kB
Release files / charsi-2.2.0.tar.gz
| Download URL | charsi-2.2.0.tar.gz |
|---|---|
| Size | 129.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b5d807262088fc2548cc29073adb5500c20f8aec5c762a76c12ebf502645bd3
|
|
BLAKE2b-256 checksum How to use checksums |
da224b8f4a53006662529fa96be386127852f71982d8da2033fa899e440b22d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Release files / charsi-2.2.0-py3-none-any.whl
| Download URL | charsi-2.2.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2031b61358a71c82e11f0298132e952d97d821f0f00f8463f84bdd309f6d104b
|
|
BLAKE2b-256 checksum How to use checksums |
80cc00d4e67f002020b03ead7240abbeeb61e15ca991f7b040861e675f77f1a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Security for charsi 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.