Modding:JSON Patching: Difference between revisions

From Vintage Story Wiki
no edit summary
(Marked this version for translation)
No edit summary
Line 127: Line 127:
To avoid the possibility of mod conflicts, do not use the '''game''' folder. Instead, use a folder with the same name as your '''modid'''; that is, your mod's domain. So in this example, WolvesAreWimps.zip should instead have the folders '''assets\wolvesarewimps\patches''' and WolvesDropSticks.zip should instead have the folders '''assets\wolvesdropsticks\patches'''. File names are also arbitrary, you do not need to use '''survival-entities-land-wolf-male.json''' and can name the file anything you want, since its contents direct the game on what and how to patch, not the file's name.
To avoid the possibility of mod conflicts, do not use the '''game''' folder. Instead, use a folder with the same name as your '''modid'''; that is, your mod's domain. So in this example, WolvesAreWimps.zip should instead have the folders '''assets\wolvesarewimps\patches''' and WolvesDropSticks.zip should instead have the folders '''assets\wolvesdropsticks\patches'''. File names are also arbitrary, you do not need to use '''survival-entities-land-wolf-male.json''' and can name the file anything you want, since its contents direct the game on what and how to patch, not the file's name.
   
   
=== Overwriting issue ===  <!--T:31-->
=== Overwriting issue ===   
 
<!--T:31-->
Patches that are creating e.g. behaviors or attributes (for example, if item does not have it), will be overwritten by patches from other mods that are doing same, but with another value.
Patches that are creating e.g. behaviors or attributes (for example, if item does not have it), will be overwritten by patches from other mods that are doing same, but with another value.


Line 135: Line 137:
[
[
   {
   {
     op: "add",
     "op": "add",
     path: "/behaviors",
     "path": "/behaviors",
     value: [{ "name": "SealPlacedCrock" }],
     "value": [{ "name": "SealPlacedCrock" }],
     file: "game:itemtypes/resource/fat.json"
     "file": "game:itemtypes/resource/fat.json"
   }
   }
]
]
Line 145: Line 147:
[
[
   {
   {
     op: "add",
     "op": "add",
     path: "/behaviors",
     "path": "/behaviors",
     value: [{ "name": "Placeable" }],
     "value": [{ "name": "Placeable" }],
     file: "game:itemtypes/resource/fat.json"
     "file": "game:itemtypes/resource/fat.json"
   }
   }
]
]
</syntaxhighlight>
</syntaxhighlight>
'''Note''' : see the [[Modding:CompatibilityLib|Compatibility]] page for possible ways to handle conflicts and dependencies between mods.




Confirmedusers
957

edits