Divinity: Original Sin 2

Divinity: Original Sin 2

Majoras - Fashion Sins
Majoras  [developer] 30 Nov, 2019 @ 3:47am
How To: Making a Mod Dependency
As Told by Laughing Leader

Editor Project files:

Editor/Mods/ModName_UUID
Editor-only. This is for assets such as stats editor files, allspark editor files, and material editor files.

Mods/ModName_UUID
Level data, global objects, story files (dialog files, story scripts, alignments, etc), and the mod's meta.lsx (contains the UUID of the mod, the folder name, the author, description, etc.).

Projects/ModName_UUID
Editor-only. This contains a single meta.lsx file that contains a unique editor project UUID, and a module UUID linking it to a Mods/ModName_UUID/meta.lsx file.

Public/ModName_UUID
Assets such as models, textures, effects, resources, icons, behavior scripts, auto-generated localization files, and generated stats text files (when you save in the stats editor, these are what it generates).

Pak Contents:

Mods/ModName_UUID
Public/ModName_UUID

When a project is published, it only includes these two folders.

Doing this yourself isn't too bad - Extract the pak. Then if you have two folders like this:

Mods/ModName_UUID
Public/ModName_UUID

Simply copy those folders into DefEd/Data, so they look like this:

DefEd/Data/Mods/ModName_UUID
DefEd/Data/Public/ModName_UUID

Now you're halfway done.

The final step is to make a new folder like this:

DefEd/Data/Projects/ModName_UUID

Then make a new text file, and name it meta.lsx, so it's like this:

DefEd/Data/Projects/ModName_UUID/meta.lsx

Open that new file in a text editor. Inside, paste this:

<?xml version="1.0" encoding="UTF-8" ?>
<save>
<header version="2" time="1534787253" />
<version major="3" minor="6" revision="0" build="3" />
<region id="MetaData">
<node id="root">
<attribute id="Module" value="MOD_UUID_HERE" type="23" />
<attribute id="Name" value="MOD_NAME_HERE" type="23" />
<attribute id="Type" value="Add-on" type="23" />
<attribute id="UUID" value="NEW_UUID_HERE" type="23" />
</node>
</region>
</save>


We need to replace the values in all caps next:

For MOD_UUID_HERE, replace this with the "UUID" value in DefEd/Data/Mods/ModName_UUID/meta.lsx.

For MOD_NAME_HERE, this is the name you want to use for the mod in the load projects view for the editor.

For NEW_UUID_HERE, we need to generate a new UUID for this editor project.
Go here: https://www.uuidgenerator.net/version4
A new UUID is automatically generate at the top, so just copy/paste that and replace NEW_UUID_HERE.

As an example, if the mod I was doing this for was LeaderLib, this is what it'd look like:

I'd get the mod UUID from its meta.lsx file: https://github.com/LaughingLeader-DOS2-Mods/LeaderLib/blob/master/Mods/LeaderLib_543d653f-446c-43d8-8916-54670ce24dd9/meta.lsx
And generate a new UUID for the project, then all together it'd look like:
<?xml version="1.0" encoding="UTF-8" ?>
<save>
<header version="2" time="1534787253" />
<version major="3" minor="6" revision="0" build="3" />
<region id="MetaData">
<node id="root">
<attribute id="Module" value="7e737d2f-31d2-4751-963f-be6ccc59cd0c" type="23" />
<attribute id="Name" value="LeaderLib" type="23" />
<attribute id="Type" value="Add-on" type="23" />
<attribute id="UUID" value="a1e323b8-8339-4a30-b4c2-f64028ac9246" type="23" />
</node>
</region>
</save>

So to summarise, adding mods from paks as editor projects entails:

1. Extracting the pak with Norbyte's PAK Extractor (ConverterApp).
2. Moving the Mods/ModName_UUID and Public/ModName_UUID folders into DefEd/Data.
3. Making a new DefEd/Data/Projects/ModName_UUID folder.
4. Making a new DefEd/Data/Projects/ModName_UUID/meta.lsx file (text file with an lsx extension).
5. Pasting the project meta.lsx template into the file.
6. Opening Mods/ModName_UUID/meta.lsx and copying the UUID value.
7. Replacing MOD_UUID_HERE with the UUID you copied.
8. Going to https://www.uuidgenerator.net/version4 and getting a new UUID.
9. Replacing NEW_UUID_HERE with the new UUID you copied.
10. Replacing MOD_NAME_HERE with the mod's name.
Last edited by Majoras; 25 Jan, 2020 @ 6:20am