Patches

From wiki
Revision as of 14:55, 27 August 2020 by MarkGrant (Talk | contribs)

Jump to: navigation, search

In Staxel, *.patch files are used to patch existing files in the game. This doesn't work for everything but will work for most things. Note that you can only patch one file using a *.patch file. You will need to make another file if you use to patch something else.


Creating a Patch

While not as necessary for patches, make sure to follow Modding#Getting Started with Staxel Modding first. Once this is done, create a file with an ending of .patch, and place the following into it.

{
 "file": "staxel/item/complete/IceCream.item",
 "priority": 2, 
 "mergeLists": false, 
 "patch" : {
 "pricing": {
   "catalogueUnlockedFromStart": false,
   "buyable": true,
   "sellPrice": 1008,
   "value": 1680
  }
 }
}

This is a fairly straight forward patch. It is used to change the pricing component of Ice Cream. Feel free to edit these values however you want.


The first property, "file", is the string that contains the file path to the file you want to patch identifier of this reaction.

The second property, "priority", is used to determine the priority of multiple patches of the same file.

The next property, "mergeList", is self explanatory. It determines whether you use to merge your patch with existing lists or to completely override the list.

The final property, "patch", is the important section. This is where you place the (Blobs) you want to patch.


Config Options

"file"

Valid options (String ): A string containing the path to a file.

Default Value: No default value is specified. Always need to provide your own.

The file to use for the patch. This includes the file path as well as the filename extension. The game will not notify you if you have entered an incorrect filepath so ensure that you have entered it correctly.


"priority"

Valid options (Integer): A positive integer number.

Default Value: If not specified, will default to 0.

This is the order in which to apply the patch. The patch with higher priority will display over the top of the patch with lower priority.

"mergeLists"

Valid options (Bool): True or False.

Default Value: If not specified, will default to True.

This value specifies whether or not to mergeLists included in "patch". True will add properties inside of your list to the list of the existing file while false will override the existing list with the list you have provided.

"fileCheck"

Valid options (Bool): True or False.

Default Value: If not specified, will default to True.

This value specifies whether or not to check if the "file" exists. Currently this doesn't seem to work and can be omitted.


"patch"

Valid options (Blobs): JSON objects or properties.

Default Value: No default value is specified. Always need to provide your own.

This is the main component of the ".patch" file. This blob contains all the components, lists and properties you wish to patch.