drok / Harmony-CitiesSkylines

Harmony 2.x assembly provider mod for Cities: Skylines
Other
13 stars 3 forks source link

How to obtain a copy of Harmony for development? #15

Open Vectorial1024 opened 3 years ago

Vectorial1024 commented 3 years ago

Title; because I noticed that the NuGet page seems to be down, and I was wondering whether we should obtain Harmony manually by e.g. cloning this repo somewhere else.

drok commented 3 years ago

Hi Vincent,

I think you are referring specifically to the Harmony port for Cities Skylines, which is what this repo is about. If so, read on. If you are referring to HarmonyLib, which is Andreas Pardeike's library, and not the Cities Skylines specific port, it is available at https://github.com/pardeike/Harmony

I recommend holding for a few days. I am currently working on the first API release, and will upload it to NuGet as soon as it is ready.

The repo does not contain the features I have planned for the first release, and it would not be a good choice to base development on.

Thank you

Vectorial1024 commented 3 years ago

Hi there

Thanks for the reply! Yes I originally was thinking of this repo when asking but couldn't word it quite correctly. CSL Harmony port it is. (I made use of the actual HarmonyLib by pardeike elsewhere before, so I roughly know what is going on about that.)

Now I understand that the NuGet link is a placeholder. Still, does it mean that at this moment the class names etc are still the same as the parent repo? I am just planning in my mind how I might transition to using this flavour of Harmony port at the same time of planning some minor new features to my mod.

Thanks!

drok commented 3 years ago

Hi Vincent,

Yes, the interface is quite similar, there is of course some extra (optional) arguments to indicate that the API should not auto-subscribe if the HarmonyLib is absent.

There is also a new optional call though which you set a set of incompatible mods with yours, which is used by the Harmony mod to prevent loading mods that would later conflict.

The API usage examples will change because they are wrong in the upstream CitiesHarmony, and cause a lot of mod loading issues and conflicts. Eg, if your mod operates in Game mode, or Asset Editor mode, the DoOnHarmonyReady() call must be made in LoadingExtension.OnCreated(), and not in IUserMod.OnEnabled(), which is the opposite of what CitiesHarmony recommends.

The API will be ready for release in a couple of days. I appreciate your patience; I need to make this API as clean as possible, because it will be supported forever. I will never ask mod developers to upgrade to a different API version, although future APIs will have new desireable features which would make an API upgrade desireable when you choose to update your mod in the future.