3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 446|回复: 1
打印 上一主题 下一主题

[求助] 关于mod《强制建造》崩溃

[复制链接]

1

主题

58

帖子

66

积分

初级玩家

Rank: 2

贡献度
0
金元
655
积分
66
精华
0
注册时间
2018-6-3
跳转到指定楼层
主题
发表于 2024-4-27 06:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
关于mod《大一统.强制制造》,由于作者大大只更新统一版本了,而我只需要强制制造功能,所以想修改一下,但是确实是没啥实力,所以发出来求助,希望各位大佬能救救我
订阅后系统显示错误代码
Exception while loading mod 3021521842.Steam at C:/Users/Azure/Documents/Klei/OxygenNotIncluded/mods/Steam/3021521842. HarmonyLib.HarmonyException: Ambiguous match for HarmonyMethod[(class=BuildingDef, methodname=IsAreaClear, type=Normal, args=undefined)] ---> System.Reflection.AmbiguousMatchException: Ambiguous match found.  at System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00059] in <695d1cc93cca45069c528c15c9fdd749>:0   at System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) [0x0000e] in <695d1cc93cca45069c528c15c9fdd749>:0   at HarmonyLib.AccessTools.DeclaredMethod (System.Type type, System.String name, System.Type[] parameters, System.Type[] generics) [0x00028] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at HarmonyLib.PatchTools.GetOriginalMethod (HarmonyLib.HarmonyMethod attr) [0x0004d] in <6dcb326e4f6442999f701f1e67d0b5a0>:0    --- End of inner exception stack trace ---  at HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x0010f] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at HarmonyLib.PatchClassProcessor.Patch () [0x00093] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at HarmonyLib.Harmony.<atchAll>b__10_0 (System.Type type) [0x00007] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) [0x00014] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <6dcb326e4f6442999f701f1e67d0b5a0>:0   at KMod.UserMod2.OnLoad (HarmonyLib.Harmony harmony) [0x00007] in <3d436e4ec1d5455793674ec559b0cc77>:0   at KMod.DLLLoader.LoadDLLs (KMod.Mod ownerMod, System.String harmonyId, System.String path, System.Boolean isDev) [0x00222] in <3d436e4ec1d5455793674ec559b0cc77>:0   at UnityEngine.Debug.LogError (System.Object message, UnityEngine.Object context) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0   at Debug.LogError (System.Object obj, UnityEngine.Object context) [0x00000] in <3ca21dc18eae422d87255277091f8593>:0   at DebugUtil.LogErrorArgs (UnityEngine.Object context, System.Object[] objs) [0x00000] in <3ca21dc18eae422d87255277091f8593>:0   at DebugUtil.LogException (UnityEngine.Object context, System.String errorMessage, System.Exception e) [0x00000] in <3ca21dc18eae422d87255277091f8593>:0   at KMod.DLLLoader.LoadDLLs (KMod.Mod ownerMod, System.String harmonyId, System.String path, System.Boolean isDev) [0x00000] in <3d436e4ec1d5455793674ec559b0cc77>:0   at KMod.Mod.Load (KMod.Content content) [0x00000] in <3d436e4ec1d5455793674ec559b0cc77>:0   at KMod.Manager.Load (KMod.Content content) [0x00000] in <3d436e4ec1d5455793674ec559b0cc77>:0   at Global.Awake () [0x00000] in <3d436e4ec1d5455793674ec559b0cc77>:0   at UnityEngine.Object.Internal_InstantiateSingleWithParent_Injected (UnityEngine.Object data, UnityEngine.Transform parent, UnityEngine.Vector3& pos, UnityEngine.Quaternion& rot) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0   at UnityEngine.Object.Internal_InstantiateSingleWithParent (UnityEngine.Object data, UnityEngine.Transform parent, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0   at UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Transform parent) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0   at UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Transform parent) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0   at Util.KInstantiate (UnityEngine.GameObject original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.GameObject parent, System.String name, System.Boolean initialize_id, System.Int32 gameLayer) [0x00000] in <3ca21dc18eae422d87255277091f8593>:0   at Util.KInstantiate (UnityEngine.GameObject original, UnityEngine.GameObject parent, System.String name) [0x00000] in <3ca21dc18eae422d87255277091f8593>:0   at LaunchInitializer.Update () [0x00000] in <3d436e4ec1d5455793674ec559b0cc77>:0 Build: U51-600112-VD
作者已开源,mod的原文件已上传 强制建造.zip (5.45 KB, 下载次数: 0) OxygenNotIncludedMod-master.zip (342.51 KB, 下载次数: 2)
其实我有试过自己搞(完全零基础
用作者开源的代码中的强制建造cs文件代码,通过百度缺氧的mod制作教程和al搞成dll,然后弄到本地mod里,游戏确实不崩溃,但是按shift没用搞了一晚上了,我枯了




回复

使用道具 举报

1

主题

58

帖子

66

积分

初级玩家

Rank: 2

贡献度
0
金元
655
积分
66
精华
0
注册时间
2018-6-3
舒服的沙发
 楼主| 发表于 2024-4-27 08:36 | 只看该作者
窒息了,研究了半天发现是因为有两个定义的IsAreaClear,一个是7个参数的private bool IsAreaClear(GameObject source_go, int cell, Orientation orientation, ObjectLayer layer, ObjectLayer tile_layer, bool replace_tile, out string fail_reason)
一个是8个参数的private bool IsAreaClear(GameObject source_go, int cell, Orientation orientation, ObjectLayer layer, ObjectLayer tile_layer, bool replace_tile, bool restrictToActiveWorld, out string fail_reason)
我研究了半天实在是搞不来把[HarmonyPatch(typeof(BuildingDef), "IsAreaClear")]只定义成一个(一点基础都没有),所以我直接把Assembly-CSharp里的7个参数的IsAreaClear全给删了,然后原来的mod就可以用了
但是还是希望有大佬教教我如何把IsAreaClear定义成8个参数的或者7个参数的特定的
回复 支持 1 反对 0

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-4-25 18:49 , Processed in 0.027562 second(s), 17 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表