Developer Guide - IHateMyKite/UnforgivingDevices GitHub Wiki

Foreword

This wiki page should work as simple tutorial for people who want to help with the mod development, but they don't know how.Before you continue there is one mayor thing you need to realize. Unforgiving Devices is mostly Papyrus scripts (lets say around 90%), everything else is esp and other things. This means that you should have at least the basic knowledge about programming and scripting. And with basic, I mean the most basic things you can imagine. Here is simple test, if you can answer all questions you more then ready

  • What is function
  • What is While loop
  • What is If

If you can answer all of them, then you have nothing to worry about. Papyrus is certainly not C (but is certainly more infuriating sometimes). If you at least once done some simple course for Python, Lua or some other simple language, you will excel in papyrus.

As I said, other 10% is mostly .esp. Esp are just Bethesda way of doing modding easier. There are many tutorials about them and even more examples. Might be little trickier to understand then Papyrus, but once you understand how it fundamentally work, you will have no more issues ever (It's basically uglier XML with some compression).

Required mods

You will need sources from these mods to make UD compilable and working

  • Base game scripts (you need this allways when you wan't to compile any papyrus scripts). To get them, you will have to download creation kit. The sources should be then placed in skyrim data folder as Scripts.rar. Extract the rar in to the data folder.
  • DD - You can get sources by selecting Source option in fomod when installing the mod.
  • SkyUi SDK - Link. Download the last one. (5.1 at this point). Add the sources to your ModSources folder.
  • Sexlab and SLA should already have sources in right folder.
  • Other DD dependencies - DD have some more soft requirements, but you don't really need these sources. Will explain later in section about notepad.

Tools

In this sections, I will explain which developer tools are IMHO best for developing this most. If you have more experience with other tools, you can use them instead. As long as the results are the same there is not the issue.

Mod Organizer 2

Will not talk much about it. You should be able to find plenty of tutorials about it on internet. I will just mention some important parts in later parts of this tutorial.

Create new empty mod and enable it. You can name it ModSources or something, it doesn't matter. You will then have to place all the sources from required mods here.

MO2

Notepad++

I'm using Notepad++ for more than a year, and I was never happier that I throwed Creation Kit out of window. It's faster, it's nicer, and it's even easier to install and make it work. There is no single reason to use Creation Kit for compiling papyrus scripts instead of Notepad++.

You will have to start by first download and install Notapad++. Link.

After it is downloaded, you will have to download Papyrus plugin, and install. Link. Alternatively, it should be possible to get the plugin directly in Notepad by searching for it in Plugins Admin.

Notepad++plugin

In case of LE, you only want to output the scripts in to the Scripts folder, which is above the source folder. In case you are using SE, you also need to change default game to SkyrimSE. The plugin will actually also look for scripts in SE source script folder. So you should not need to change the directories.

Plugin1 Plugin2.

Alternatively, in case of MO2, it might be better idea to just past in there the absolute path to some new empty mod folder. Why? Because the papyrus plugin allows you to jump in to the scripts which are mounted on VMI. So the scripts are actually directly in Data folder. Because of that, if you try to compile them, it will output the compiled version directly in to the data folder. This is not what you want to do, as the script will most likely get overwritten by the base mod (unless you are making new script). So either do not compile VMI scripts, or change the path from .. to some different one. So lets use the power of MO2 of our advatange. Lets create new empty mod and name it CompiledSources. Next we click on Open in explorer.

MO2

Create new folder called Scripts and enter it. Copy the absolute path clicking on the path and copy it

MO2

Then just past it in to the plugin settings

MO2

Now for the last step, you will have to add Notepad++ to MO2 as app. You do it by opening drop down menu for executables and selecting <edit ...>

MO2

Select Add from file

MO2

Found the folder in which the Notepad++ was installed and select the executable notepad++.exe

MO2

After that, the MO2 executable should look like this

MO2

If you want to do some more specific mod orientated scripting, you can edit the notepad start arguments by adding following line to Arguments field

-multiInst -nosession -openFoldersAsWorkspace "EDIT THIS TO ABSOLUTE PATH TO THE UD MODS FOLDER"

Now you if you run the executable with the mentioned arguments, you will see something like this

notepad

This will open cleaned instance of notepad and also open project panel with all sources in current UD source folder. As a test, let's try to compile the UnforgivingDevicesMain.psc, which works as the main file of the whole mod. Double click it in the Project panel which will open the file. Note that the file should still link to the MO2 folder with sources for UD

notepad

Let's try to access the VMI script. Try double clicking on zadlibs while holding Ctrl. This will open the associated script

notepad

As you see, the path is actually not pointing to the MO2 folder with installed DD, but instead on to the game Data folder. This is because of VMI. What VMI does is that it virtually moves all the enabled mods files in to the data folder. But enough about this, lets try compiling the UnforgivingDevicesMain.psc. Select the file (plugin can only compile one file at time, later I will explain the PCA), and press Ctrl+Shift+C

Error1

Oh no, the errors! The errors are caused by missing the sources. To make the papyrus compile correctly it needs to have access to all scripts which are mentioned in the compiling scrip. So if UnforgivingDevicesMain.psc have linked zadlibs.psc and that have linked fnis.psc, it means you will have to get the source. Or do you ? I will now explain to you very simple trick on how to bypass this check without needing to install any other mods.

For example, when trying to compile UnforgivingDevicesMain.psc, it will show many errors about missing scripts. Let's try to fix one of them. If you do not want to use mods, but do not want to use the following technique, you can download the mod and just copy the sources to some empty MO2 folder and eneble it.

Double-click the error. This will open the file and exact location of error.

Error2

As you can see, it looks like the FNISCreatureVersion is missing. We can of course download the missing mod sources, or we can just commend out the line with ;

Error3

After that, it is important that you DON'T compile the script with error!!! You don't want to change the compiled scripts. You are just editing sources as a way to make compiler to stop crying about missing scripts. But the compiled version still needs these error parts to work properly (well, maybe not for you if you don't already have the mod installed).

Error4

After compiling UnforgivingDevicesMain.psc again, you can see that commenting all the script errors, I managed to remove all fnis.psc errors without need of installing/downloading new mod. You will just have to do the exact same thing for all other errors. But be warned, in case that error comes directly from some UD scripts, it means that you are missing some required sources! In that case you will have to download them, or the UD will not work properly after recompiling it!

After all errors are removed, the script should finally compile without issue.

notepad

If you configurated the notepad with absolute path, the Script folder should now have compiled UnforgivingDevices.pex

Finish

If you are using relative path (..), it will be placed directly in UD mod folder in Scripts

In case there are more errors which do not relate to the missing scripts, please let me know here and I will try to help

xEdit

xEdit is a tool which is a great replacement for Creation Kit in some capacity. In comparison to CK, xEdit have the following pluses

  • It loads much faster
  • Some operations are much easier to do
  • Finding specific forms is mostly easier as all forms are grouped by mod
  • Have many advanced features which CK doesn't have (rename of EditorID, copying multiple forms to different mod, creating patches, Pascal scripts)
  • Allow to do some things that CK can't, like using single script for all dialogue script fragments
  • No CTD

There are obviously also few downsides, mainly

  • CK can copy and paste conditions, while xEdit can't (but I would low this feature in xEdit)
  • CK have 3D rendering window which shows you the word, objects, etc... xEdit have nothing like this. You can still edit object position in xEdit, but it's much harder when you don't see what you are doing

In the end, xEdit is just better when it comes to developing UD, because there is no need for 3D render windows. Condition copying would be cool, but is not super important.

There are many tutorials about xEdit on internet, so I will not be talking about it much. The only think I will say is that when creating a push request which is intended to updated main .esp, all changes should be placed in separate .esp with suffix PRxxx_ where xxx is pull request number. Once the PR is merged, I will also merge the esp.

⚠️ **GitHub.com Fallback** ⚠️