json_to_tbl
Convert a JSON string list into a Diablo II .tbl string table, building the index, hash table and CRC-16 the game checks, then verifying every key by lookup before writing the file.
Instructions
Build a Diablo II string table (.tbl) from a JSON file on the local disk. json: the path of a .json as tbl_to_json writes it, or simply a list of {"key": ..., "text": ...} objects; the order of the entries is the string numbering. out: the .tbl to write (name it string.tbl, expansionstring.tbl or patchstring.tbl for the game to load it); an existing file is refused unless overwrite is true. Builds the index, the hash table (strings placed in number order, as the game's own files are) and the CRC-16 the game checks. "hash_size" and "max_tries" in the JSON are optional: by default the hash table is the next prime above the string count and the lookup limit exactly what the placement needs; a limit given too low is raised. The result is read back and every key looked up the way the game does before the reply. Limits: 65,535 strings, 65,534 bytes of text each; a key repeated in one file is found at its first entry only. Not tested in the game itself.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"json": "<json>",
"out": "<out>"
},
"name": "json_to_tbl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | ||
| json | Yes | ||
| overwrite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |