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.
Inheritance
System.Object
PieceConfig
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn.Configs
Assembly: Jotunn.dll
Syntax
public class PieceConfig
Properties
| Improve this Doc View SourceAllowedInDungeons
Can this piece be built in dungeons? Defaults to
false
.
Declaration
public bool AllowedInDungeons { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Category
The name of the category this piece will appear on. If categories are disabled on the
target , this setting will be ignored.
If categories are enabled but the given category can't be found, a new will be added to the table.
If categories are enabled but the given category can't be found, a new
Declaration
public string Category { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CraftingStation
The name of the crafting station prefab which needs to be in close proximity to build this piece.
Declaration
public string CraftingStation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
The description of your piece. May be tokenized.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Enabled
Whether this piece is buildable or not. Defaults to
true
.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ExtendStation
The name of the crafting station prefab to which this piece will be an upgrade to.
Declaration
public string ExtendStation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Icon
Icon which is displayed in the crafting GUI.
Declaration
public Sprite Icon { get; set; }
Property Value
Type | Description |
---|---|
Sprite |
Name
The name for your piece. May be tokenized.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PieceTable
The name of the piece table where this piece will be added.
Declaration
public string PieceTable { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Requirements
Array of RequirementConfigs for all crafting materials it takes to craft the recipe.
Declaration
public RequirementConfig[] Requirements { get; set; }
Property Value
Type | Description |
---|---|
RequirementConfig[] |
Methods
| Improve this Doc View SourceApply(GameObject)
Apply this configs values to a piece GameObject.
Declaration
public void Apply(GameObject prefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | prefab |
FromJson(String)
Loads a single PieceConfig from a JSON string
Declaration
public static PieceConfig FromJson(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | JSON text |
Returns
Type | Description |
---|---|
PieceConfig | Loaded PieceConfig |
GetRequirements()
Converts the RequirementConfigs to Valheim style array.
Declaration
public Piece.Requirement[] GetRequirements()
Returns
Type | Description |
---|---|
Piece.Requirement[] | The Valheim |
ListFromJson(String)
Loads a list of PieceConfigs from a JSON string
Declaration
public static List<PieceConfig> ListFromJson(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | JSON text |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<PieceConfig> | Loaded list of PieceConfigs |