Modding/Creating A Custom Class
Jump to navigation
Jump to search
Creating a new class
- In your mod folder, create a new folder "players"
- Copy an existing class from the unpacked players folder into your mod players folder
- Rename the baseclass folder and the baseclass.unit file within to your new class name
- Create a new file in players named <yourclass>.inc
- Copy the baseclass section %defblock to %endblock from unpacked/players/classes.inc into <yourclass>.inc
- Replace the baseclass with yourclass on the first line %defblock
- Edit the id, name and description at the top of the file to your own text (remove the .item.info.tooltip.class. and .menu.class. text).
- Edit the unit field to be players/yourclass/yourclass.unit
- Replace the baseclass with yourclass for every line in the <array name="skills"> section
- Create a new file in player named "modded_classes.sval"
- Paste the following contents into the file, using yourclass name:
- <loader order="1">PlayerClass::LoadMultiple</loader>
- %include "players/yourclass.inc
- <array>
- %block yourclass
- </array>
- Paste the following contents into the file, using yourclass name:
- Create new starting items for your class
- Create the folder structure tweak/items/equipment in your mod folder
- Create a new file equipment_start_yourclass.inc in the equipment folder
- Copy the starting equipment <dict> blocks from unpacked/tweak/items/equipment_start.inc into equipment_start_yourclass.inc
- Edit the id and req-class strings to replace baseclass with yourclass for mainhand and offhand weapons. Do not replace baseclass in strings in modifiers
- Edit the names of the items to a text string (e.g. Dull Sword)
- Set up a loader for your new items
- Create a new file equipment_unique_yourclass.sval in the tweak/items/equipment folder
- Add the following to equipment_unique_yourclass.sval (based on the default equipment_unique.sval file)
- <loader order="-1">Equipment::UniqueEquipment::LoadMultiple</loader>
- <array>
- %include "tweak/items/equipment/equipment_start_yourclass.inc"
- </array>
- Set your class to spawn with their starting items
- Create a new file "starting_items_yourclass.sval" in the players folder
- Add the following to the file
- %include "tweak/loot/defines.inc"
- <loader>Item::LootTable::LoadMultiple</loader>
- <array></array>
- Copy the <dict> block of the class you copied from unpacked/players/starting_items.sval into starting_items_yourclass.sval between the array tags
- Rename the three instances of baseclass to yourclass within the <dict> block
- In yourclass.inc, update the "starting-items" string to use the id start_items_yourclass
- Set the class items for your class (Incomplete Work In Progress)
- Copy the file tweak/items/equipment/equipment_class_baseclass.sval to your tweak/item/equipment folder and rename baseclass to yourclass
- In equipment_class_yourclass.sval:
- Replace all [defaultWeapon]Tags with [yourWeapon]Tags (e.g. DaggerTags becomes ScytheTags) for main and offhand weapons
- Replace the baseclass with yourclass in the two renamed defblocks for Tags at the top of the file
- Replace all req-class">baseclass< with req-class"yourclass<
- Replace all default "weapon_" with "yourweapon_" (e.g. dagger_ becomes scythe_) for main and off hand weapons.
- Replace all ".equipment.baseclass.mainhand." and ".equipment.baseclass.offhand." with "YourWeapon "
- To be continued
- Repair or convert the .tif files Instructions
- Test - you should now be able to start a new save with the mod enabled and select your class
Creating Necromancer Summon Skeleton Skill
This tutorial assumes you have followed the steps above to copy the warlock class into a new mod named necromancer. Line numbers listed are approximations and may no longer be accurate, but should give a rough idea of where in the file to look.
Copy an existing skill to use as a starting point
First, we'll overwrite an existing skill on our custom class with a skill from a different class to use as a starting point to customize.
- Copy and rename the follow file from the unpacked ranger folder into the matching folder of your custom class folder:
- skills/ran_summon_wolf.sval -> skill/nec_summon_skeleton.sval
- Edit the fourth string of skill to be "nec_summon_skeleton.sval" instead of "war_claws.sval"
- Modify the necromancer nec_summon_skeleton.sval to be an apprentice skill
- On line 22, change the tier from adept to apprentice
- On line 23, change the starting level from 0 to 1
- Test - You should now be able to create a new game, select your necromancer mod, and spawn with the ability to summon a ranger wolf at level 1
Set up skeleton files
- Copy wolf.unit and wolf.inc from unpacked/players/ranger/units to necromancer/units and rename them to skeleton.unit and skeleton.inc
- Edit skeleton.unit to change "players/ranger/units/wolf.inc" to "players/necromancer/units/skeleton.inc"
- Update nec_summon_skeleton.sval
- Replace 2 instances of "players/ranger/units/wolf.unit" with "players/necromancer/units/skeleton.unit"
- Replace 5 instances of "wolf-unit" with "skeleton-unit"
- Replace 5 instances of "wolf-hp" with "skeleton-hp"
- Replace 5 instances of "wolf-dmg" with "skeleton-dmg"
- Update skeleton.inc
- Replace wolf-hp with skeleton-hp and wolf-dmg with skeleton-dmg
- Test - Everything should still be working to summon a wolf
Replace the wolf sprite with skeleton sprite
We'll be using unpacked/actors/undead/rotten/rotten_footman as our new sprite. Any references to rotten_footman mean this folder.
- Set up your sprite files
- Create a new folder "skeleton" in your necromancer/units folder
- Copy the three .png and three .tif files from rotten_footman to the new skeleton folder
- Rename these files from "rotten_footman" to "skeleton", leaving the rest after footman in place
- Repair or convert the .tif files Instructions
- Update skeleton.inc Best practice - Create a copy of skeleton.inc and name it skeleton.backup so you can easly revert back if something goes wrong
- Find <scenes start="idle-0 idle-1 idle-2 idle-3 idle-4 idle-5 idle-6 idle-7"> (line 227)
- Right after, replace the values of shadow.unit:18 with that from rotten_footman.inc shadow.unit.:14
- Replace the two circle tags within <collision static="false"> </collision> with those from rotten_footman.inc
- Replace the 8 <scene name="idle#"> sections with those from rotten_footman.inc
- Replace the 8 <scene name="walk#"> sections with section %defblock AnimWalk XCOORD through the 8 walk scenes from rotten_footman.inc
- Replace the 8 <scene name="attack#"> sections with section %defblock AnimMelee XCOORD through the 8 melee scenes from rotten_footman.inc
- Replace all 8 instances of "melee-" with "attack-" to match the original wolf scene names
- Replace all 10 instances of "default.mats:enemy" with "default.mats:player" to match the original wolf settings
- Replace all 10 instances of "rotten_footman/rotten_footman" with "skeleton_skeleton" to point to the tif files in your folder
- Remove <scene name="jump-0"> (lines 457) through the final </scene> (line 625). The jump and howl animations do not exist for the skeleton
Customizing the base skill
These changes will all be made in nec_summon_skeleton.sval
- Change the cooldown
- Cooldown values are shown in milliseconds. Divide by 1000 to get the value in seconds
- Change the int cooldown value (line 31) from 30000 to 5000 to swap it from 30s to 5s
- Increase the base maximum summoned and allow it to scale with skill levels
- On like 52, there's an array block commented out (shown by the tags around it) that contains a dict with ModifySummons, the skeleton.unit, and add-max-num 2
- Copy this block, including the array and dict tags, into each dict of the "upgrades" array (line 129)
- Each of these dicts represents an upgrade of the base skill overwriting the default information. The skill has 5 total levels, so there are 4 upgrades dicts.
- It should go after the </dict> that closes <dict name="binds"> but before the </dict> that closes the overall upgrade
- Change the first two values of add-max-num from 2 to 1
- Decrease the health and damage of the skeletons to compensate for it being an apprentice skill and a higher number of minions summoned
- In the skill dict binds (line 43), change the skeleton-hp and skeleton-dmg values to half their current value
- In each of the upgrade dics (line 130), change the skeleton-hp and skeleton-dmg values to half their current value
- Update the skill information page
- In the name string (line 2), replace ".skills.ranger.adept.spell_2.name" with a new name "Summon Skeletons"
- The existing value here with strings seperated by a . is referencing strings in a language file to allow for translations to other languages. For this tutorial, we assume the new class is only going to support a single langauge and will be writing the strings directly into the files.
- In the description string (line 4), replace ".skills.ranger.adept.spell_2_desc" with a new description to use. "Summon an army of skeletons to fight for and procect you."
- In the description params array:
- Replace the .skill.desc.params.wolf. strings with new strings "Skeleton Damage" "Skeleton Damage Per Level" and "Skeleton Health"
- Replace the values of the damage and health with the new values set above
- In the "description-params" array at the top of the file, add a new line to display the new effect of upgrades on max summons
- <array><s>max-skeletons</s><b>t</b><s>Max Skeletons</s><s>1</s><s>2</s><s>2</s><s>3</s><s>3</s></array>
- In the name string (line 2), replace ".skills.ranger.adept.spell_2.name" with a new name "Summon Skeletons"
Customizing the skill modifiers
In development