Class PieceConfig
Configuration class for adding custom pieces.
Use this in a constructor of CustomPiece and Jötunn resolves the references to the game objects at runtime.
Use this in a constructor of CustomPiece and Jötunn resolves the references to the game objects at runtime.
Inherited Members
Namespace: Jotunn.Configs
Assembly: Jotunn.dll
Syntax
public class PieceConfig
Properties
Name | Description |
---|---|
AllowedInDungeons | Can this piece be built in dungeons? Defaults to false . |
Category | The name of the category this piece will appear on. If categories are disabled on the
target PieceTable, this setting will be ignored. If categories are enabled but the given category can't be found, a new Piece.PieceCategory will be added to the table. |
CraftingStation | The name of the crafting station prefab which needs to be in close proximity to build this piece. |
Description | The description of your piece. May be tokenized. |
Enabled | Whether this piece is buildable or not. Defaults to true . |
ExtendStation | The name of the crafting station prefab to which this piece will be an upgrade to. |
Icon | Icon which is displayed in the crafting GUI. |
Name | The name for your piece. May be tokenized. |
PieceTable | The name of the piece table where this piece will be added. |
Requirements | Array of RequirementConfigs for all crafting materials it takes to craft the recipe. |
Methods
Name | Description |
---|---|
AddRequirement(RequirementConfig) | Appends a new RequirementConfig to the array of existing ones. If the requirement is null or is not valid (has not item name or amount set) nothing will be added. |
Apply(GameObject) | Apply this configs values to a piece GameObject. |
FromJson(string) | Loads a single PieceConfig from a JSON string |
GetRequirements() | Converts the RequirementConfigs to Valheim style Piece.Requirement array. |
ListFromJson(string) | Loads a list of PieceConfigs from a JSON string |