SKYRIM
SKSE Plugin Preloader by meh321 and sheson
Skyrim » Utilities
Added: 21/05/2016 - 12:56PM
Updated: 22/05/2016 - 05:18PM

7,429 Endorsements

3 Latest version

112,939 Unique D/Ls

211,078 Total D/Ls

537,935 Total Views

Uploaded by meh321

Description

Last updated at 17:18, 22 May 2016 Uploaded at 12:56, 21 May 2016

For mod users:

What it does?
Allows SKSE plugins to load before the game initializes.

Do I need this and is there any benefit to this?
No! You don't need this unless a mod specifically says you require this. There is no benefit to having this for no reason. At the time of writing this you only need it if you use Crash Fixes mod and UseOSAllocators=1 in the INI file. There is no other reason to use this at all. It allows the mod to make edit to game code before the game has any chance to run that code.

How does it work?
Contains DLL, d3dx9_42.dll. It is loaded by game automatically, which preloads the plugins, then redirects all function calls to the original d3dx9_42.dll file in your system directory.

Installing
Put d3dx9_42.dll in your root Skyrim directory (where TESV.exe is), NOT in data folder!

Does this have a performance hit or any downsides?
No.

Is it compatible with ENB?
Yes.

Is ENB required?
No.

Doesn't it mess up things if you load SKSE plugins at different time?
Only SKSE plugins that have included a special file, indicating that they wish to load earlier, will be preloaded. You should not manually create the file! Plugin author will decide this and include the file with their mod if it must be loaded like that.

I'm having issues where a plugin is not preloaded when it's supposed to!
Create a file called d3dx9_42.log in your Skyrim root directory. Start the game again, exit and then check the log file to see what happened.

For mod authors:

How do I make my plugin load before game initializes?
Let's say your plugin name is MyPlugin.dll and it's in Data/SKSE/Plugins, then you create a text file called MyPlugin_preload.txt in Data/SKSE/Plugins, the contents of the file does not matter.

How is the plugin loaded?
The d3dx9_42 loader will call LoadLibrary on your plugin before game initializes. It does NOT call SKSEPlugin_Query or SKSEPlugin_Load, those are called later by SKSE itself. That means you must do whatever it is you need to do before the game initializes in your DllMain method.

SKSE later calls LoadLibrary again, is that a problem?
No, LoadLibrary can be called multiple times and will only load the DLL once, unless it's in multiple locations as different files.

Can I install my plugin files (including the _preload.txt) via. Mod Organizer?
Yes - tested with MO 1.3.11

Can I install my plugin files (including the _preload.txt) via. Wrye Bash?
Yes - be sure to tell users to choose "Override Skips" on the installer so that the .txt installs along with your SKSE plugin.

Credits:
sheson - created d3dx9_42 wrapper and idea.
LordOfLA - lots of help with testing.