KSP_Chinese_Patches icon indicating copy to clipboard operation
KSP_Chinese_Patches copied to clipboard

[Bug/Fixed]当与 SystemHeat/SystemHeatFissionReactors/SystemHeatFissionEngines/KerbalAtomics 同时存在时,KerbalAtomics 提供的原子火箭的菜单不能打开

Open longifolene06 opened this issue 4 months ago • 1 comments

当与 SystemHeat/SystemHeatFissionReactors/SystemHeatFissionEngines/KerbalAtomics 同时存在时,试图在 VAB 中打开 KerbalAtomics 提供的原子火箭的菜单,会产生一个透明并且行数极少的菜单,其中内容不完整。当在飞行中打开相同的菜单时,没有观察到这个 bug 的发生。

在 bug 发生时,会产生大量如下的报错信息:

[EXC 14:43:19.925] InvalidCastException: Specified cast is not valid.

    BaseField`1[K].GetValue[T] (System.Object host) (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionFloatRange.GetFieldValue () (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionFloatRange.Setup (UIPartActionWindow window, Part part, PartModule partModule, UI_Scene scene, UI_Control control, BaseField field) (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionWindow.AddFieldControl (BaseField field, Part part, PartModule module) (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionWindow.CreatePartList (System.Boolean clearFirst) (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionWindow.UpdateWindow () (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionController.UpdateActiveWindows () (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionController.UpdateEditor () (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UIPartActionController.Update () (at <4b449f2841f84227adfaad3149c8fdba>:0)

    UnityEngine.DebugLogHandler:LogException(Exception, Object)

    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)

    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

根据 Gemini 的分析,导致错误的 ConfigCache 长这样

MODULE

{

name = ModuleSystemHeatFissionEngine

moduleID = reactor

uiGroupDisplayName = 核引擎

systemHeatModuleID = engine

NominalTemperature = 900

CriticalTemperature = 1300

CoreDamageRate = 0.01

ThrottleIncreaseRate = 10

MinimumThrottle = 2

ThrottleDecreaseRate = 20

GeneratesElectricity = true

FuelName = EnrichedUranium

HeatGeneration

{

key = 0 0 0 0

key = 2 110 0 0

key = 100 110 0 0

}

ElectricalGeneration

{

key = 0 0

key = 2 25

}

ispCurve

{

key = 0 0.01

key = 100 1.0

}

INPUT_RESOURCE

{

ResourceName = EnrichedUranium

Ratio = 0.0009

FlowMode = NO_FLOW

}

OUTPUT_RESOURCE

{

ResourceName = DepletedFuel

Ratio = 0.0009

DumpExcess = false

FlowMode = NO_FLOW

}

MODULE

{

name = ModuleSystemHeatFissionFuelContainer

EngineerLevelForTransfer = 3

ResourceNames = EnrichedUranium, DepletedFuel

}

}

MODULE

{

name = ModuleB9PartInfo

}

MODULE

{

name = AttachedOnEditor

active = True

}

MODULE

{

name = ModuleCargoPart

packedVolume = 107301.6

}

}

} 

AI 说其中存在 MODULE 嵌套 MODULE 的情况,而这是因为 SystemHeat 汉化中少了一个括号。但这不重要,因为 SystemHeat 已经有一个自带的汉化了。因此移除汉化中的 SystemHeat 部分即可避免这个 bug 的再次出现。

longifolene06 avatar Jul 16 '26 16:07 longifolene06

经查:

  • 在安装了最小 Mod 的环境下,无法复现。甚至不知道 KerbalAtomics 提供了什么原子火箭的菜单
  • 项目没有任何与 SystemHeat 相关的汉化是缺少了所谓的括号的。

如果所使用 AI 声称寻找到了原因,并同时提供了解决方案,请先自己去验证它,而不是让别人花时间帮你验证。 😅 还有,中文里是有 、 这个符号的,请学会使用它。

tinygrox avatar Jul 17 '26 05:07 tinygrox