Lethal Company Mod Zehs-StreamOverlaysを例としたMod改変手順
Zehs-StreamOverlaysの手元での改変を試したので、他のMod改変で共通して使える知見として、メモしておきます。 今回は公開を目的としたものではなく、知見も持っていないので、Thunderstoreへの公開は内容に含まれていません。 Zehs-StreamOverlaysのソースコードは、MIT Licenseで配布されており、改変箇所を示すため、一部引用します。 GitHub Thunderstore バージョン情報 以下のバージョンを想定しています。 Lethal Company v72 (Build ID: 18916695) Windows 11 24H2 .NET SDK 9.0.201 BepInEx v5.4.21 ZehsTeam/Lethal-Company-StreamOverlays@8ba3632 BeplnEx プラグイン開発環境の設定 BeplnEx公式チュートリアルの開発環境の設定手順に従って、プラグイン開発環境を構築します。 Basic plugin: Setting up the development environment | BepInEx Docs GitHub: 記事執筆時点のソース@ca4a997 依存関係のセットアップ Thunderstore: LethalConfig v1.4.6 Thunderstore: ShipInventoryUpdated v1.2.13 Thunderstore: CSync v5.0.1 Thunderstoreの「Manual Download」からzipファイルをダウンロードして、中のDLLファイルを取り出します。 そのままビルドに使うと、以下のようなエラーが発生します。 $ DOTNET_CLI_UI_LANGUAGE=en dotnet build --configuration Release Restore complete (0.5s) StreamOverlays failed with 4 error(s) (0.3s) D:\workspaces\lethal_company_modding_workspace\Lethal-Company-StreamOverlays\StreamOverlays\Dependencies\ShipInventoryProxy\Patches\ChuteInteractPatch.cs(10,40): error CS0117: 'ChuteInteract' does not contain a definition for 'SpawnItemClientRpc' D:\workspaces\lethal_company_modding_workspace\Lethal-Company-StreamOverlays\StreamOverlays\Dependencies\ShipInventoryProxy\Patches\ItemManagerPatch.cs(10,38): error CS0117: 'ItemManager' does not contain a definition for 'UpdateCache' D:\workspaces\lethal_company_modding_workspace\Lethal-Company-StreamOverlays\StreamOverlays\Dependencies\ShipInventoryProxy\ShipInventoryProxy.cs(12,39): error CS0122: 'LCMPluginInfo' is inaccessible due to its protection level D:\workspaces\lethal_company_modding_workspace\Lethal-Company-StreamOverlays\StreamOverlays\Plugin.cs(16,18): error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type Build failed with 4 error(s) in 1.1s BepInEx.AssemblyPublicizerを使って、エラーの原因のアクセス制御を無効化したDLLを作成します。これらのDLLはビルド時のみ使用します。 ...