WulfMarius / Better-Placing

Mod improving the way items are placed for The Long Dark
MIT License
4 stars 1 forks source link

Thanks for update! #4

Closed Whisper001 closed 6 years ago

Whisper001 commented 6 years ago

I would like to ask how to start if I want to make my own mod: for example, open cans with a hacksaw, change the attributes of some things and so on. I'm familiar with Unity and C#, but I do not really know where to get information how I can change the game.

WulfMarius commented 6 years ago

Hi!

The first step would be to use a decompiler for .net (like dotpeek) to take a look at how the game actually works. This allows you to identify methods and classes that define/implement the behaviour you want to target.

Then you use Harmony patches to intercept those methods and either completely detour around them or change their parameters/results.

Then you compile all your changes into a DLL and let the ModLoader load your DLL and automatically apply your Harmony patches.

This is obviously very simplified, but really all you need to do to make a first small mod. If you take a look at https://github.com/WulfMarius/Durable-Whetstone/tree/master/src you'll see that this mod doesn't really contain much more than the Harmony patch.

There's also a discord server specifically for modding TLD: https://discord.gg/BwrWFwT Probably easier to get more help there and also more people who can help out if someone's not available.

HTH