求大佬看看我的代码出现了什么问题,我改完之后可汗亲卫变这样了
本帖最后由 la88199820 于 2020-5-21 10:11 编辑我想把可汗亲卫改成拿贵族弓,带两袋箭的巅峰时期的亲卫,但改完之后大部分亲卫还是一袋键,要么两袋箭不带偃月刀,要么带两把偃月刀(顺便帮我看看这是不是贵族弓)
代码我看没问题啊
我自己改的刚铎长弓手,带贵族长弓,两袋穿刺箭,一把巴旦尼亚山地双手剑,在游戏里能正常显示的,唯一区别就是我这个是步兵,你这个有码 本帖最后由 temple910518 于 2020-5-15 23:26 编辑
原版是item3空的吧?你需要把箭袋放item3。原版长杆我记得在item2
同一个id的item slot之间会随机抽取,你现在是item2要么是箭袋,要么是长杆,而item3也是箭袋和长杆,所以就会出现item2和item3同时是箭袋却没有长杆的情况,其他slot同理。
如果你不需要随机装备,建议把你想固定装备的slot写在<equipmentSet></equipmentSet>这个结构的外面,写在外面的slot不会随机,会覆盖那些在<equipmentSet></equipmentSet>结构内的equipment slot
比如
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.brass_lamellar_over_mail" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipment slot="Item0"
id="Item.noble_bow" />
<equipment slot="Item3"
id="Item.steppe_arrows" />
红色部分会百分百覆盖对应栏位的装备,不会有随机性
temple910518 发表于 2020-5-15 23:11
原版是item3空的吧?你需要把箭袋放item3。原版长杆我记得在item2
同一个id的item slot之间会随机抽取,你 ...
我懂了,感谢大佬
temple910518 发表于 2020-5-15 23:11
原版是item3空的吧?你需要把箭袋放item3。原版长杆我记得在item2
同一个id的item slot之间会随机抽取,你 ...
我按照你说的重写了代码,现在没有出现两袋箭不拿刀和两把刀的情况了,但是只有1/3的亲卫带两包箭
沉WC 发表于 2020-5-17 19:26
我按照你说的重写了代码,现在没有出现两袋箭不拿刀和两把刀的情况了,但是只有1/3的亲卫带两包箭
...
确定是写在<equipmentSet>XXXXX</equipmentSet>外面了吗?
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.brass_lamellar_over_mail" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipment slot="Item0"
id="Item.noble_bow" />
<equipment slot="Item3"
id="Item.steppe_arrows" />
完整的看上去应该是这样
<NPCCharacter id="khuzait_khans_guard"
default_group="HorseArcher"
level="31"
civilianTemplate="NPCCharacter.khuzait_troop_civilian_template_t3"
name="{=B7oI7AZG}Khuzait Khan's Guard"
occupation="Soldier"
culture="Culture.khuzait">
<face>
<face_key_template value="NPCCharacter.villager_khuzait" />
</face>
<skills>
<skill id="Athletics"
value="60" />
<skill id="Riding"
value="200" />
<skill id="OneHanded"
value="60" />
<skill id="TwoHanded"
value="60" />
<skill id="Polearm"
value="220" />
<skill id="Bow"
value="260" />
<skill id="Crossbow"
value="25" />
<skill id="Throwing"
value="30" />
</skills>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.brass_lamellar_over_mail" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.brass_lamellar_over_mail" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.brass_lamellar_over_mail" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipment slot="Horse"
id="Item.t2_khuzait_horse" />
<equipment slot="HorseHarness"
id="Item.steppe_half_barding" />
<equipment slot="Item0"
id="Item.noble_bow" />
<equipment slot="Item3"
id="Item.steppe_arrows" />
</NPCCharacter> 代码拿走不谢,亲测两箭袋
</NPCCharacter>
<NPCCharacter id="khuzait_khans_guard"
default_group="HorseArcher"
level="31"
civilianTemplate="NPCCharacter.khuzait_troop_civilian_template_t3"
name="{=B7oI7AZG}Khuzait Khan's Guard"
occupation="Soldier"
culture="Culture.khuzait">
<face>
<face_key_template value="NPCCharacter.villager_khuzait" />
</face>
<skills>
<skill id="Athletics"
value="60" />
<skill id="Riding"
value="200" />
<skill id="OneHanded"
value="60" />
<skill id="TwoHanded"
value="60" />
<skill id="Polearm"
value="220" />
<skill id="Bow"
value="260" />
<skill id="Crossbow"
value="25" />
<skill id="Throwing"
value="30" />
</skills>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Item2"
id="Item.steppe_arrows" />
<equipment slot="Item3"
id="Item.steppe_arrows" />
<equipment slot="Body"
id="Item.eastern_lamellar_armor" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.eastern_lamellar_armor" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0"
id="Item.composite_steppe_bow" />
<equipment slot="Item1"
id="Item.steppe_arrows" />
<equipment slot="Item2"
id="Item.khuzait_polearm_1_t4" />
<equipment slot="Body"
id="Item.eastern_lamellar_armor" />
<equipment slot="Head"
id="Item.spiked_helmet_with_facemask" />
<equipment slot="Leg"
id="Item.khuzait_curved_boots" />
<equipment slot="Gloves"
id="Item.eastern_plated_leather_vambraces" />
<equipment slot="Cape"
id="Item.lamellar_shoulders" />
</equipmentSet>
<equipment slot="Horse"
id="Item.t2_khuzait_horse" />
<equipment slot="HorseHarness"
id="Item.steppe_half_barding" />
</NPCCharacter> ars5217 发表于 2020-5-18 00:55
代码拿走不谢,亲测两箭袋
非常感谢你的帮助,但是我一开始就是这么写的代码,结果出现了极少数人两袋箭不拿刀和一个人拿两把刀的情况,在兵种菜单里显示确实正常,但在实战中会出现各种各样的组合
temple910518 发表于 2020-5-17 23:00
完整的看上去应该是这样
非常感谢你的帮助,现在虽然还是1/3的亲卫带两包箭,但我想可能是我下载的有关士兵抗旗帜mod占用了可汗亲卫的物品栏。最后再次感谢你的帮助,在你的帮助下我学到了一些东西
沉WC 发表于 2020-5-18 15:09
非常感谢你的帮助,现在虽然还是1/3的亲卫带两包箭,但我想可能是我下载的有关士兵抗旗帜mod占用了可汗亲 ...
那就是了,你需要在那个mod的代码基础上进行修改。你会发现那个旗帜mod本质上也是设置了很多套equipmentSet进行随机装备
或者你也可以换用bear my banner这个mod,并进行好相关设置,这个mod是通过脚本实现的,理论上兼容其他修改兵种的mod
temple910518 发表于 2020-5-18 20:10
那就是了,你需要在那个mod的代码基础上进行修改。你会发现那个旗帜mod本质上也是设置了很多套equipmentS ...
删了旗帜类mod就解决了,不过试了你推荐的mod发现可汗亲卫干脆连弓都不拿了,提着偃月刀就上了
沉WC 发表于 2020-5-19 17:17
删了旗帜类mod就解决了,不过试了你推荐的mod发现可汗亲卫干脆连弓都不拿了,提着偃月刀就上了
...
在设置里取消远程单位拿旗帜。这个mod有不少选项,兵种种类、等级、旗手比例等等都可以设置。按自己的喜好来
页:
[1]