模组兼容层 / Mod Compat Layer 预览图

杀戮尖塔 2 (Slay the Spire 2)

模组兼容层 / Mod Compat Layer

Tools & APIs

最后更新 2026/09/19文件 443.8 KBID 3803872744

模组简介

模组兼容层 游戏更新后,一些模组会在另一个版本上悄悄坏掉:出牌时卡住,或者伤害加成不再生效却不报错。本模组在游戏加载其他模组时自动修补这类问题,不需要原作者重新编译。两个方向都支持: • 旧模组跑在新版本上(例如按正式版编译的模组跑在 beta 分支) • 新模组跑在旧版本上(例如按 beta 编译的模组跑在正式版 1.0) 它修什么 加载每个模组的 DLL 之前,找出对当前游戏里已经不存在的方法的调用;能安全修补的,在内存中改写后再加载: • 方法的参数变多或变少 —— 补上默认值,或去掉旧版本还不接收的参数(例:AttackCommand.FromCard 的 CardPlay 参数) • 返回值变成了子类型 —— 改为调用新方法(例:CardCmd.Exhaust 从 Task 变为 Task ) • 游戏的钩子方法参数变化,导致模组的 override 不再生效 —— 补一个游戏当前签名的转发(例:ModifyDamageAdditive / Multiplicative / Cap 的 CardPlay 参数) • 游戏不传给钩子的 CardPlay —— 从当前正在进行的出牌中取回;伤害预览时为空,与新版本的行为一致 只改动在当前游戏里确实解析不了的部分,已经适配的模组原样加载。硬盘上的模组文件不会被修改。 使用 • 订阅并启用即可,不依赖 BaseLib。 • 它必须比要修补的模组先加载。首次启用时它会把自己移到加载顺序最前, 重启一次游戏 后生效。 • 在日志 %AppData%\SlayTheSpire2\logs\godot.log 里搜索 ,可以看到修补了哪些模组、哪些位置。 • 联机时所有玩家都需要安装,因为它会改变其他模组的行为。 • 与 CVC(跨版本兼容补丁)功能重叠:检测到 CVC 启用时,本模组自动停用,交给 CVC 处理。两者选一个即可。 局限 只能处理上面几类改动。某个版本里根本不存在的类型或功能(例如 beta 新增的系统)补不出来,会在日志中记为 cannot repair,模组照常加载。模组自身的逻辑 bug 不在修补范围内。 ━━━━━━━━━━━━━━━━━━━━ Mod Compat Layer After a game update, some mods quietly break on the other version: cards hang when played, or damage bonuses stop applying without any error. This mod repairs those breaks while the game loads other mods, with no recompiling needed from their authors. Both directions are supported: • older mods on a newer game (e.g. mods built for the public branch running on beta) • newer mods on an older game (e.g. mods built for beta running on the public 1.0 branch) What it repairs Before each mod DLL is loaded, it looks for calls to members that do not exist in the running game and, where a safe repair exists, rewrites them in memory: • A method has more or fewer parameters: defaults are supplied, or arguments the older game does not take are dropped (e.g. the CardPlay parameter of AttackCommand.FromCard) • A return type became a subtype: the call is retargeted (e.g. CardCmd.Exhaust went from Task to Task ) • A game hook's parameters changed, so a mod's override no longer overrides it: a forwarding override with the game's current signature is added (e.g. the CardPlay parameter of ModifyDamageAdditive / Multiplicative / Cap) • A CardPlay the game does not pass to hooks is recovered from the play in progress; it is null during damage previews, as on the newer game Only references that fail to resolve are touched; mods already built for the current game load unchanged. Mod files on disk are never modified. Usage • Subscribe and enable. BaseLib is not required. • It must load before the mods it repairs. On first enable it moves itself to the front of the load order; restart the game once . • Search %AppData%\SlayTheSpire2\logs\godot.log for to see which mods were repaired and where. • In multiplayer, every player needs it, since it changes how other mods behave. • It overlaps with CVC (Cross-Version Compatibility Patch): when CVC is enabled, this mod stays inactive and leaves the job to CVC. Use one or the other. Limits Only the kinds of change above. Types or features that do not exist at all in a game version (such as systems new in beta) cannot be supplied; they are logged as "cannot repair" and the mod loads as before. Bugs in a mod's own logic are out of scope. Includes Mono.Cecil (MIT license).

详情图片

条目信息

所属游戏
杀戮尖塔 2 (Slay the Spire 2)
创意工坊 ID
3803872744
文件名
3803872744.bin
文件大小
443.8 KB
最后更新
2026/09/19
内容版本
v1789824261-8c232c21c8a557c3
作者与来源
由原作者发布于 Steam 创意工坊。本站不改变署名,作者信息与原始内容请以 Steam 原始页面 为准。