• 注册
  • 离线疑难解答 离线疑难解答 关注:1658 内容:19355
    悬赏300金币

    有关模组Gambler赌徒交易商bug问题

  • 查看作者
  • 打赏作者
  • 当前位置: ODDBA社区 > 离线疑难解答 > 正文
  • 3
  • 离线疑难解答
  • 登堂入室

    当打开一个容器时,游戏内未获得物品,控制台输出Unable to add loot to container


    下列是解决问题的方法,但是我看不懂,请求翻译加详细教程。

    我遇到过一个奇怪的情况,当我打开一个赌博容器时,什么都没有弹出,但控制台报告了一行错误 Unable to add loot to container:(这是容器的 id),没有找到奖励当我尝试所有容器时,这种情况出现了好几次,结果都是一样的,所以我mod.ts检查了负责的代码,并全面审查了项目以找出原因。

    根据代码,似乎我打开的所有容器都没有被正确读取,containDetails[1]._name 是从函数 itemHelper.getItem() 返回的数据方案中读取的。我推断 itemCreator.ts 和 itemCreatorHelper.ts 没有将“_name”属性正确写入 SPT 数据库。据我所知,SPT 数据库不会将 _name 写入 item 的数据方案中,除非它被显式添加到 _props 中,因此mod.ts尝试读取 containDetails[1]._name它实际上是在读取 _props._name,除了 _name。但是,在 itemCreatorHelper.ts 的代码中,_props._name 属性是写 value.name 的,而在 MysteryContainerInfo.ts 中,value.name 不是“名称”,而是本地化名称这会导致mod.ts无法识别以 “gambling_” 开头的 “name”,因为在 SPT 数据库中 _props._name 是本地化名称。

    通过添加一行 “_name”: value._name,问题就解决了。我也不太确定我是否正确解决了这个问题,所以我期待听到作者 Hood 的回应,谢谢。

    (顺便说一句,这里只是一个小建议:我强烈建议不要使用“name”来区分项目,而是使用“_id”。尝试使用固定 ID 而不是生成的 ID。

    • 此外,我已将 mod 本地化为中文。我不确定这个错误是否是由这个引起的。

      • 有关模组Gambler赌徒交易商bug问题

        MysteryContainerInfo 中的每个容器都有两个不同的 name 值。“_name”是一个硬编码标识符,我用它来在容器开箱时区分它们,而“name”是您将在游戏中读取的物品的实际本地化名称。每个 Tarkov 项目都有一个“_name”标识符和一个用于本地化的“名称”。无论谁编写了您的中文本地化版本,都不应该更改 MysteryContainerInfo 中的 '_name' 属性,因为这会产生像您这样的错误。

      I have encountered a strange situation that when I open a gambling container, nothing pops out but the console reports a single line of error Unable to add loot to container: (here is id of container), no rewards found. This appears several times as I tried all containers and it just came out the same situation, so I examined the responsible code in mod.ts, and I fully reviewed the project to discover the cause.

      According to the code, it seems that all the containers that I opened are not correctly read, the containDetails[1]._name was read from the data scheme that the function itemHelper.getItem() returned. I infer that the itemCreator.ts and itemCreatorHelper.ts have not write the “_name” property properly into the SPT database. As far as I know, the SPT database does not write _name into the data scheme of item, unless it is explicitly added into _props, and so as mod.ts tried to read the containDetails[1]._nameit is actually reading _props._name except _name. However, in code of itemCreatorHelper.ts the _props._name property was written value.name, and in MysteryContainerInfo.ts the value.name is not the “name” but a localisation name! This causes that the mod.ts cannot recognise the “name” that starts with “gambling_”, since in SPT database the _props._name is a localisation name.

      By adding a line “_name”: value._name, the problem is solved. I'm nor pretty sure whether I have solved the problem properly, so I'm looking forward to hear response from author Hood, thx.

      (btw, here is just a small suggestion: I highly recommend NOT to use “name” as a way to distinguish items but to use “_id”. Try to use a fixed id rather than a generated one.)

      • also I have localised the mod into Chinese. I am not sure if the bug is caused by this.

        • 有关模组Gambler赌徒交易商bug问题

          There are two different name values for each container in MysteryContainerInfo. '_name' is a hard-coded identifier that I use to differentiate containers when they are unboxed, while 'name' is the actual localized name of the item you will read in game. Every Tarkov item has a '_name' identifier and a 'name' for localization. Whoever wrote your Chinese localization should NOT be changing the '_name' properties in MysteryContainerInfo as it will create errors like yours.

        有关模组Gambler赌徒交易商bug问题

      • 3.11.3

      • 已配图

      • 服务端报错

      • 登堂入室

        如果觉得悬赏不到位,可以加v,有偿

        回复
        初窥堂奥


        你直接私信这个MRINF要他的中文本地化版本就行了,他说的意思是发现了这个问题,自己打了个补丁好像能运行了。


        作者的回复是他的代码里“_name”就是“_name” 有自己独特的作用,并不是本地化中常见的用于替换本地化文本的“name”。


        说白了就是本地化的时候动了作者的代码导致mod失效。



      • Combine114514我尝试一下,如果他回复我了我会采纳您的回答,万分感谢!
        拉黑 11小时前 电脑端回复
      • 回复

        请登录之后再进行评论

        登录
        离线疑难解答
      • 今日 3
      • 内容 19355
      • 关注 1658
      • 聊天
        关注 0

        【招募】GRIFFIN TKF项目开工 期待你的加入 || 你是否想加入格里芬书写自己与人形的故事

      • 签到
      • 任务
      • 发布
      • 模式切换
      • 偏好设置
      • 帖子间隔 侧栏位置: