Jump to content

4 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Hi! It is again me, needing some help! Who else would it be? :D

I am trying to sort out issues I am having with my Smart Intersection Builder mod. Some people report really odd behavior, probably caused by the detours that I use in the mod. It may be caused (partially) by the industries DLC, which I unfortunately don't own. Does anyone know if the game DLLs differ in some way when that DLC is installed? In particular the Assembly-CSharp.dll and ICities.dll. Would be somebody with industries so nice and uploaded them for me? (The path should be something like this C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Cities_Data\Managed\ )

By the way, even during the development I faced some problems using Harmony. In Particular, I was unable to unpatch the methods using this. It just would not work.

harmonyInstance.Unpatch(OriginalMethod, HarmonyPatchType.Prefix);

But this method works (at least on my computer):

harmonyInstance.UnpatchAll(HarmonyID);

I will research it a bit more, this is just in case somebody has already encountered this... I never had problems with the old patching library.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

The game DLLs are always the same, no matter which DLCs are installed.

I also found unpatching very unstable and I am now using the second method and the patch annotations:

https://github.com/boformer/UltimateLevelOfDetail/blob/master/TrueLodToggler/TrueLodTogglerMod.cs#L47-L63

Using this setup with OnEnabled/OnDisabled and the correct automation setup allows me to live-replace dll files while the game is running.

  • Like 2

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thanks! I am used to reloading the game every time :D But the file copying script is really good.

    At least the DLCs are the same. Nonetheless it is really hard to reproduce issues as these... I would use the patch annotations as well, but at some point (now that piece of code is gone) I needed to trigger one patch by the other, which is not possible when patching whole assembly simultaneously.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Harmony really seems to cause problems. Some completely unrelated mods (RealTime) started reporting errors just by the presence of my mod, even when it was disabled and no detour launched. I guess it must be because the game is confused by the presence of more Harmony DLLs. Probably I do something wrong. I put the dll next to my mod's. Maybe it is due to the version? I use net 3.5 version of Harmony. For now I went back to the old detour library and everything seems fine...

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections