About this mod
Provides a modding framework for adding new character skills to the game.
- Requirements
- Permissions and credits
- Changelogs
- Donations
It doesn't do anything by itself, but is a requirement for custom skill mods that use it. An example is:
Movement Speed Skill
Creating Custom Skills
Creating custom skills requires basic knowledge of C# and whatever method you use to have your custom skill modify the game code behaviour.
Modifying game behaviour because of your skill must handled by your custom skill mod. This mod does the following:
- Shows your skill in the specified category in UI Character
- Handles skill increasing
- Saves skills and loads skills from saves
- Lets you retrieve your skill's value for a given character
All you have to do to register your skill is set this mod as a dependency for your project, then in Start():
private void Start()
{
SkillFramework.SkillAPI.AddSkill(skillId, skillName, skillDescription, skillCategory, skillIcon, maxPoints, reqLevel, isActive);
}
skillId must be unique
skillName and skillDescription must be List<string> with four entries for English, Chinese, Russian, and Japanese.
skillCategory must be the zero-indexed integer of the skill category (i.e. the four skill categories).
skillIcon is a Texture2D that you load from file with something like
Texture2D skillIcon = new Texture2D(1, 1);
if(File.Exists(Path.Combine(assetPath, "icon.png")))
skillIcon.LoadImage(File.ReadAllBytes(Path.Combine(assetPath,"icon.png")));
maxPoints is a positive integer, default skills have a max of 5.
reqLevel - I'm not sure if this even does anything yet.
isActive - for the UI to tell the user whether this is an active or passive skill (has no effect on gameplay).
When you want your skill to do something, you get a character's skill level by calling
SkillFramework.SkillAPI.GetCharacterSkillLevel(skillId, __instance.name)
For an example, you can look at the Movement Speed Skill code.
Config
A config file BepInEx/config/aedenthorn.SkillFramework.cfg is created after running the game once with this mod.
You can adjust the config values by editing this file using a text editor or using the Configuration Manager mod.
Technical
This mod requires BepInEx to be installed for SWPT. Detailed instructions on installing BepInEx are here.
If you are on Windows, you will need the x64 or x86 version based on your architecture, found here:
https://github.com/BepInEx/BepInEx/releases
Unpack the zip file, and place the contents in the game's root folder (beside the game's .exe file).
To install this mod, place the contents of its zip file in the BepInEx/plugins folder (create it if the folder doesn't exist).
Code is at https://github.com/aedenthorn/SWPTMods.
If you want to complain or ask for help or help me test my mods, you can visit my Discord server.