请问:护甲的json中,对于多个覆盖部位的属性能不能一起定义?

这几天装kenan的mod包,放在0.F-1下有很多mod都报“armor”域不识别的错误,并且护甲没有正确覆盖部位(甚至连写在外面的伤害防护都没了)。

对比了一下dda的json和mod的json,发现现在版本dda中护甲的写法是:

"armor_portion_data": [
{ "covers": [ "head" ], "coverage": 100, "encumbrance": 30 },
{ "covers": [ "eyes" ], "coverage": 100, "encumbrance": 5 },
{ "covers": [ "mouth" ], "coverage": 100, "encumbrance": 10 }
],

这样,累赘度和覆盖率是每个覆盖部位分开定义的。

 

而出问题的mod的写法则是一起定义的,虽然写法确实是新版本这种通过一个域来定义,而不是像旧版本一样一行行写在外面。

"armor": [
{"encumbrance": 13,"coverage": 40,"covers": ["arm_l","arm_r"]}
]

 

请问这里的问题是:多个覆盖部位应该对每个部位都定义一次,还是说可以写在一起,但是中括号里的值应该按顺序对应?还是说需要先在别的json里写个命名为”armor”的“类似于抽象类的东西”来定义个格式出来?

第一次修直接从报错修成跳回主菜单了,还是来问问再修吧。

头像
Author: Bicco
Eventilefluorescence
CKRainbow
3 条评论
Eventilefluorescence
Eventilefluorescence 2021年9月7日
| | |
虽然n天过去了,不过写模组之前先看 github.com/CleverRaven/Cataclysm-DDA/blob/04215562284514e551f1f73d9b7e5ce9badc9384/doc/JSON_INFO.md json info里面写了 Armor Portion DataEncumbrance and coverage can be defined on a piece of armor as such: "armor": [{"encumbrance": [ 2, 8 ],"coverage": 95,"covers": [ "torso" ]},{"encumbrance": 2,"coverage": 80,"covers": [ "arm_r", "arm_l" ]}]Encumbrance(integer, or array of 2 integers) The value of this field (or, if it is an array, the first value in the array) is the base encumbrance (unfitted) of this item. When specified as an array, the second value is the max encumbrance - when the pockets of this armor are completely full of items, the encumbrance of a non-rigid item will be set to this. Otherwise it'll be between the first value and the second value following this the equation: first value + (second value - first value) * non-rigid volume / non-rigid capacity. By default, the max encumbrance is the encumbrance + (non-rigid volume / 250ml). Coverage(integer) What percentage of time this piece of armor will be hit (and thus used as armor) when an attack hits the body parts in covers. Covers(array of strings) What body parts this section of the armor covers. See the bodypart_ids defined in body_parts.json for valid values. Alternately, every item (book, tool, gun, even food) can be used as armor if it has armor_data: "type" : "TOOL", // Or any other item type... // same entries as for the type (e.g. same entries as for any tool),"armor_data" : { // additionally the same armor data like above"warmth" : 10,"environmental_protection" : 0,"material_thickness" : 1,"armor": [{"covers" : [ "foot_l", "foot_r" ],"encumbrance" : 0,"coverage" : 80,}],"power_armor" : false} 懒得改格式了凑合看看吧,可以写在一起的。cdda报错是有详细信息的,建议你直接贴报错信息。的说
CKRainbow
CKRainbow 2021年8月24日
| | |
可能是因为key应该写armor_portion_data