Show / Hide Table of Contents

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.
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 Source

AllowedInDungeons

Can this piece be built in dungeons? Defaults to false.
Declaration
public bool AllowedInDungeons { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

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.
Declaration
public string Category { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
| Improve this Doc View Source

Description

The description of your piece. May be tokenized.
Declaration
public string Description { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Enabled

Whether this piece is buildable or not. Defaults to true.
Declaration
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

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
| Improve this Doc View Source

Icon

Icon which is displayed in the crafting GUI.
Declaration
public Sprite Icon { get; set; }
Property Value
Type Description
Sprite
| Improve this Doc View Source

Name

The name for your piece. May be tokenized.
Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

Apply(GameObject)

Apply this configs values to a piece GameObject.
Declaration
public void Apply(GameObject prefab)
Parameters
Type Name Description
GameObject prefab
| Improve this Doc View Source

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
| Improve this Doc View Source

GetRequirements()

Converts the RequirementConfigs to Valheim style array.
Declaration
public Piece.Requirement[] GetRequirements()
Returns
Type Description
Piece.Requirement[] The Valheim array
| Improve this Doc View Source

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

Extension Methods

PrefabExtension.FixReferences(Object)
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾