My first: Character creation class

From Divinity Engine Wiki
Jump to: navigation, search

Getting started

The Divinity Engine uses XML style file presets in order to load in the available classes during character creation.
This data driven approach allows us to define custom presets in character creation in the blink of an eye.
The first thing you need to know when creating your first character creation class is the location of the preset files.
You can find those located inside : Data/Mods/{YourModName}/CharacterCreation/ClassPresets (If the directory doesn't exist, you can just create it yourself).
Once you find or create the directory inside of your mod.
Here's an already made template file so you can try it out for yourself: Class Template
Once you put the provided template file in the folder, load up character creation now and cycle through the presets,
you should be able to see something like the following:

CustomClass.png

Preset breakdown

Now that we've loaded our class preset let's take a look at the most important properties.
Open up the template file in any text editor. If you're not familiar with XML I suggest you read up on that first.

Class Name

The name of the class which is displayed to the user.
The handle property is set to ls::TranslatedStringRepository::s_HandleUnknown by default in order to signal that this string has not been localized for other languages yet.

Class Type

This is the string which is used by code in order to identify the class with its unique type.
Make sure this name is unique,otherwise things might not behave as they should.
It doesn't need to be the same as the Class Name, but it is nice to be similar for readability's sake.

Skill Set

This is the skill set name which this preset is assigned by default (the skill set must be defined in the data). You will have to define your own set in data first before you can use it. You will have to use the stats editor to do that. The principle of creating a skill set is the same as with creating a single custom skill. You can follow this tutorial: Skill_creation, but instead of creating a skill, create a skill set. Just filling a random name won't do the trick. The following skill sets are already defined in data and can be used as is:
Class_Battlemage
Class_Cleric
Class_Conjurer
Class_Enchanter
Class_Fighter
Class_Inquisitor
Class_Knight
..(+ all the rest of the default classes)

Starting Points

There are four properties under this category : Talents, Attributes, Combat and Civil ability points.
Tweaking these will make your class start with a different amount of points available to spend.
Important: Make sure you don't add less available points than the amount of talents/abilities/attributes.

Equipment Properties

As you can see the equipment properties are a bit different. They are a list, which specifies the equipment set that each race will wear during the preview in character creation.
There are two equipment sets. We use one for the preview and the other when starting the game.
Depending on your use case, you can fill in the same equipment set for both.
Important: If you add a custom race, you'll need to fill it in this list as well

Ability, Talent and Attribute Changes

Remember the starting points we defined earlier? We need to tell the game how to distribute those points by default.
That's exactly what these properties define.
Important: Make sure you don't add more abilities/talents/attributes than you have to spend or the game won't like it and won't allocate them.