<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.larian.game/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin</id>
	<title>Divinity Engine Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.larian.game/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevin"/>
	<link rel="alternate" type="text/html" href="https://docs.larian.game/Special:Contributions/Kevin"/>
	<updated>2026-04-15T03:13:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:Larian_Maya_Tools.zip&amp;diff=6478</id>
		<title>File:Larian Maya Tools.zip</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:Larian_Maya_Tools.zip&amp;diff=6478"/>
		<updated>2018-11-30T14:04:54Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Setup:_Maya_Exporter&amp;diff=6477</id>
		<title>Setup: Maya Exporter</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Setup:_Maya_Exporter&amp;diff=6477"/>
		<updated>2018-11-30T14:04:24Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Warningred.png|32px]] These scripts were written for Maya &amp;lt;b&amp;gt;2015&amp;lt;/b&amp;gt; on Windows.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The files should be present in the editor data ''~DivinityEngineDataPath~\Data\Editor\Tools\Maya\''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
All the files you need you'll find in ''~DivinityEngineDataPath~\Data\Editor\Tools\Maya\''&amp;lt;br /&amp;gt;&lt;br /&gt;
If they don't appear to be available there, you can also download the required files [[:File:Larian_Maya_Tools.zip|here]]&lt;br /&gt;
&lt;br /&gt;
To have the granny plugin working in Maya 2015 copy ''larian_maya2015_x64.mll '' to your maya plugin folder ''~Maya2015InstallFolder~\Maya2015\bin\plug-ins''&amp;lt;br /&amp;gt;&lt;br /&gt;
To have the scripts working in Maya 2015 copy the ''userSetup.py'' and ''LarianStudiosModTools'' folder into ''~YourDocuments~''\maya\scripts &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
When starting up Maya the userSetup.py should automaticly create a Larian_Mod_Tools shelf for you with the relevant scripts saved into buttons.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Once you have launched Maya with this userSetup for the first time use the modify path script (ModP Button on the shelf) to set up your divinity engine data path for the exporter. This info will be saved in you maya scripts folder.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
===For advanced users===&lt;br /&gt;
If you already have a python userSetup file taking care of several preferences you can add this method and add a call to it during your start up sequence:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def scriptRun():&lt;br /&gt;
    mainPath = os.environ['MAYA_APP_DIR']+ &amp;quot;/scripts/LarianStudiosModTools/&amp;quot; #Best guess for maya path install &lt;br /&gt;
    #Load toolbar creation script&lt;br /&gt;
    setupScript = imp.load_source('secondary', mainPath+&amp;quot;LarianToolbarSetup.py&amp;quot;)&lt;br /&gt;
    setupScript.run() &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Then you only need to copy the ''LarianStudiosModTools'' folder&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|For more information on how to use the exporter tools, look here: [[Modding:_Maya_Exporter]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Light_probes&amp;diff=6370</id>
		<title>Light probes</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Light_probes&amp;diff=6370"/>
		<updated>2018-09-13T16:13:33Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Best Practice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
= General =&lt;br /&gt;
&lt;br /&gt;
Light probes are the Larian Engine's system for indirect lighting and reflections. A pre-calculated approximation to global illumination.&amp;lt;br /&amp;gt;&lt;br /&gt;
In short, a light probe is an object you place in the level. It looks at the surrounding lighting and objects and uses that information to calculate realistic indirect lighting.&amp;lt;br /&amp;gt;&lt;br /&gt;
This includes light bouncing off of objects, causing colors to carry over to nearby objects (this effect is called ''color bleeding''). &amp;lt;br /&amp;gt;&lt;br /&gt;
It also provides accurate reflections of surrounding objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Probe Types =&lt;br /&gt;
&lt;br /&gt;
There are 2 types of light probes, used for different parts of the overall lighting: distant and local light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Distant ===&lt;br /&gt;
&lt;br /&gt;
Distant probes are used to account for far away lighting information: the sun and sky.&amp;lt;br /&amp;gt;&lt;br /&gt;
It uses the information of the surrounding atmosphere to apply an approximation of sun and sky light bouncing and color bleeding to everything in that atmosphere.&amp;lt;br /&amp;gt;&lt;br /&gt;
Since the probe contains atmosphere information, it applies to everything in that atmosphere. So in editor terms, you only need one distant probe per atmosphere trigger.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|For more information on atmospheres, look here: [[Atmosphere panel]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|More information on atmosphere triggers can be found here: [[Triggers]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Local ===&lt;br /&gt;
&lt;br /&gt;
Local probes are used to simulate color bleeding and reflections related to nearby lights and objects.&amp;lt;br /&amp;gt;&lt;br /&gt;
Local probes only gather information within a defined area around them and thus, only apply to objects in that same area.&amp;lt;br /&amp;gt;&lt;br /&gt;
Contrary to distant probes, you can place as many local probes as you want. Even probes inside other probe areas are allowed.&amp;lt;br /&amp;gt;&lt;br /&gt;
The lighting of the smallest probes always gets priority over the lighting of a larger probe that covers the same area.&lt;br /&gt;
With local probes, you fine-tune illumination and reflections where the distant probe, or a larger local probe proves to be insufficient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Shapes =&lt;br /&gt;
&lt;br /&gt;
Probe influence areas are approximated by 2 shape types: spheres and boxes.&amp;lt;br /&amp;gt;&lt;br /&gt;
This only applies to local probes. Distant probes capture all information visible, without being limited within a specific area.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Lighting Types =&lt;br /&gt;
&lt;br /&gt;
Probes can capture two types of lighting. &amp;lt;br /&amp;gt;&lt;br /&gt;
Diffuse light is of a very low resolution and captures the general color of the surroundings. &amp;lt;br /&amp;gt;&lt;br /&gt;
The performance cost of this light type is very low and produces what we know as 'bounce light'. &amp;lt;br /&amp;gt;&lt;br /&gt;
Specular lighting is of a high resolution and is used to produce reflections on smooth surfaces and metals. &amp;lt;br /&amp;gt;&lt;br /&gt;
This lighting is far more expensive. It is also most notable on smooth surfaces and metals. &amp;lt;br /&amp;gt;&lt;br /&gt;
These materials accurately reflect their surrounding, thus an accurate reflection is necessary. In other situations, a more general capture might suffice.&lt;br /&gt;
&lt;br /&gt;
Given how dynamic a world can be (characters with metal armors running around), generally you'll want to have both diffuse and specular capture enabled on a probe. &amp;lt;br /&amp;gt;&lt;br /&gt;
But because mirror-like surfaces are very rare (metal armor is not a mirror), for performance it is beneficial to use less specular probes. &amp;lt;br /&amp;gt;&lt;br /&gt;
Don't worry too much though. Performance impact will only be noticeable when having multiple tens of probes visible on screen at the same time. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Rule of thumb ===&lt;br /&gt;
Capture both. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you start having a multitude of probes in one screen, look to reducing performance impact by generalizing the specular probe.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sidenote ===&lt;br /&gt;
Don't tweak too much. There might be intensity scaling on probes, but working with several probes and/or splitting diffuse and specular probes can have unwanted side effects. &amp;lt;br /&amp;gt;&lt;br /&gt;
Start with an intensity of 1, and slowly adjust situations. Again from big to small.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Atmospheres =&lt;br /&gt;
&lt;br /&gt;
Atmospheres (sun direction, sky color) naturally influence the lighting and probes account for this. &amp;lt;br /&amp;gt;&lt;br /&gt;
Atmospheres are defined by atmosphere triggers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier, always place one distant probe per atmosphere trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
Local probes will gather lighting information from the atmosphere trigger they are in.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To account for atmosphere changes (day to night), which can be achieved through scripting, atmosphere triggers can be assigned multiple atmospheres (through atmosphere resources).&amp;lt;br /&amp;gt;&lt;br /&gt;
Probes will gather information from every atmosphere assigned to the atmosphere trigger they are in.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Information on atmosphere resources can be found here: [[Resources]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|For more information on atmosphere triggers, look here: [[Triggers]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Best Practice =&lt;br /&gt;
&lt;br /&gt;
Light probes make a scene's lighting feel more natural.&amp;lt;br /&amp;gt;&lt;br /&gt;
To optimally make use of light probes, try to follow these guidelines:&lt;br /&gt;
&lt;br /&gt;
* Always '''1 distant probe''' per atmosphere. Always place one distant probe to capture far off lighting and apply it to everything in that atmosphere. This is your base layer of natural lighting.&lt;br /&gt;
* Place '''distant probes low to the ground'''. This way, they are more heavily influences by the ground color, making color bleeding more apparent. &lt;br /&gt;
* '''Follow geometry''' when placing local probes. Try to align the probe's influence area as closely as possible to its surrounding. F.e. shape a probe like the room the probe is in.&lt;br /&gt;
* '''Start big'''. Too many probes can be bad for performance. Start with the distant probe and large/rough local probes. Only place a smaller probe where necessary.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6368</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6368"/>
		<updated>2018-09-12T16:09:16Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Resource Path Fixer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resources ===&lt;br /&gt;
&lt;br /&gt;
After import, resources can suffer from outdated Source File path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Imported Texture Atlases ===&lt;br /&gt;
&lt;br /&gt;
Texture atlases will also suffer from outdated paths. Simply resave your custom texture atlases in the Texture Atlas editor to make them work again in your DE project.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6367</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6367"/>
		<updated>2018-09-12T16:05:23Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Resource Path Fixer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resource Path Fixer ===&lt;br /&gt;
&lt;br /&gt;
During the initial release, imported projects did not update the Source File properties of their resources correctly. This could potentially cause crashes and made various resource types, texture atlases and stats unusable.&lt;br /&gt;
By now, iporting has been improved. And texture atlases can be fixed by resaving them.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After import, resources can suffer from outdated path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6366</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6366"/>
		<updated>2018-09-12T15:06:08Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Resource Path Fixer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resource Path Fixer ===&lt;br /&gt;
&lt;br /&gt;
During the initial release, imported projects did not update the Source File properties of their resources correctly. This could potentially cause crashes and made various resource types, texture atlases and stats unusable.&lt;br /&gt;
By now, importing classic projects has been improved, solving these issues automatically. And texture atlases can be fixed by resaving them.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously imported projects, as well as manually copied resources can still suffer from outdated path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|1200px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6365</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6365"/>
		<updated>2018-09-12T15:05:53Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Resource Path Fixer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resource Path Fixer ===&lt;br /&gt;
&lt;br /&gt;
During the initial release, imported projects did not update the Source File properties of their resources correctly. This could potentially cause crashes and made various resource types, texture atlases and stats unusable.&lt;br /&gt;
By now, importing classic projects has been improved, solving these issues automatically. And texture atlases can be fixed by resaving them.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously imported projects, as well as manually copied resources can still suffer from outdated path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6364</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6364"/>
		<updated>2018-09-12T15:05:37Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Welcome, brave Sourcerer! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resource Path Fixer ===&lt;br /&gt;
&lt;br /&gt;
During the initial release, imported projects did not update the Source File properties of their resources correctly. This could potentially cause crashes and made various resource types, texture atlases and stats unusable.&lt;br /&gt;
By now, importing classic projects has been improved, solving these issues automatically. And texture atlases can be fixed by resaving them.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously imported projects, as well as manually copied resources can still suffer from outdated path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|800px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|800px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:PathFixer.PNG&amp;diff=6363</id>
		<title>File:PathFixer.PNG</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:PathFixer.PNG&amp;diff=6363"/>
		<updated>2018-09-12T15:05:23Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:PathFixerLocation.PNG&amp;diff=6362</id>
		<title>File:PathFixerLocation.PNG</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:PathFixerLocation.PNG&amp;diff=6362"/>
		<updated>2018-09-12T15:05:11Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6361</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6361"/>
		<updated>2018-09-12T15:04:57Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Custom Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
{{warning|We are currently working hard to fix the following issues on importing classic projects. We advise to wait for a fix if you experience any of them:}} [http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147 Explaining about issues can be found on the forum]&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
=== Imported Resource Path Fixer ===&lt;br /&gt;
&lt;br /&gt;
During the initial release, imported projects did not update the Source File properties of their resources correctly. This could potentially cause crashes and made various resource types, texture atlases and stats unusable.&lt;br /&gt;
By now, importing classic projects has been improved, solving these issues automatically. And texture atlases can be fixed by resaving them.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previously imported projects, as well as manually copied resources can still suffer from outdated path properties. To that end the Path Fixer has been added to the [[Content browser]]:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixerLocation.PNG|Path Fixer Location|800px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opening the path fixer, you'll get an overview of all resources with outdated file paths and the suggested correction. For each file the correction can be toggled on/off. When happy with the proposed correction, press Ok on the bottom of the window and all files will be updated and resaved. Be aware that this may take some time, depending on the amount of resources.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:PathFixer.PNG|Path Fixer Location|800px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6355</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6355"/>
		<updated>2018-09-07T21:57:22Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Welcome, brave Sourcerer! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
{{warning|We are currently working hard to fix the following issues on importing classic projects. We advise to wait for a fix if you experience any of them:}} [http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147 Explaining about issues can be found on the forum]&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6354</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6354"/>
		<updated>2018-09-07T21:56:39Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Welcome, brave Sourcerer! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
{{warning|We are currently working hard to fix the following issues on importing classic projects. We advise to wait for a fix if you experience any of them:}} [http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147 forum link]&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6353</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6353"/>
		<updated>2018-09-07T21:56:17Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
{{warning|We are currently working hard to fix the following issues on importing classic projects. We advise to wait for a fix if you experience any of them:}} [http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147 forum link]&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6352</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6352"/>
		<updated>2018-09-07T21:55:49Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
{{warning|We are currently working hard to fix the following issues on importing classic projects. We advise to wait for a fix if you experience any of them http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147}}&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6351</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6351"/>
		<updated>2018-09-07T21:52:05Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{{warning | We are currently working hard to fix the following issues on importing classic projects. We advice to wait for a fix if you experience any of them: http://larian.com/forums/ubbthreads.php?ubb=showflat&amp;amp;Number=649147&amp;amp;#Post649147}}&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6350</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6350"/>
		<updated>2018-09-07T19:03:54Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Materials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. If they are pink, you need to convert them. But that can be done easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6348</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6348"/>
		<updated>2018-09-04T12:51:01Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Stats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | As before, the Engine does not support manually editing the stats .txt files. Only stats made in the Engine's Stats Editor can be converted. }}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6347</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6347"/>
		<updated>2018-09-04T12:12:24Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Stats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6346</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6346"/>
		<updated>2018-09-04T12:09:08Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Imported Stats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning | Stats are imported from the Stats Editor files and are assume to be up to date. Make sure you saved your stats with the latest Classic Engine version before importing! As before, the Engine does not support manual changes to the .txt stats files!}}&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Sound Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Story Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_GLO_FirstLevelAfterCharacterCreation(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6339</id>
		<title>My first: Adventure</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6339"/>
		<updated>2018-09-03T14:24:09Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Necessary scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For creating and publishing an adventure in The Divinity Engine 2, please read [[Working with projects]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Below, we detail any extra requirements to get an adventure working in-game and how to check if it works as intended.&lt;br /&gt;
&lt;br /&gt;
== Necessary scripting ==&lt;br /&gt;
&lt;br /&gt;
{{warning| This is no longer required for the Definitive Edition as Character Creation is unified for all mods. We refer to [[https://docs.larian.game/Definitive_Edition|The Definitive Edition Guide]] for more information on Unified Character Creation}}&lt;br /&gt;
&lt;br /&gt;
When you want your adventure to start off with the character creation screen, you need to initiate this with story scripting.&amp;lt;br /&amp;gt;&lt;br /&gt;
We recommend taking a look at the following scripts in Origins and Game_Master mods, to get a feel for how it works:&lt;br /&gt;
* ''GLOBAL_CharacterCreation'' and ''FortJoy_CharacterCreation'' in Origins&lt;br /&gt;
* ''GLO_GameMasterCharacterCreation'' in Game_Master&lt;br /&gt;
&lt;br /&gt;
You'll quickly notice that these can become quite complex. But don't fret because we've got you covered!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== When loading no data ===&lt;br /&gt;
This basic version includes everything you need to get your story adventure up and running: [[:File:CharacterCreationTemplate.zip|Character Creation Template]]&amp;lt;br /&amp;gt;&lt;br /&gt;
You'll notice that after character creation, you'll get teleported to the [[Sandbox]]. This can be changed by editing the following lines:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: CCTeleport.png | none]]&lt;br /&gt;
&amp;lt;sub&amp;gt; Lines that define the teleport location after Character Creation. In the [[Story editor|Story Editor]], these lines are in the INIT section &amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== When loading data from one of the existing modes (Story/Arena/GM) ===&lt;br /&gt;
Existing modes require specific cases to be handled. Story for example has multiple origin characters.&lt;br /&gt;
Hence, instead of using the clean template, we suggest using (and if necessary adapting) the existing Character Creation scripts that are already part of the mode's data:&lt;br /&gt;
* &amp;lt;b&amp;gt;Story&amp;lt;/b&amp;gt;: ''FortJoy_CharacterCreation''&lt;br /&gt;
* &amp;lt;b&amp;gt;Arena&amp;lt;/b&amp;gt;: ''__StartArena''&lt;br /&gt;
* &amp;lt;b&amp;gt;Game Master&amp;lt;/b&amp;gt;: ''GLO_GameMasterCharacterCreation''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== My adventure in-game ==&lt;br /&gt;
&lt;br /&gt;
External mods (f.e. from Steam Workshop) are always placed under ''&amp;quot;Documents/Larian Studios/Divinity Original Sin 2/Mods&amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
But your own mods are magically loaded as well! So close the Divinity Engine 2, launch the game and check it out!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Menu.png|800px]] [[File:MenuAdventures.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To play your adventure, select it in the appropriate story or game master drop down menu. (The story drop down is only available when at least one custom adventure was loaded)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color='red'&amp;gt;ATTENTION&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;: If your adventure has no valid story, it will not be visible in these drop down menus. So always make sure you build the story in the toolset before testing.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|More information on the story editor can be found here: [[Story editor]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Story:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuStory.png|800px]] [[File:StoryAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Game Master Mode:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuGM.png|800px]] [[File:MenuGMPrepare.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MenuGMSettings.png|800px]] [[File:MenuGMAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's it! Now it's time to go on an adventure!&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6338</id>
		<title>My first: Adventure</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6338"/>
		<updated>2018-09-03T14:23:49Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Necessary scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For creating and publishing an adventure in The Divinity Engine 2, please read [[Working with projects]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Below, we detail any extra requirements to get an adventure working in-game and how to check if it works as intended.&lt;br /&gt;
&lt;br /&gt;
== Necessary scripting ==&lt;br /&gt;
&lt;br /&gt;
{{warning| This is no longer required for the Definitive Edition as Character Creation is unified for all mods. We refer to [[https://docs.larian.game/Definitive_Edition|The Definitive Edition Guide]] for more information on Unified Character Creation]]&lt;br /&gt;
&lt;br /&gt;
When you want your adventure to start off with the character creation screen, you need to initiate this with story scripting.&amp;lt;br /&amp;gt;&lt;br /&gt;
We recommend taking a look at the following scripts in Origins and Game_Master mods, to get a feel for how it works:&lt;br /&gt;
* ''GLOBAL_CharacterCreation'' and ''FortJoy_CharacterCreation'' in Origins&lt;br /&gt;
* ''GLO_GameMasterCharacterCreation'' in Game_Master&lt;br /&gt;
&lt;br /&gt;
You'll quickly notice that these can become quite complex. But don't fret because we've got you covered!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== When loading no data ===&lt;br /&gt;
This basic version includes everything you need to get your story adventure up and running: [[:File:CharacterCreationTemplate.zip|Character Creation Template]]&amp;lt;br /&amp;gt;&lt;br /&gt;
You'll notice that after character creation, you'll get teleported to the [[Sandbox]]. This can be changed by editing the following lines:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: CCTeleport.png | none]]&lt;br /&gt;
&amp;lt;sub&amp;gt; Lines that define the teleport location after Character Creation. In the [[Story editor|Story Editor]], these lines are in the INIT section &amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== When loading data from one of the existing modes (Story/Arena/GM) ===&lt;br /&gt;
Existing modes require specific cases to be handled. Story for example has multiple origin characters.&lt;br /&gt;
Hence, instead of using the clean template, we suggest using (and if necessary adapting) the existing Character Creation scripts that are already part of the mode's data:&lt;br /&gt;
* &amp;lt;b&amp;gt;Story&amp;lt;/b&amp;gt;: ''FortJoy_CharacterCreation''&lt;br /&gt;
* &amp;lt;b&amp;gt;Arena&amp;lt;/b&amp;gt;: ''__StartArena''&lt;br /&gt;
* &amp;lt;b&amp;gt;Game Master&amp;lt;/b&amp;gt;: ''GLO_GameMasterCharacterCreation''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== My adventure in-game ==&lt;br /&gt;
&lt;br /&gt;
External mods (f.e. from Steam Workshop) are always placed under ''&amp;quot;Documents/Larian Studios/Divinity Original Sin 2/Mods&amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
But your own mods are magically loaded as well! So close the Divinity Engine 2, launch the game and check it out!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Menu.png|800px]] [[File:MenuAdventures.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To play your adventure, select it in the appropriate story or game master drop down menu. (The story drop down is only available when at least one custom adventure was loaded)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color='red'&amp;gt;ATTENTION&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;: If your adventure has no valid story, it will not be visible in these drop down menus. So always make sure you build the story in the toolset before testing.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|More information on the story editor can be found here: [[Story editor]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Story:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuStory.png|800px]] [[File:StoryAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Game Master Mode:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuGM.png|800px]] [[File:MenuGMPrepare.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MenuGMSettings.png|800px]] [[File:MenuGMAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's it! Now it's time to go on an adventure!&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6337</id>
		<title>My first: Adventure</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=My_first:_Adventure&amp;diff=6337"/>
		<updated>2018-09-03T14:23:33Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Necessary scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For creating and publishing an adventure in The Divinity Engine 2, please read [[Working with projects]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Below, we detail any extra requirements to get an adventure working in-game and how to check if it works as intended.&lt;br /&gt;
&lt;br /&gt;
== Necessary scripting ==&lt;br /&gt;
&lt;br /&gt;
{{warning|This is no longer required for the Definitive Edition as Character Creation is unified for all mods. We refer to [[https://docs.larian.game/Definitive_Edition|The Definitive Edition Guide]] for more information on Unified Character Creation]]&lt;br /&gt;
&lt;br /&gt;
When you want your adventure to start off with the character creation screen, you need to initiate this with story scripting.&amp;lt;br /&amp;gt;&lt;br /&gt;
We recommend taking a look at the following scripts in Origins and Game_Master mods, to get a feel for how it works:&lt;br /&gt;
* ''GLOBAL_CharacterCreation'' and ''FortJoy_CharacterCreation'' in Origins&lt;br /&gt;
* ''GLO_GameMasterCharacterCreation'' in Game_Master&lt;br /&gt;
&lt;br /&gt;
You'll quickly notice that these can become quite complex. But don't fret because we've got you covered!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== When loading no data ===&lt;br /&gt;
This basic version includes everything you need to get your story adventure up and running: [[:File:CharacterCreationTemplate.zip|Character Creation Template]]&amp;lt;br /&amp;gt;&lt;br /&gt;
You'll notice that after character creation, you'll get teleported to the [[Sandbox]]. This can be changed by editing the following lines:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: CCTeleport.png | none]]&lt;br /&gt;
&amp;lt;sub&amp;gt; Lines that define the teleport location after Character Creation. In the [[Story editor|Story Editor]], these lines are in the INIT section &amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== When loading data from one of the existing modes (Story/Arena/GM) ===&lt;br /&gt;
Existing modes require specific cases to be handled. Story for example has multiple origin characters.&lt;br /&gt;
Hence, instead of using the clean template, we suggest using (and if necessary adapting) the existing Character Creation scripts that are already part of the mode's data:&lt;br /&gt;
* &amp;lt;b&amp;gt;Story&amp;lt;/b&amp;gt;: ''FortJoy_CharacterCreation''&lt;br /&gt;
* &amp;lt;b&amp;gt;Arena&amp;lt;/b&amp;gt;: ''__StartArena''&lt;br /&gt;
* &amp;lt;b&amp;gt;Game Master&amp;lt;/b&amp;gt;: ''GLO_GameMasterCharacterCreation''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== My adventure in-game ==&lt;br /&gt;
&lt;br /&gt;
External mods (f.e. from Steam Workshop) are always placed under ''&amp;quot;Documents/Larian Studios/Divinity Original Sin 2/Mods&amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
But your own mods are magically loaded as well! So close the Divinity Engine 2, launch the game and check it out!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Menu.png|800px]] [[File:MenuAdventures.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To play your adventure, select it in the appropriate story or game master drop down menu. (The story drop down is only available when at least one custom adventure was loaded)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color='red'&amp;gt;ATTENTION&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;: If your adventure has no valid story, it will not be visible in these drop down menus. So always make sure you build the story in the toolset before testing.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|More information on the story editor can be found here: [[Story editor]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Story:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuStory.png|800px]] [[File:StoryAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Game Master Mode:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:MenuGM.png|800px]] [[File:MenuGMPrepare.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MenuGMSettings.png|800px]] [[File:MenuGMAdventure.png|800px]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's it! Now it's time to go on an adventure!&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6328</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6328"/>
		<updated>2018-08-29T15:52:31Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* GM Story Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
{{warning|GM Story scripting and GM add-on support in general (when playing the campaign) will be brought live on the first patch after release. }}&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined in story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Privacy_policy&amp;diff=6327</id>
		<title>Divinity Engine Wiki:Privacy policy</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Privacy_policy&amp;diff=6327"/>
		<updated>2018-08-29T08:34:34Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Protected &amp;quot;Divinity Engine Wiki:Privacy policy&amp;quot; ([Edit=⧼protect-level-larianeditonly⧽] (indefinite) [Move=⧼protect-level-larianeditonly⧽] (indefinite))&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki site uses Larian Studios' Privacy Policy. See https://larian.com/privacy for more information.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Copyrights&amp;diff=6326</id>
		<title>Divinity Engine Wiki:Copyrights</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Copyrights&amp;diff=6326"/>
		<updated>2018-08-29T08:34:20Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Protected &amp;quot;Divinity Engine Wiki:Copyrights&amp;quot; ([Edit=⧼protect-level-larianeditonly⧽] (indefinite) [Move=⧼protect-level-larianeditonly⧽] (indefinite))&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content posted to this wiki by anyone on or after 28 August 2018, and also textual content posted to this wiki before that date by Larian Studios Games Ltd employees, is licensed under the Creative Commons CC BY-NC-SA 4.0 license, except where stated otherwise. Community content posted before that date falls under the contribution guidelines outlined on the [[Community_page_submission|Community Submissions Page]].&lt;br /&gt;
&lt;br /&gt;
Larian Studios, Divinity, all other Larian Studios Games Ltd. product names, and their respective logos are trademarks of Larian Studios Ltd. in the USA and other countries. All company names, brand names, trademarks and logos are the property of their respective owner.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6312</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6312"/>
		<updated>2018-08-28T20:52:53Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Welcome, brave Sourcerer! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[:File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6311</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6311"/>
		<updated>2018-08-28T20:51:28Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Welcome, brave Sourcerer! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the [[File:ConversionEssentials.zip|guide]], look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot.&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand!&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&lt;br /&gt;
&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented.&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''.&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&lt;br /&gt;
&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &lt;br /&gt;
You can perform extra tweaks to that character at this time. &lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter1);&lt;br /&gt;
  DB_Origin((CHARACTERGUID)Your_OriginCharacter2);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* You can define multiple of these databases. Which one gets used is defined by the next database. &lt;br /&gt;
* The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &lt;br /&gt;
* StartTrigger has to be a global trigger. &lt;br /&gt;
* StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &lt;br /&gt;
All of these mods contain a functional Character Creation already. &lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  RegionStarted(_Level)&lt;br /&gt;
  AND&lt;br /&gt;
  IsGameLevel(_Level, 1)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_CharacterCreationDummy(_Npc)&lt;br /&gt;
  THEN&lt;br /&gt;
  CharacterMakeNPC(_Npc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &lt;br /&gt;
All for the better, of course!&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  IF&lt;br /&gt;
  CharacterDied(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_FreeResurrect(_Player)&lt;br /&gt;
  AND&lt;br /&gt;
  DB_Player(_Player)&lt;br /&gt;
  THEN&lt;br /&gt;
  // Free resurrect for players!&lt;br /&gt;
  CharacterResurrect(_Player);&lt;br /&gt;
  Not twice in a row&lt;br /&gt;
  NOT DB_FreeResurrected(_Player);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''DB_Player''' in the above fragment should read '''DB_IsPlayer''', and the '''DB_FreeResurrected''' should be '''DB_FreeResurrect'''. &lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the '''''_Player''''' variable from the '''CharacterDied''' event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. &lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name ''story_orphanqueries_ignore_local.txt''. &lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all ''story_orphanqueries_ignore_local.txt'' files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
*''story_orphanqueries_ignore.txt'': this file is recreated by the story editor every time you compile story (so no need to restart after changing the ''story_orphanqueries_ignore_local.txt'' file). It simply contains the contents of all relevant ''story_orphanqueries_ignore_local.txt'' files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*''story_orphanqueries_found.txt'': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by ''story_orphanqueries_ignore_local.txt'', so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6284</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6284"/>
		<updated>2018-08-28T19:26:36Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Importing 3.0 Mods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
== Imported Custom Content ==&lt;br /&gt;
=== Imported Materials ===&lt;br /&gt;
Some materials parameters have changed slightly to improve performance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your material files might not be loadable from the start. But they can be converted easily!&amp;lt;br /&amp;gt;&lt;br /&gt;
Open your material in the Resource Browser and simply save.&amp;lt;br /&amp;gt;&lt;br /&gt;
Be wary that (since your material was broken before) your material will only be loaded again after a mod reload or editor restart!&lt;br /&gt;
&lt;br /&gt;
=== Imported Stats ===&lt;br /&gt;
&lt;br /&gt;
As stats were tweaked, some definitions changed. Makes some pages (e.g. Potions), incompatible.&amp;lt;br /&amp;gt;&lt;br /&gt;
But again, conversion is easy! It will happen auto-magically when importing/opening your DE project.&amp;lt;br /&amp;gt;&lt;br /&gt;
Beware though that some columns might have changed and we tweaked several base values, so be sure to go over your stats changes, to ensure they still do exactly what you intend them to do.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6283</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6283"/>
		<updated>2018-08-28T19:18:31Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Finding Definitive Edition Mods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other pages to download mods from, please check the description on the page or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6282</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6282"/>
		<updated>2018-08-28T19:17:44Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Finding Definitive Edition Mods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
New mods will get their own download page, so classic mods will still be available for download/maintenance via their respective pages, as they are now.&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other sources of mods, please check the description or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6281</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6281"/>
		<updated>2018-08-28T19:16:50Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Finding Definitive Edition Mods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the '''Definitive Edition''' tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&amp;lt;br /&amp;gt;&lt;br /&gt;
For all other sources of mods, please check the description or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6280</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6280"/>
		<updated>2018-08-28T19:16:37Z</updated>

		<summary type="html">&lt;p&gt;Kevin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Finding Definitive Edition Mods =&lt;br /&gt;
&lt;br /&gt;
On the Steam workshop, updated mods can be found under the Definitive Edition tag. (A new filter that is automatically applied when publishing in the Definitive Engine).&lt;br /&gt;
For all other sources of mods, please check the description or ask the content creator to find information on the version the mod is made for.&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6279</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6279"/>
		<updated>2018-08-28T18:58:35Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* No CC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6278</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6278"/>
		<updated>2018-08-28T18:58:26Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* No CC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6277</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6277"/>
		<updated>2018-08-28T18:58:08Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6276</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6276"/>
		<updated>2018-08-28T18:57:52Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6275</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6275"/>
		<updated>2018-08-28T18:56:30Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6274</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6274"/>
		<updated>2018-08-28T18:56:01Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6273</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6273"/>
		<updated>2018-08-28T18:55:39Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6272</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6272"/>
		<updated>2018-08-28T18:55:31Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Free resurrect for players!&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;// Not twice in a row&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6271</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6271"/>
		<updated>2018-08-28T18:54:47Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Orphan Databases/Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterDied(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_FreeResurrect(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_Player(_Player)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''// Free resurrect for players!'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterResurrect(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''// Not twice in a row'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''NOT DB_FreeResurrected(_Player);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. &amp;lt;br /&amp;gt;&lt;br /&gt;
Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. &amp;lt;br /&amp;gt;&lt;br /&gt;
After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
However, this can result in false positives. &amp;lt;br /&amp;gt;&lt;br /&gt;
A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. &amp;lt;br /&amp;gt;&lt;br /&gt;
To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. &amp;lt;br /&amp;gt;&lt;br /&gt;
Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&amp;lt;br /&amp;gt;&lt;br /&gt;
*'''story_orphanqueries_ignore.txt''': this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
*'''story_orphanqueries_found.txt''': this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''One final note''': the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6270</id>
		<title>Definitive Edition</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Definitive_Edition&amp;diff=6270"/>
		<updated>2018-08-28T18:52:25Z</updated>

		<summary type="html">&lt;p&gt;Kevin: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
= Welcome, brave Sourcerer! =&lt;br /&gt;
&lt;br /&gt;
So you have some old modifications you’d like to bring up to date for this new day and age? Well, look no further!&lt;br /&gt;
&lt;br /&gt;
Many things changed in Divinity: Original Sin 2 Definitive Edition, but we've got you covered! &amp;lt;br /&amp;gt;&lt;br /&gt;
Below, you can find a guide containing all essential information needed to make your content Definitive Edition - ready. &amp;lt;br /&amp;gt;&lt;br /&gt;
For more information on topics mentioned in the guide, look at the information on this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=600px&amp;gt;&lt;br /&gt;
File:ConversionFront.jpeg|link=File:ConversionEssentials.zip|Essential Conversion Guide&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing the Divinity Engine 2 Definitive Edition =&lt;br /&gt;
&lt;br /&gt;
The game and the tool are available under the same game page on whichever store you use. So, simply use the existing [[Setting_up_the_editor|setup guide]].&amp;lt;br /&amp;gt;&lt;br /&gt;
{{warning|'''One exception''': You’ll be opening the Divinity Engine 2 Definitive Edition instead of the regular one, and where the guide talks about linking the Engine to the Original Sin 2 Data, be sure to link to the Definitive Edition data. }}&lt;br /&gt;
&lt;br /&gt;
= Importing 3.0 Mods =&lt;br /&gt;
&lt;br /&gt;
We added a handy, little “Import Project” button to the [[Project_browser|Project Browser]].&lt;br /&gt;
&lt;br /&gt;
[[File:ImportProject.PNG|Import Project Window|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When pressing “Import Project”, you’ll be prompted with a File Explorer window. &amp;lt;br /&amp;gt;&lt;br /&gt;
Navigate to the Data folder of Divinity Original Sin 2 (classic edition) and select the following: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp; '''''Divinity Original Sin 2\Data\Mods\{YourMod}'''''&lt;br /&gt;
&lt;br /&gt;
The editor will then copy all project data over to the Definitive Edition data folder and give your project a new ID. &amp;lt;br /&amp;gt;&lt;br /&gt;
Later on, when publishing, this will ensure that your project will have a separate page on the workshop and will be recognized as a different mod in-game.&lt;br /&gt;
&lt;br /&gt;
== No Backwards Compatibility. Conversion Is Required. ==&lt;br /&gt;
&lt;br /&gt;
We would like to remind you at this point that Classic Mods are not compatible with the Definitive Edition and vice versa. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you happen to have an incompatible mod in your game’s mod folder, the Mod Menu in-game will show you that that mod is incompatible and block loading/enabling that mod.&lt;br /&gt;
&lt;br /&gt;
= Sound Modding =&lt;br /&gt;
&lt;br /&gt;
Sound Resource updated to recognize external .wav files. &amp;lt;br /&amp;gt;&lt;br /&gt;
This .wav support is provided everywhere where sound resources are used, with the exception of Music Volume Triggers.&amp;lt;br /&amp;gt;&lt;br /&gt;
More specifically, this means you can use custom music files (.wav extension) in the following cases:&lt;br /&gt;
*Point Sound Triggers&lt;br /&gt;
*Point Volume Triggers&lt;br /&gt;
*The Effect Editor&lt;br /&gt;
*The Script Editor '''(*)'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''(*)''' Two new calls have been added to allow playing a sound through story scripting:&lt;br /&gt;
* [[Osiris/API/CharacterPlayHUDSoundResource|CharacterPlayHUDSoundResource]]&lt;br /&gt;
* [[Osiris/API/PlaySoundResource|PlaySoundResource]]&lt;br /&gt;
&lt;br /&gt;
= GM Story Scripting =&lt;br /&gt;
&lt;br /&gt;
Story (Osiris) scripting in Game Master mode is now fully supported!&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means that all your add-on scripting will work in Game Master, the same way it does in Story mode.&amp;lt;br /&amp;gt;&lt;br /&gt;
As always, simply make sure in your [[Project_settings_window|Project Settings]] (''CTRL + P'') that your project has the correct game mode enabled as Target.&amp;lt;br /&amp;gt;&lt;br /&gt;
Your project only works for the modes it targets! In this case, the target would be ''GM''.&lt;br /&gt;
&lt;br /&gt;
= Save/Load Support =&lt;br /&gt;
&lt;br /&gt;
Saving/Loading of save games is supported in the Divinity Engine 2 Definitive Edition.&amp;lt;br /&amp;gt;&lt;br /&gt;
All your save games are loaded into the editor and available through the [[Level_browser|Level Browser]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning| Always make sure you make save all changes before making save games. Otherwise, If you alter the save game but not the project data, you could cause the game to crash due to missing data.}}&lt;br /&gt;
&lt;br /&gt;
= Unified Character Creation =&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation scripting has been unified into one spot. &amp;lt;br /&amp;gt;&lt;br /&gt;
This way, your mod will always have character creation logic without you having to add that by hand! &amp;lt;br /&amp;gt;&lt;br /&gt;
Furthermore, it is easily moddable by overriding the new files.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The basic Character Creation (CC) functionality has been moved to the Shared mod and has been documented. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can find the code in the story goals '''''Z_Shared_CharacterCreation''''' and '''''Z_SharedCharacterCreation_AfterEvents'''''. &amp;lt;br /&amp;gt;&lt;br /&gt;
Character creation code that is specific to the DOS2 main campaign (DivinityOrigins mod) can be found in '''''Shared_DOS_CharacterCreation'''''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The names of these goals (and their parent goal) start with '''''Z_''''' because story goals are initialised in alphabetical order, &amp;lt;br /&amp;gt;&lt;br /&gt;
and this way any database (specifically, the databases described below) defined story goals with names that do not start with “Z” initialise before the generic CC scripting tries to use them.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can detect that Character Creation pipeline from the Shared mod has completely finished by the fact that at this point the procedure '''''PROC_Shared_CharacterCreationFinished()''''' gets called. &amp;lt;br /&amp;gt;&lt;br /&gt;
This happens both when testing a mod in the editor (and hence no character creation ever happened, in which case a random character from the '''''DB_Origins()''''' database gets selected the first time you enter game mode in a session), and in a regular game.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The '''''Shared_DOS_CharacterCreation''''' goal also overloads the '''''ProcSetupGenericOrigin((CHARACTERGUID)_Char)''''' procedure. &amp;lt;br /&amp;gt;&lt;br /&gt;
This procedure gets called with as parameter the random character that was selected when starting game mode in the editor. &amp;lt;br /&amp;gt;&lt;br /&gt;
You can perform extra tweaks to that character at this time. &amp;lt;br /&amp;gt;&lt;br /&gt;
The code in '''''Shared_DOS_CharacterCreation''''' randomly turns that character into an undead to encourage people to test their situations also with undead characters.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Standard CC for adventure that does not load data ==&lt;br /&gt;
In a goal that is initialised before or when the '''''GameModeStarted(“Campaign”, _)''''' event fires:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter1);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''DB_Origin((CHARACTERGUID)Your_OriginCharacter2);'''''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;'''''...'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The generic character creation code will turn all of these characters into player characters when character creation starts, and make them NPCs again once it is finished if they were not selected by anyone. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note that these characters also need to be prepared as described in [[My_first:_Character_creation_origin|The Custom Origin Character Tutorial]] either in your own mod, or in a mod on which you depend.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can also add characters from the DB_GenericOrigins() database to the DB_Origins() database. &amp;lt;br /&amp;gt;&lt;br /&gt;
If you do this, then when starting a level from this mod in the editor you may also be assigned a generic character rather than an origin character.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above):&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;,(TRIGGERGUID)StartTrigger,&amp;quot;StartMovie&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You can define multiple of these databases. &amp;lt;br /&amp;gt;&lt;br /&gt;
Which one gets used is defined by the next database. &amp;lt;br /&amp;gt;&lt;br /&gt;
The StartMovie can be empty if no movie should be shown between character creation and the start of the first level. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartTrigger has to be a global trigger. &amp;lt;br /&amp;gt;&lt;br /&gt;
StartLevel is just an identifier; it does not have to be an actual level name.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Before Character Creation finishes (can be in the init section of the same goal as above)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;emsp;'''''DB_CharacterCreationTransitionInfo(&amp;quot;StartLevel&amp;quot;);'''''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This database determines which of the DB_CharacterCreationTransitionInfo entries gets used, i.e., to which start trigger and with which movie the players are teleported after Character Creation finishes.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
In addition, there are a number of optional databases that you can define. &amp;lt;br /&amp;gt;&lt;br /&gt;
See the comments in the INIT section of the '''''Z_Shared_CharacterCreation''''' goal for more information. &amp;lt;br /&amp;gt;&lt;br /&gt;
In general, you won’t have to touch these.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Standard CC for an adventure that loads data==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This is for mods that load data from Story, GM, and/or Arena. &amp;lt;br /&amp;gt;&lt;br /&gt;
All of these mods contain a functional Character Creation already. &amp;lt;br /&amp;gt;&lt;br /&gt;
Story (DivinityOrigins mod) uses the Character Creation scripts from Shared as described in the previous point. &amp;lt;br /&amp;gt;&lt;br /&gt;
GM and Arena contain custom character creation code due to their specific nature.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Custom CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you wish to create a custom character creation script, you can do so by overriding the '''''Z_Shared_CharacterCreation''''' and/or '''''Z_Shared_CharacterCreation_AfterEvent''''' goals in your own mod. &amp;lt;br /&amp;gt;&lt;br /&gt;
Make sure to carefully read the original code and to provide support for all edge cases such as the lobby level (even it works fine by default, it may not when you start switching mods within a single session) and testing in the editor.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==No CC==&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If you do not wish to have a Character Creation at all and instead statically define the player characters, then&lt;br /&gt;
*Override the Z_Shared_CharacterCreation goal, and&lt;br /&gt;
*Copy everything from the INIT section of the original goal to the new one&lt;br /&gt;
*Copy the PROC_Shared_CharacterCreation_Init() from the original goal to the new one&lt;br /&gt;
*Copy the “Lobby level support” region from the original goal to the new one&lt;br /&gt;
*In your mod, go to the Project -&amp;gt; Project Settings, and set the Startup Level to the level in which you wish the game to start. Clear the Character Creation Level.&lt;br /&gt;
*Override the Z_Shared_CharacterCreation_AfterEvents goal and add the following code to it:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''IF'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''RegionStarted(_Level)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''IsGameLevel(_Level, 1)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''AND'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''DB_CharacterCreationDummy(_Npc)'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp; '''THEN'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;&amp;amp;emsp;'''CharacterMakeNPC(_Npc);'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the properties of all characters that you wish players to be able to control as follows:&lt;br /&gt;
*Check their “Global” property&lt;br /&gt;
*Check their “Player” property&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scripting =&lt;br /&gt;
&lt;br /&gt;
Both Behaviour as well as Story (Osiris) Scripting have received a plethora of new calls as well as changes to exiting ones. &amp;lt;br /&amp;gt;&lt;br /&gt;
All for the better, of course!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Osiris_APIs|Osiris]]&lt;br /&gt;
* [[Character_and_Item_Script_Triggers,_Calls,_and_Queries|Behaviour Scripting]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Orphan Databases/Queries ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, the Osiris compiler did not catch typos in database names. For example:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''IF'''&lt;br /&gt;
'''CharacterDied(_Player)'''&lt;br /&gt;
'''AND'''&lt;br /&gt;
'''DB_FreeResurrect(_Player)'''&lt;br /&gt;
'''AND'''&lt;br /&gt;
'''DB_Player(_Player)'''&lt;br /&gt;
'''THEN'''&lt;br /&gt;
'''// Free resurrect for players!'''&lt;br /&gt;
'''CharacterResurrect(_Player);'''&lt;br /&gt;
'''// Not twice in a row'''&lt;br /&gt;
'''NOT DB_FreeResurrected(_Player);'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The DB_Player in the above fragment should read DB_IsPlayer, and the DB_FreeResurrected should be DB_FreeResurrect. Osiris did not notice anything wrong with this fragment because it can infer the type of the _Player variable from the CharacterDied event signature.&lt;br /&gt;
&lt;br /&gt;
In order to catch such errors, the Osiris compiler now gives warnings (which are treated as errors) for all databases that either only checked or only defined in all story goals of the current mod and any mod it depends on. After all, such checks will always fail and such defines will never be used.&lt;br /&gt;
&lt;br /&gt;
However, this can result in false positives. A common example is helpers in the Shared mod, which often check databases that will only be defined in other mods that actually make use of these helpers. To suppress these false positives, a new file can be added in the Story directory of a mod, with the name story_orphanqueries_ignore_local.txt. Every line of this file contains the name of a database followed by its arity (= number of fields/parameters).&lt;br /&gt;
&lt;br /&gt;
When compiling a mod, the contents of all story_orphanqueries_ignore_local.txt files from the dependent mod and this mod are merged, so the ones defined in the Shared mod will also apply to your own mod.&lt;br /&gt;
&lt;br /&gt;
In addition to the previous file, there are two more files you may now see in the Story directory of a Mod:&lt;br /&gt;
story_orphanqueries_ignore.txt: this file is recreated by the story editor every time you compile story (so no need to restart after changing the story_orphanqueries_ignore_local.txt file). It simply contains the contents of all relevant story_orphanqueries_ignore_local.txt files: the one from the current mod and any mod it depends on. This is the file that is read by the Osiris compiler to determine which warnings it should not show. Since it gets overwritten every time, don’t make changes to it since they will get lost.&lt;br /&gt;
story_orphanqueries_found.txt: this file is generated by the Osiris compiler every time you build story, and contains all of the databases for which it gave the aforementioned warning. These databases are in the same format as used by story_orphanqueries_ignore_local.txt, so you can just copy/paste its contents in case these are new false positives that should be suppressed.&lt;br /&gt;
&lt;br /&gt;
One final note: the line number printed for these warnings is bogus, as no line number information is available anymore at the time it gets shown. In general ctrl-shift-f for the database name will be the easiest way to find the location(s) where it is used/defined.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Copyrights&amp;diff=6269</id>
		<title>Divinity Engine Wiki:Copyrights</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=Divinity_Engine_Wiki:Copyrights&amp;diff=6269"/>
		<updated>2018-08-28T18:34:58Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Created page with &amp;quot;Content posted to this wiki on or after 28 August 2018, and also content posted to this wiki before that date by Larian Studios Games Ltd employees, is licensed under the Crea...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Content posted to this wiki on or after 28 August 2018, and also content posted to this wiki before that date by Larian Studios Games Ltd employees, is licensed under the Creative Commons CC BY-NC-SA 4.0 license, except where stated otherwise. Community content posted before that date falls under the contribution guidelines outlined at [[Community_page_submission|Community Submissions Page]].&lt;br /&gt;
&lt;br /&gt;
Larian Studios, Divinity, all other Larian Studios Games Ltd. product names, and their respective logos are trademarks of Larian Studios Ltd. in the USA and other countries. All company names, brand names, trademarks and logos are the property of their respective owner.&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:Dos2banner.jpg&amp;diff=6268</id>
		<title>File:Dos2banner.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:Dos2banner.jpg&amp;diff=6268"/>
		<updated>2018-08-28T18:33:10Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:Dos2banner.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:Overriding.png&amp;diff=6267</id>
		<title>File:Overriding.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:Overriding.png&amp;diff=6267"/>
		<updated>2018-08-28T18:32:45Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:Overriding.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:PublishProjectPanel.png&amp;diff=6266</id>
		<title>File:PublishProjectPanel.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:PublishProjectPanel.png&amp;diff=6266"/>
		<updated>2018-08-28T18:32:15Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:PublishProjectPanel.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;publish project panel step-by-step&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:Publish.png&amp;diff=6265</id>
		<title>File:Publish.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:Publish.png&amp;diff=6265"/>
		<updated>2018-08-28T18:31:51Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:Publish.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:FAQ.png&amp;diff=6264</id>
		<title>File:FAQ.png</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:FAQ.png&amp;diff=6264"/>
		<updated>2018-08-28T18:31:20Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:FAQ.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
	<entry>
		<id>https://docs.larian.game/index.php?title=File:GM_Banner.jpg&amp;diff=6263</id>
		<title>File:GM Banner.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.larian.game/index.php?title=File:GM_Banner.jpg&amp;diff=6263"/>
		<updated>2018-08-28T18:31:00Z</updated>

		<summary type="html">&lt;p&gt;Kevin: Kevin uploaded a new version of File:GM Banner.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kevin</name></author>
	</entry>
</feed>