Chapter 4: Adding New Skills
Defining a new skill is a fairly simple process. First, in Engine Hacks/SkillSystem/skill_definitions.event
, define your new skill’s ID as something like #define MySkillID 69 //nice
. This ID should be a unique value between 1 and 254; skill ID 0 is always treated as true and skill ID 255 is always treated as false, so defining a skill as 0 applies its effect globally and defining a skill as 255 effectively disables it. Next, in Text/skilldesc_text.txt
, add an entry for your new skill. It should look something like:
## SD_MySkill
My Skill: Has an effect.[X]
Then, in Engine Hacks/SkillSystem/skill_descriptions.event
, add SkillDescription(MySkillID,SD_MySkill)
to the end of the list. This will set the description text to the given skill’s ID on the skill description table. The last step is giving your skill an icon. In Engine Hacks/SkillSystem/SkillIcons
, place your skill icon image. You then want to open Event Assembler/Tools
, and drag & drop the skill icon image onto Png2Dmp.exe
. This will generate a .dmp
version of the image. Lastly, Engine Hacks/SkillSystem/skill_icons.event
before the final ORG
, add for your skill its icon. This should look something like:
ORG SkillIcon(MySkillID)
#incbin "SkillIcons/MySkill.dmp"
You now have a skill that will show up properly in-game and have the correct description; however, just doing this does not give the skill any actual effect. To give your skill an effect, you’ll need to write a function that checks if a unit has the skill and applies the effect if so. The easiest way to do this is find a skill that applies a similar effect to what you want your skill to do, copy its source, edit the copy to fit your needs, assemble it, and install it to the same place. Note that to assemble anything, you will need to install devkitPro; widely used assemble scripts included with the skill system expect this to be installed to the default directory, C:/devkitPro
. Some skills may require that you copy lyn.exe
from Event Assembler/Tools
to C:/devkitPro
as well. For more information on writing assembly, see Teq’s assembly guide.
The majority of skills apply their effects during pre-battle calculations, and there is a calculation loop specifically for this . You can find it in Engine Hacks/Necessary/CalcLoops/PreBattleCalcLoop/PreBattleCalcLoop.event
. This file contains the list of pointers to functions that get run every time battle stats are calculated. There is a high likelihood any skill that affects battle stats is installed to this area. To install a new skill to this area, just add the label at which the function exists to the POIN
s as directed by in-file comments.
If the skill you are mimicking does not install to a loop of some kind, you likely will need to edit the source of the skill directly to add your new skill to it. A number of skills are already implemented this way; all HP restoration skills, as an example. If the skill you want to make does not affect anything already touched by a skill, you will need to find the location it should hook to and hook it there. Examples of skills that do this largely live in Engine Hacks/SkillSystem/Skills/StandaloneSkills
.