Closed janxious closed 6 years ago
Here's my outline so far
Document:
0Harmony.dll
and BattleTechModLoader.dll
files to your BTech Managed folder. This is where things become different from windows. The folder is going to be located at:
/Users/<yourusername>/Library/Application Support/Steam/steamapps/common/BATTLETECH/BattleTech.app/Contents/Resources/Data/Managed/
You can quickly get to folders in Finder by hitting command+shift+g. I suggest pinning the Resources
folder in Finder, because we'll be in there a lot looking at logs and replacing DLLs and various other things. Pinning can be done by dragging the folder into your favorites list in Finder.~/projects
, so for me that looked like:
> cd projects
> git clone git@github.com:Mpstark/BattleTechModLoader.git
.sln
file in your new directory (~/projects/BattleTechModLoader/BattleTechModLoader.sln
).BattleTechModLoaderInjector
and under the "Build" settings, change the C# language version to 7.1.Managed
folder. We will match all the references we see in the project with those so everything will compileBattleTechModLoaderInjector
project, open the options dialog once again and go to the Run -> Configuration -> Default tab. In the "Run in Directory" setting, set it to your Managed folder. /Users/<yourusername>/Library/Application Support/Steam/steamapps/common/BATTLETECH/BattleTech.app/Contents/Resources/
? We need to make a Mods
folder inside that.You don't need to recompile for OSX - it runs just fine with mono. The main issue is that the System.Core.dll for BattleTech is an older .NET release that ends up conflicting with the loader. If you take it out of the way, the injector works.
Here are the steps to get it working. I've tested it with the current release of BattleTech on OSX (1.0.4-280D) and the current release of BTML (0.2.1).
BattleTech.app/Contents/Resources/Data/Managed
brew install mono
cd "Library/Application Support/Steam/SteamApps/common/BATTLETECH/BattleTech.app/Contents/Resources/Data/Managed"
mv System.Core.dll System.Core.dll.temp
mono BattleTechModLoaderInjector.exe
mv System.Core.dll.temp System.Core.dll
cd ../..
mkdir Mods
Then put ModTek and anything else you're using for modding there.
App bundles are pain to navigate to so I highly suggest making the Contents folder a favorite so you can just jump to it.
This is probably simple enough that a bash script could just be provided.
I tried everything there except this step mv System.Core.dll System.Core.dll.temp
, so that may be the critical piece.
Debug can be enabled by this, theoretically:
: defaults write ~/Library/Preferences/unity.Harebrained\ Schemes.BattleTech.plist last_debug_state 1
Then other steps work from https://www.reddit.com/r/BattleTechMods/comments/8ep5gb/did_anyone_manage_to_enable_debug_mode/
I consider this documented enough for my purposes. There are several writeups on reddit and other places for this, so closing, since this was largely a TODO for me originally anyway.
Why do you need help?
All the tutorials on using mods in Battletech are written from the perspective of being in Windows. So we end up with tool recommendations that don't work. Directory structure of Mac application bundle is similar but different enough to need separate documentation. While most people probably are using Windows, it does have a Mac port and making the process of installing mods on Mac will allow for more people to play and extend the game.
What do you need help with?
I can write down how to get things going with BTML and how to get a basic dev env working, but more work could be done finding out •if• the edges are as sharp as I think they are. Specifically getting BTML injector to work is currently a programming task inside VS. There's also exploration that could be done making dnSpy working under wine. Things that don't work (ilspy) should be documented.
What should the helper do to help you
Review the premises I've presented and see if your knowledge of mono/dotnet/etc. can make the process better and easier for new people.
What is your ideal outcome of receiving this help
We end up with a step-by-step guide to getting at least developers able to develop mods on MacOS.
Leave any additional comments here
dnSpy sounds really nice.