Difference between revisions of "My first: Character creation origin"

From Divinity Engine Wiki
Jump to: navigation, search
(Adding The Origins To The Scripting Database)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== Getting started ===
+
= Getting started =
 
The Divinity Engine uses XML style file presets in order to load in the available classes during character creation. <br />
 
The Divinity Engine uses XML style file presets in order to load in the available classes during character creation. <br />
 
This data driven approach allows us to define custom presets in character creation in the blink of an eye.<br />
 
This data driven approach allows us to define custom presets in character creation in the blink of an eye.<br />
 
The first thing you need to know when creating your first character creation origin is the location of the preset files. <br />
 
The first thing you need to know when creating your first character creation origin is the location of the preset files. <br />
You can find those located inside : ''YourMod/CharacterCreation/OriginPresets'' (If the directory doesn't exist, you can just create it yourself). <br />
+
You can find those located inside : ''Data/Mods/{YourModName}/CharacterCreation/OriginPresets'' (If the directory doesn't exist, you can just create it yourself). <br />
 
Once you find or create the directory inside of your mod. <br />
 
Once you find or create the directory inside of your mod. <br />
Here's an already made template file so you can try it out for yourself: [[File:OriginTemplate.zip|none]]<br />
+
Here's an already made template file so you can try it out for yourself: [[:File:OriginTemplate.zip|Origin Template]]<br />
 
Once you put the provided template file in the folder, load up character creation now and cycle through the origins, <br />
 
Once you put the provided template file in the folder, load up character creation now and cycle through the origins, <br />
 
you should be able to see something like the following:
 
you should be able to see something like the following:
 
[[File:CustomOrigin.png|none|600px]]
 
[[File:CustomOrigin.png|none|600px]]
  
=== Preset breakdown ===
+
= Preset breakdown =
 
Now that we've loaded our origin preset let's take a look at the most important properties. <br />
 
Now that we've loaded our origin preset let's take a look at the most important properties. <br />
 
Open up the template file in any text editor. If you're not familiar with XML we suggest to read up on that first.
 
Open up the template file in any text editor. If you're not familiar with XML we suggest to read up on that first.
  
==== Origin Display Name ====
+
=== Origin Display Name ===
 
The name which will be displayed to the user in the UI.<br />
 
The name which will be displayed to the user in the UI.<br />
 
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.
 
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.
  
==== Origin Name ====
+
=== Origin Name ===
 
This is the string which is used by code in order to identify the class with its unique type.<br />  
 
This is the string which is used by code in order to identify the class with its unique type.<br />  
 
Make sure this name is unique,otherwise things might not behave as they should. <br />
 
Make sure this name is unique,otherwise things might not behave as they should. <br />
 
It doesn't need to be the same as the '''Origin Display Name''', but it is nice to be similar for readability's sake.
 
It doesn't need to be the same as the '''Origin Display Name''', but it is nice to be similar for readability's sake.
  
==== Origin Description ====
+
=== Origin Description ===
 
The description of the Origin which will be shown to the user in the UI. <br />
 
The description of the Origin which will be shown to the user in the UI. <br />
 
There's also a Long description, but that one is not currently used anywhere in the game.<br />
 
There's also a Long description, but that one is not currently used anywhere in the game.<br />
 
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.
 
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.
  
==== Character UUID ====
+
=== Character UUID ===
 
This one deserves a bit of explanation. In character creation the system uses the so called dummy characters during the customization stage. <br />
 
This one deserves a bit of explanation. In character creation the system uses the so called dummy characters during the customization stage. <br />
 
After the user has picked their character, the customization is transferred to the character which he's actually going to be playing as. <br />
 
After the user has picked their character, the customization is transferred to the character which he's actually going to be playing as. <br />
Line 36: Line 36:
 
the actual character that the user will start controlling once they are done with character creation. <br />
 
the actual character that the user will start controlling once they are done with character creation. <br />
 
You can create a new template or reuse an already existing one (you can do that in the Editor). <br />
 
You can create a new template or reuse an already existing one (you can do that in the Editor). <br />
The only important thing is that the chosen template is Global. This means its '''isGlobal''' flag must be checked when inspecting it in the editor.
+
The only important thing is that the chosen template is Global. This means its '''isGlobal''' flag must be checked when inspecting it in the editor.<br />
 +
If you want to use an already existing template, make sure it has the ''Hero_'' prefix in its name. Those templates are all created so that they are able to equip armor.
 +
However if you wish to create your own custom template, you can follow this guide - [[My_first:_Character]] . A word of warning - creating your own custom hero character is not an easy process.
  
==== User Can Alter Tags ====
+
=== User Can Alter Tags ===
 
This is just a flag which tells the game if this origin can alter its tags or not. <br />
 
This is just a flag which tells the game if this origin can alter its tags or not. <br />
 
For our predetermined origin stories picking tags is disallowed, but for the custom origin story, you can pick any tags you want.<br />  
 
For our predetermined origin stories picking tags is disallowed, but for the custom origin story, you can pick any tags you want.<br />  
  
==== Skill Set ====
+
=== Skill Set ===
 
This is the skill set which is given specifically to this origin. It is loaded from data and needs to be defined there.<br />  
 
This is the skill set which is given specifically to this origin. It is loaded from data and needs to be defined there.<br />  
 
You can leave this empty, if your origin does not have any special super powers.
 
You can leave this empty, if your origin does not have any special super powers.
  
==== Supported Genders ====
+
=== Supported Genders ===
 
Simply a list of supported genders for the particular origin.
 
Simply a list of supported genders for the particular origin.
 
If your origin story is only made for female characters for example, you can remove the male gender from this list.
 
If your origin story is only made for female characters for example, you can remove the male gender from this list.
  
==== Supported Races ====
+
=== Supported Races ===
 
Simply a list of supported races for the particular origin.
 
Simply a list of supported races for the particular origin.
 
If your origin story only fits a particular race or specific set of races, you can specify that list here.
 
If your origin story only fits a particular race or specific set of races, you can specify that list here.
 +
 +
= Adding The Origins To The Scripting Database =
 +
A lot of the game's logic involving origin characters is handled by our Osiris scripts.<br />
 +
To ensure that your new origin will behave correctly, your character needs to be registered to the existing database of origin characters.<br />
 +
An example of this database registration can be found in the Origins project.<br />
 +
 +
Use the [[Project_browser|Project Browser]] to open the Origins project. There, open the [[Story_editor|Story Editor]].<br />
 +
You'll see the "Start" script (or goal, as we call it) under "DOS2ModWrapper".<br />
 +
Use the same "DB_Origins" logic, as in the following picture, to register your character. The id corresponds to the id you used in your xml file under "Character UUID".<br />
 +
You do not have to add your code line to this specific script. It is better to add it to a scipt of your own, under the DOS2ModWrapper folder, in your own project. That way, your mod stays compatible with other mods that add Origin characters! <br />
 +
 +
[[File:StartGoal.png|none]]

Latest revision as of 09:35, 16 July 2018

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 origin is the location of the preset files.
You can find those located inside : Data/Mods/{YourModName}/CharacterCreation/OriginPresets (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: Origin Template
Once you put the provided template file in the folder, load up character creation now and cycle through the origins,
you should be able to see something like the following:

CustomOrigin.png

Preset breakdown

Now that we've loaded our origin 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 we suggest to read up on that first.

Origin Display Name

The name which will be displayed to the user in the UI.
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.

Origin Name

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 Origin Display Name, but it is nice to be similar for readability's sake.

Origin Description

The description of the Origin which will be shown to the user in the UI.
There's also a Long description, but that one is not currently used anywhere in the game.
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.

Character UUID

This one deserves a bit of explanation. In character creation the system uses the so called dummy characters during the customization stage.
After the user has picked their character, the customization is transferred to the character which he's actually going to be playing as.
The flow is designed this way to accommodate for the scripting needs of the game.

The Character UUID field specifies the template UUID which the customization will be transferred to -
the actual character that the user will start controlling once they are done with character creation.
You can create a new template or reuse an already existing one (you can do that in the Editor).
The only important thing is that the chosen template is Global. This means its isGlobal flag must be checked when inspecting it in the editor.
If you want to use an already existing template, make sure it has the Hero_ prefix in its name. Those templates are all created so that they are able to equip armor. However if you wish to create your own custom template, you can follow this guide - My_first:_Character . A word of warning - creating your own custom hero character is not an easy process.

User Can Alter Tags

This is just a flag which tells the game if this origin can alter its tags or not.
For our predetermined origin stories picking tags is disallowed, but for the custom origin story, you can pick any tags you want.

Skill Set

This is the skill set which is given specifically to this origin. It is loaded from data and needs to be defined there.
You can leave this empty, if your origin does not have any special super powers.

Supported Genders

Simply a list of supported genders for the particular origin. If your origin story is only made for female characters for example, you can remove the male gender from this list.

Supported Races

Simply a list of supported races for the particular origin. If your origin story only fits a particular race or specific set of races, you can specify that list here.

Adding The Origins To The Scripting Database

A lot of the game's logic involving origin characters is handled by our Osiris scripts.
To ensure that your new origin will behave correctly, your character needs to be registered to the existing database of origin characters.
An example of this database registration can be found in the Origins project.

Use the Project Browser to open the Origins project. There, open the Story Editor.
You'll see the "Start" script (or goal, as we call it) under "DOS2ModWrapper".
Use the same "DB_Origins" logic, as in the following picture, to register your character. The id corresponds to the id you used in your xml file under "Character UUID".
You do not have to add your code line to this specific script. It is better to add it to a scipt of your own, under the DOS2ModWrapper folder, in your own project. That way, your mod stays compatible with other mods that add Origin characters!

StartGoal.png