MelonLoader icon indicating copy to clipboard operation
MelonLoader copied to clipboard

[Enhancement]: Hot reload for Mono mods

Open DomNomNomVR opened this issue 1 year ago • 4 comments

Describe the new feature or enhancement

I'm putting a bounty of $100 USD on this feature which would allow me to reload a mod I'm working on in a game like ChilloutVR without needing to restart the game.

DomNomNomVR avatar Apr 17 '23 01:04 DomNomNomVR

As tempting as $100 would be, This is way out of scope for MelonLoader. The way Unity reloads assemblies in the editor requires a full AppDomain reload, which is just a big "nope" for us. we partially support hot-reloading of code on il2cpp games, by attaching visual studio as a debugger. That's sadly as far as we can go.

RinLovesYou avatar Apr 17 '23 17:04 RinLovesYou

You could probably do something similar to ScriptEngine for BepInEx, its not full hot-reload, but you can destroy the existing plugin behavior and load the new assembly in its place to get something very similar. https://github.com/BepInEx/BepInEx.Debug/blob/master/src/ScriptEngine/ScriptEngine.cs

Windows10CE avatar Apr 18 '23 00:04 Windows10CE

Very well, i will open this back up for discussion and see if we can sort of implement this

RinLovesYou avatar Apr 18 '23 00:04 RinLovesYou

Yes, partial reload would still be helpful.

DomNomNomVR avatar Apr 20 '23 23:04 DomNomNomVR