Sooooo, I've been working on my new "mod" S3MM, and I've now, for some reason, made a full mod loader with a harmony-like hooking system plus hot reloading, and a few other things. This is probably all very overkill but I've been having a lot of fun figuring things out (though of course some of it has been incredibly frustrating too!)
Mod loading from dll! No more stinky .package file stuff for script mods! Currently you can just plop the .cs file into a mods folder, no need for build setup or project files (tho you still need the dlls), it runs csc.exe to compile mods when the game runs, then loads it in. Ideally completed projects would be a .dll tho for obvious reasons
Hot reload! You can reload mods while playing if you've edited things, or load new ones in, this is a fairly janky implementation as it compiles a new assembly then loads that in in addition to the previous one (thank you mono very cool), but it works!
Prefix, postfix and replacer hooks, as well as "watchers" to observe/fire when/what a hook runs/returns
Multiple mods can hook the same method (with optional priority). Each one runs, calls the next, all the way down to the original, modifying the return value, passing data to the next hook or stopping the chain entirely if they want to
The shape/structure for this is kind of hideous at the moment, I need to RE and think through attributes and a proper overall shape, but the core logic is done now and works, and that should hopefully be easy to add in r-right?
There's also some helper functions, like logging, I'll be adding more to hopefully make writing mods a bit easier and to integrate more with the ImGui side of thinks
(UnityExplorer but bad) Lets you browse all loaded classes, call any methods in them, edit their values (e.g. tunables), browse their objects (also a separate heap browser for objects now) and has a janky profiler I'll probably remove for calls and allocs. This needs a fair amount of work as it's kind of been forgotten about while I worked on the mod system and 90% of it could be done way simpler and cleaner...
I have a lot of ideas on where to take this in the future, the sky is really the limit with this tbh, though obviously I need to do some massive cleanups before this is even remotely ready for release...
Obviously, optimization mods, there's a fair amount of areas to improve, especially for Sims3Common (aka the native exe stuff) things as they handle the bulk of the heavy lifting
Ingame IDE/code editing? Ingame scripting?
More convenient bindings and helpers for things and stuff
Make better use of ImGui for mods, maybe for notifications or idk, gameplay elements?
C++ layer (similar to monopatcher) for mods, could maybe native-ify some things?
Make actual mods with it (RPC? multiplayer? something stupid I'm sure), despite doing a lot of work on this, I don't really know half of what the C# side has/does, so I think having some actual mods using this could be helpful and perhaps provide a reason for people to use the... whatever this is
I'm not really sure when or if I'll release this but hopefully by posting this I'll motivate myself to work on it more lmao
thanks 4 reading xoxo, if you have ideas for what I should add/do with this, lmk!