SkillInjector
Injects new skills in a simple way for mod authors.
About this mod Author’s original text
Injects skills into Valheim's skill system. Handles adding to the list and both the cheat options (Raise/Reset). Leaves you to handle getting XP and actually applying effects. You will need to pick a unique number for your skill id. I'd stick with numbers > 200.
Usage:
[BepInDependency("com.pipakin.SkillInjectorMod")]
public class MySkillMod: BaseUnityPlugin
{
const int SKILL_TYPE = 299;
...
void Awake()
{
SkillInjector.RegisterNewSkill(SKILL_TYPE, "MyCoolSkill", "Doing Cool Stuff", 1.0f, null, Skills.SkillType.Unarmed);
}...
}
the parameters are:
- id - the numeric id for your skill. MUST BE UNIQUE.
- name - the name of your skill.
- description - the description of your skill.
- increment - the increment to adjust your skill by when increasing.
- icon - the icon for your skill (Unity Sprite). Can be null if you use a template skill to base your icon on.
- template - the skill to copy the icon from if you don't provide an icon.
Known issues:
- Doesn't support multiple languages for the skill name (working on it).
Github link:
All my mod code on GitHub:
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: