Show / Hide Table of Contents

Class SkillConfig

Configuration class for adding custom skills.
Inheritance
System.Object
SkillConfig
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)
Namespace: Jotunn.Configs
Assembly: Jotunn.dll
Syntax
public class SkillConfig

Properties

| Improve this Doc View Source

Description

The in-game description for your skill. Can either be the description you want to see in-game, or a localization token.
Declaration
public string Description { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Icon

The in-game icon for your skill. If null, will default to a "shield" icon.
Declaration
public Sprite Icon { get; set; }
Property Value
Type Description
Sprite
| Improve this Doc View Source

IconPath

The path to load an icon png/jpg file from. If you wish to load from an asset bundle, use a $ to separate the path to the asset bundle, and your sprite name in the asset bundle

This cannot be set if Icon is also set. You can only set one of them at once.

This sample shows how you would load a sprite from an asset bundle:
    IconPath = "MyMod/Assets/assetbundle$mysprite"
Declaration
public string IconPath { set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Identifier

A unique string used to identify the skill, and used to generate the UID.

Do not change the Identifier after you have released a mod using it. If the Identifier changes, so will the skill's SkillType/UID, so all users who have your mod will lose their save progress for the skill.

Declaration
public string Identifier { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IncreaseStep

The multiplier applied to all XP gained for this skill via . If this is set to 0, your skill will be unable to gain XP at all.
Declaration
public float IncreaseStep { get; set; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

Name

The in-game name for your skill. Can either be the name you want to see in-game, or a localization token.
Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

UID

A SkillType used to distinguish this skill from others. This is a unique ID that Jotunn generates based on the Identifier provided.
Declaration
public Skills.SkillType UID { get; }
Property Value
Type Description
Skills.SkillType

Methods

| Improve this Doc View Source

FromJson(String)

Loads a single SkillConfig from a JSON string.
Declaration
public static SkillConfig FromJson(string json)
Parameters
Type Name Description
System.String json JSON text
Returns
Type Description
SkillConfig Loaded SkillConfig
| Improve this Doc View Source

FromSkillInjector(String, Skills.SkillType, String, String, Single, Sprite)

Creates a SkillConfig object for mods that previously used SkillInjector.
Declaration
[Obsolete("This is kept for easy compatibility with SkillInjector. Use other ways of registering skills if possible to avoid conflicts with other mods")]
public static SkillConfig FromSkillInjector(string identifier, Skills.SkillType uid, string name, string description, float increaseStep, Sprite icon)
Parameters
Type Name Description
System.String identifier Unique identifier of the new skill, ex: "com.jotunn.testmod.testskill"
Skills.SkillType uid "id" from SkillInjector
System.String name "name" from SkillInjector
System.String description "description" from SkillInjector
System.Single increaseStep "increment" from SkillInjector
Sprite icon "icon" from SkillInjector
Returns
Type Description
SkillConfig New SkillConfig object that bridges SkillInjector to Jotunn without losing user progress
Remarks
For any new skills please do not use this method!
| Improve this Doc View Source

ListFromJson(String)

Loads a list of SkillConfigs from a JSON string.
Declaration
public static List<SkillConfig> ListFromJson(string json)
Parameters
Type Name Description
System.String json JSON text
Returns
Type Description
System.Collections.Generic.List<SkillConfig> Loaded list of SkillConfigs
| Improve this Doc View Source

ToSkillDef()

Converts a Jotunn SkillConfig into a Valheim SkillDef.
Declaration
public Skills.SkillDef ToSkillDef()
Returns
Type Description
Skills.SkillDef Valheim SkillDef representation of the SkillConfig
| Improve this Doc View Source

ToString()

Converts the SkillConfig to a printable string.
Declaration
public override string ToString()
Returns
Type Description
System.String String representation of the SkillConfig
Overrides
System.Object.ToString()

Extension Methods

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