BepInEx.Debug icon indicating copy to clipboard operation
BepInEx.Debug copied to clipboard

Can't get ScriptEngine to work [5.4.22.0]

Open Dealman opened this issue 9 months ago • 2 comments

For reference, trying to use this with Valheim. I've added ScriptEngine.dll to the plugins folder and it seems to fire up normally; [Info : BepInEx] Loading [Script Engine 11.0]

I press F6 to reload the scripts and get these log message (auto-load off, but same result with it on);

[Info   :Script Engine] Loading plugins from C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\scripts\ValheimTest.dll
[Info   :Script Engine] Unloading old plugin instances
[Info   :Script Engine] Loading plugins from C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\scripts\ValheimTest.dll

However, neither of my patches are applied and neither does Awake or OnDestroy for the plugin execute. Seems like it simply doesn't do anything, no errors, no warnings, no debug messages.

If I cut and copy ValheimTest.dll from the scripts folder and put it in the plugins folder - it works as expected.

Dealman avatar Feb 22 '25 00:02 Dealman

This looks to be a regression from 10.0 to 11.0 I got the same output while trying to get it to work on the Haste Broken Worlds Demo. Downgrading to 10.0 made it work. Also may or may not be relevant, but on the Haste Broken Worlds Demo it only works with HideManagerGameObject = true

MeGaGiGaGon avatar Mar 24 '25 04:03 MeGaGiGaGon

Probably caused by this? https://github.com/BepInEx/BepInEx.Debug/commit/4010d2c317c5c0bf7af589f7577d5c4342cca70b#diff-672fb7b075a59ec8b46f434842be7dc30347e9a77acd209cf42a83dfd89ed4ddR168-R169 Maybe the BepInEx version your plugin is built against is not the same as the version the game is running, though it's unlikely to be the cause.

The easiest way to find the issue would be for you to attach a debugger and step through the scriptengine reload method.

ManlyMarco avatar Mar 24 '25 10:03 ManlyMarco

Can confirm modding Lethal Company. ScriptEngine is installed and finds the dll in BepInEx/scripts, but the Awake() function of the plugin is never called.

Packsolite avatar Sep 23 '25 16:09 Packsolite