Fallout 4
Help us shape the future of the Vortex mod manager by taking our survey
0 of 0

File information

Last updated

Original upload

Created by

Kerber

Uploaded by

Kerber100

Virus scan

Safe to use

Tags for this mod

About this mod

This mod allows preload F4SE plugins before the game initializes.

Requirements
Permissions and credits
Mirrors
Changelogs
What it does?
Allows preload F4SE plugins 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 PrivateProfileRedirector F4. 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?
Library IpHlpAPI.dll is loaded by game automatically, which preloads the plugins, then redirects all function calls to the original IpHlpAPI.dll file in your system directory.

Installation
Put IpHlpAPI.dll and xSE PluginPreloader.ini in your root Fallout 4 directory (where Fallout4.exe is), NOT in Data folder.

Uninstallation
Delete installed files from your game folder. Any mod that depends on this will cease to work correctly.

Configuration
Preloader is implemented as proxy to IpHlpAPI.dll and thus is incompatible with any mod that changes this DLL (none I found). In such case you need to rename another mod IpHlpAPI.dll to something else and specify new real DLL in xSE PluginPreloader.ini file. Refer to aforementioned INI file for more detailed instructions.

If you don't use MO you can change F4SE plugins preload method to direct.

User Q&A
Q: Does this have a performance hit or any downsides?
A: Nothing that have been noticed.

Q: Is it compatible with ENB?
A: Yes.

Q: Is ENB required?
A: No.

Q: Doesn't it mess up things if you load F4SE plugins at different time?
A: Only F4SE 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.

Q: I'm having issues where a plugin is not preloaded when it's supposed to!
A: Find file xSE PluginPreloader.log in your game directory and upload it with your issue report. I'll try to find out what's wrong.

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

Q: How is the plugin loaded?
A: The IpHlpAPI.dll loader will call LoadLibrary on your plugin before game initializes. It does NOT call F4SEPlugin_Query or F4SEPlugin_Load, those are called later by F4SE itself. That means you must do whatever it is you need to do before the game initializes in your DllMain method.

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

Q: Can I install my plugin files (including the _preload.txt) via Mod Organizer/Wrye Bash?
A: Original SKSE Plugin Preloader page says that you can. Considering that plugin packaging is identical, I think it's applicable. Same with Wrye Bash:
be sure to tell users to choose "Override Skips" on the installer so that the .txt installs along with your F4SE plugin

Plugin source is available on GitHub.

Credits:
Nukem - Detours library
meh321 - description template
Augh - testing.