Software Inc. Forum

Software Inc. => Modding => Releases => Topic started by: Designer225 on March 06, 2019, 08:02:41 AM

Title: [DLL/WIP] EducationBuff (a.k.a Experimenting With Harmony Patch Library)
Post by: Designer225 on March 06, 2019, 08:02:41 AM
Some people have issues with Alpha 10's changes to education, which went from overpowered to seemingly pointless. I now must admit I sometimes feel the same way too, which is why I spent several hours developing this mod ;D.

After decompiling the game library with dotPeek, I found that the EducationWindow class is responsible for handling employee education, up to and including the (delayed) updating of employees' skills. Having been aware of the Harmony Patch Library by Andreas Pardeike, and having made several failed attempts to use the library for other games (namely Cities: Skylines, though I'm pretty sure loads of people use Harmony more competently than me), I decided to give the library another shot.

Whoo boy, was it easier said than done.

Code mods (including DLL mods) are loaded with the assumption that they would not use external libraries, which is not the case for this mod as I make use of the aforementioned Harmony library. This technical limitation means that the first version of the mod that actually included a ModBehaviour (yeah I am dumb; bite me) fails to load properly because the patch library is not loaded before my mod does, meaning the game freaks out when encountering anything Harmony related. I eventually took the verbose way around and finally managed to get the mod to load... but then Harmony fails to patch anything into the game, as three months of in-game training barely eked out anything. As if the game was not patched at all. Welp, I almost gave up there :(.

So I mostly started over and instead compiled two DLLs, one of which is a stub that would load Harmony and then the other DLL (the actual mod; I labeled it the "Extension") into the game. This time it worked. Six months of in-game training bore fruit through the filling of three-fourths of a programming skill bar 8).

Right now, there are still a couple of kinks to be worked out. Specifically, I still need to find a way to convince the game to load the game at launch rather than having to do command lines, and I am currently looking at ways to give the mods options but I have added options to change how long you need to send employee to school in order to max out a skill you want him/her trained on (default 6). It is not exactly meant for public consumption and is more of a way to demonstrate that the game is moddable in ways other than data modding or code extension modding.

And I doubt this is the right section for this mod, anyway :P

Anyway, this mod allows you to change how long you need to send your employee to school in order to max out a skill of your choosing.

Requirements: Harmony Patch Library (included), Software Inc. Alpha 10 (tested on A10.10)



Change log:

Due to technical complications, I doubt I will be publishing this mod to Steam Workshop any time soon. Nor am I giving anyone the right to do so for the time being. Feel free to contribute to my mod in any way you can, though. Well, anything short of copying my mod without my permission, that is :D.