Deep North Compat

版本 v1.0.0·更新於 2026-09-18

Restores two Valheim 1.0 method overloads so mods built for the older game keep working. Needed by some older mods.

模組介紹 作者原文

Deep_North_Compat

A tiny BepInEx patcher for Valheim 1.0 (Deep North). It re-adds two game methods whose signatures 1.0 changed by

adding optional trailing parameters, so mods built for the older game keep working without modifying their files:

| Restored (old) overload | Forwards to (1.0) |

| --- | --- |

| Character.Message(type, msg, amount, icon) | Message(type, msg, amount, icon, log = false) |

| SEMan.AddStatusEffect(hash, resetTime, itemLevel, skillLevel) | same + variant = 0 |

Needed by older mods such as Smoothbrain's Mining, Ranching and ComfortTweaks. Once those authors update, this package

is no longer needed. It does nothing if the game already has the old overload, and a failure in it never stops the game

from starting.

Caveat: adding an overload makes lookups of that method by name only ambiguous, so this shims just these two.

Mods that patch these methods without argument types could be affected.

AI disclosure: this patcher was written with AI assistance (Claude, by Anthropic) and then tested on a live Valheim 1.0 dedicated server.

MIT licensed. Source (the whole patcher):

MistookenCompat.cs

// BepInEx preloader patcher: restores API overloads that Valheim 1.0 (Deep North) removed by ADDING trailing

// parameters, so mods built for the older game keep working without modifying their DLLs. Own code; does not

// redistribute any mod. Each restored overload forwards to the new method, filling the new trailing parameters

// with their declared defaults (or default(T)). Only the whitelisted methods below are touched.

// CAUTION: every added overload makes name-only reflection/Harmony lookups of that method ambiguous.

using System;

using System.Collections.Generic;

using System.Linq;

using Mono.Cecil;

using Mono.Cecil.Cil;

public static class MistookenCompatPatcher

{

// Type, method, old parameter types (full names) that mods still call.

static readonly string Shims = new string

{

new string { "Character", "Message", "MessageHud/MessageType", "System.String", "System.Int32", "UnityEngine.Sprite" },

new string { "SEMan", "AddStatusEffect", "System.Int32", "System.Boolean", "System.Int32", "System.Single" },

// Not shimmed on purpose: Piece.SetCreator, EffectList.Create, PlayerProfile.IncrementStat. Up-to-date mods

// (e.g. PlantEverything) patch those BY NAME; a second overload makes Harmony's lookup ambiguous and breaks them.

};

public static IEnumerable TargetDLLs

{

get { yield return "assembly_valheim.dll"; }

}

public static void Patch(AssemblyDefinition assembly)

{

foreach (string s in Shims)

{

try { AddForwardingOverload(assembly.MainModule, s[0], s[1], s.Skip(2).ToArray()); }

catch (Exception) { / a failed shim must never stop the game from starting / }

}

}

static bool ParamsMatch(MethodDefinition m, string oldTypes, int count)

{

if (m.Parameters.Count!= count) return false;

for (int i = 0; i m.Name == methodName && ParamsMatch(m, oldTypes, oldTypes.Length))) return; // already there

MethodDefinition target = type.Methods.FirstOrDefault(m =>

m.Name == methodName && m.Parameters.Count > oldTypes.Length && ParamsMatch(m, oldTypes, m.Parameters.Count));

if (target == null) return;

MethodAttributes attrs = MethodAttributes.Public | MethodAttributes.HideBySig;

if (target.IsStatic) attrs |= MethodAttributes.Static;

MethodDefinition shim = new MethodDefinition(methodName, attrs, target.ReturnType);

shim.HasThis =!target.IsStatic;

for (int i = 0; i

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
Deep_North_Compat-1.0.0.zip
檔案大小
8.1 KiB
SHA-256
bfa38862f30c07bd797ef395df728e0d795cfc93aef340e1338a38aa9f5f839f
入庫時間
2026-10-09 23:55