Mods / PatchDebug
Author: goxmeor
Side: Both
Created: Apr 15th 2021 at 10:41 AM
Last modified: Apr 19th 2021 at 1:48 PM
Downloads: 1449
Follow Unfollow 19
Latest release (for Vintage Story 1.14.8, outdated):
PatchDebug-1.1.2.zip
1-click install
This is a tool for mod developers.
Dumps JSON to logs before and after selected patches are made.
Rename your patch file to include .debug. in its filename to trigger dumping. For example, assets/ropeorganization/patches/ropetricks.debug.json.
Copious amounts of JSON will be dumped to your server-debug.txt and/or client-debug.txt log files.
Please make sure to rename your files back when you're done!
Example
assets/ropeorganization/patches/ropetricks.debug.json:
[
{
"file": "game:itemtypes/resource/rope.json",
"op": "add",
"path": "/creativeinventory",
"value": {
"made_of_plants": ["*"],
"long_and_thin": ["*"]
},
}
]
Excerpt from server-debug.txt:
15.4.2021 03:29:36 [VerboseDebug] === PatchDebug === patches/ropetricks.debug.json => game:itemtypes/resource/rope.json #0 === BEFORE ===
15.4.2021 03:29:36 [VerboseDebug] {
code: "rope",
texture: { base: "item/resource/rope" },
creativeinventory: { "general": ["*"], "items": ["*"] },
maxstacksize: 16,
materialDensity: 510
}
15.4.2021 03:29:36 [VerboseDebug] === PatchDebug === patches/ropetricks.debug.json => game:itemtypes/resource/rope.json #0 === /BEFORE ===
15.4.2021 03:29:36 [VerboseDebug] === PatchDebug === patches/ropetricks.debug.json => game:itemtypes/resource/rope.json #0 === AFTER ===
15.4.2021 03:29:36 [VerboseDebug] {
"code": "rope",
"texture": {
"base": "item/resource/rope"
},
"creativeinventory": {
"made_of_plants": [
"*"
],
"long_and_thin": [
"*"
]
},
"maxstacksize": 16,
"materialDensity": 510
}
15.4.2021 03:29:36 [VerboseDebug] === PatchDebug === patches/ropetricks.debug.json => game:itemtypes/resource/rope.json #0 === /AFTER ===
Oops! /creativeinventory got replaced, deleting "general": ["*"], "items": ["*"].
Solution
The purpose of this mod is to help identify problems, but for posterity, here is the correct way to solve the problem above of adding multiple keys:
[
{
"file": "game:itemtypes/resource/rope.json",
"op": "add",
"path": "/creativeinventory/made_of_plants",
"value": ["*"]
},
{
"file": "game:itemtypes/resource/rope.json",
"op": "add",
"path": "/creativeinventory/long_and_thin",
"value": ["*"]
}
]
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.1.2 | patchdebug | 577 | Apr 19th 2021 at 1:48 PM | PatchDebug-1.1.2.zip | 1-click install | ||
|
Switched to release build now that Harmony issue is resolved | |||||||
| 1.1.0 | patchdebug | 423 | Apr 16th 2021 at 10:31 AM | PatchDebug-1.1.0.zip | 1-click install | ||
|
Wasn't working... fixed it! | |||||||
| 1.0.0 | patchdebug | 449 | Apr 15th 2021 at 10:42 AM | Empty | PatchDebug-1.0.0.zip | 1-click install | |