Modding:JSON Patching/en: Difference between revisions

From Vintage Story Wiki
Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 93: Line 93:




=== File Path and Name Considerations ===  
=== File Path and Name Considerations ===
By default, when you generate a mod using ModMaker 3000™, the folder structure will use '''game''' as the domain, and use the same file name as the vanilla JSON file. This can lead to mod conflicts.
By default, when you generate a mod using ModMaker 3000™, the folder structure will use '''game''' as the domain, and use the same file name as the vanilla JSON file. This can lead to mod conflicts.


Line 102: Line 102:
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 ===  
=== Overwriting issue ===
 
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 109: Line 110:
[
[
   {
   {
     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 119: Line 120:
[
[
   {
   {
     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.




43,115

edits