骑砍2玩了一段时间,到后面内容重复度相当高。。所以想着自己整点乐子,但是又懒得整MOD,所以尝试修改游戏内部文件吧
物品:
物品的属性信息都在Mount & Blade II Bannerlord\Modules\SandBoxCore\ModuleData\spitems下,如weapons.xml。物品的翻译信息则在Mount & Blade II Bannerlord\Modules\SandBoxCore\ModuleData\Languages\CNs\std_spitems_xml-zho-CN.xml里面。我用pycharm编辑这些文件(注意备份),嗯pycharm真好用,打游戏也能用。
想了点好玩的设定,不如整点战锤的设定,大概就是从帝国或者巴托转生来的大魔法师。但是素材(尤其是特效)仅能使用骑砍自带的,所以法力被大幅削弱了(从平衡性考虑也挺合理),目前考虑三种法术(武器),火球、火箭、还有炎爆术(炉石来的)。
在里面已有的物品上修改数据感觉不太合适,所以是直接在weapons.xml里面添加代码段,可以看到从<Item 到 </Item>显然是一个完整的物品段,属性的效果嘛,每一条都写的明明白白的,新增的火球术如下:
<Item id="fire_ball"
name="{=FUCKu9K0}FireBall"
is_merchandise="false"
body_name="bo_projectile_grapeshot_piece_a"
holster_body_name="bo_axe_short"
holster_mesh="stone_holster"
holster_mesh_with_weapon="stone_holster"
mesh="projectile_grapeshot_piece_a"
value="2"
weight="0.1"
appearance="0.1"
Type="Thrown"
item_holsters="throwing_stone:throwing_stone_2">
<ItemComponent>
<Weapon weapon_class="Stone"
ammo_class="Stone"
stack_amount="140"
physics_material="missile"
accuracy="100"
thrust_speed="102"
speed_rating="102"
missile_speed="50"
weapon_length="10"
thrust_damage="70"
item_usage="stone"
rotation="100,30,20"
passby_sound_code="event:/mission/combat/boulder/passby"
trail_particle_name="mangonel_grapeshot_burning_projectile"
rotation_speed="0, -3.0, 0">
<WeaponFlags RangedWeapon="true"
Consumable="true"
AutoReload="true"
UseHandAsThrowBase="true"
CanPenetrateShield="true"
CanKnockDown="true"
Burning="true"
LeavesTrail="true"
AffectsArea="true"
AmmoBreaksOnBounceBack="true" />
</Weapon>
</ItemComponent>
<Flags />
</Item>
name里面那串代码是用于翻译的,在std_spitems_xml-zho-CN.xml里面添加如下行,即可在游戏里找到“火球术”(开作弊模式后全物品里面有,拖几个出来即可)。
<string id="FUCKu9K0" text="火球术"/>
火球的原型是劫匪用的石块。。但是射出去的动画改成了投石机射出去的玩意儿,看起来炫酷一点而已。伤害还是有的thrust_damage="70",而且不能被格挡 CanPenetrateShield="true"。由于设置了AffectsArea="true",容易击中友军。。
然后是火箭:
<Item multiplayer_item="false"
id="fire_arrow"
name="{=FUCKaDbF}Fire Arrow"
prefab="burning_ballista_projectile"
body_name="bo_ballista_projectile_a"
holster_body_name="bo_axe_short"
mesh="ballista_projectile_b"
holster_mesh="quiver"
is_merchandise="false"
weight="0.1"
difficulty="0"
appearance="1"
Type="Thrown"
item_holsters="throwing_stone:throwing_stone_2">
<ItemComponent>
<Weapon weapon_class="Stone"
ammo_class="Stone"
stack_amount="5"
physics_material="burning_ballista"
accuracy="100"
thrust_speed="102"
speed_rating="102"
missile_speed="80"
weapon_length="95"
thrust_damage="100"
thrust_damage_type="Pierce"
item_usage="stone"
flying_sound_code="event:/mission/combat/missile/foley/passby"
trail_particle_name="psys_game_missile_flame"
sticking_rotation="90,0,0"
sticking_position="0,-1.2,0"
center_of_mass="0,0,-0.3">
<WeaponFlags RangedWeapon="true"
Consumable="true"
AutoReload="true"
UseHandAsThrowBase="true"
CanPenetrateShield="true"
MultiplePenetration="true"
CanKnockDown="true"
LeavesTrail="true"
Burning="true"
AffectsArea="true"
AmmoBreaksOnBounceBack="true"/>
</Weapon>
</ItemComponent>
<Flags />
</Item>
原型仍然是石头,一切同理,只不过射出去的mesh改成了弩炮的。因为可以做烤串CanPenetrateShield="true" + MultiplePenetration="true"比较猛所以限制了弹药量stack_amount="5"
炎爆不贴了,太长了,说说兵种和人物的。
兵种:
兵种属性在Mount & Blade II Bannerlord\Modules\SandBoxCore\ModuleData\spnpccharacters.xml里面,其翻译文件为Mount & Blade II Bannerlord\Modules\SandBoxCore\ModuleData\Languages\CNs\std_spnpccharacters_xml-zho-CN.xml
法师总得带点学徒吧?换句话说叫研究生(bushi)。明显,<NPCCharacter 到 </NPCCharacter>是一个完整的兵种段,那就依葫芦画瓢:
<NPCCharacter id="sorcerer"
default_group="Infantry"
is_female="true"
level="30"
name="{=FUCK9CMZ}Sorcerer"
occupation="Soldier"
culture="Culture.khuzait">
<face>
<face_key_template value="BodyProperty.sorcerer" />
</face>
<skills>
<skill id="Athletics"
value="80" />
<skill id="Riding"
value="30" />
<skill id="OneHanded"
value="150" />
<skill id="TwoHanded"
value="30" />
<skill id="Polearm"
value="30" />
<skill id="Bow"
value="30" />
<skill id="Crossbow"
value="30" />
<skill id="Throwing"
value="220" />
</skills>
<Equipments>
<EquipmentRoster>
<equipment slot="Item0"
id="Item.fire_ball" />
<equipment slot="Item1"
id="Item.fire_ball" />
<equipment slot="Item2"
id="Item.battania_noble_sword_3_t5" />
<equipment slot="Item3"
id="Item.fire_arrow" />
<equipment slot="Body"
id="Item.light_tunic" />
<equipment slot="Leg"
id="Item.ladys_shoe" />
<equipment slot="Cape"
id="Item.female_hood" />
</EquipmentRoster>
<EquipmentRoster>
<equipment slot="Item0"
id="Item.fire_ball" />
<equipment slot="Item1"
id="Item.fire_ball" />
<equipment slot="Item2"
id="Item.battania_noble_sword_3_t5" />
<equipment slot="Item3"
id="Item.fire_arrow" />
<equipment slot="Body"
id="Item.light_tunic" />
<equipment slot="Leg"
id="Item.ladys_shoe" />
<equipment slot="Cape"
id="Item.female_hood" />
</EquipmentRoster>
<EquipmentRoster>
<equipment slot="Item0"
id="Item.fire_ball" />
<equipment slot="Item1"
id="Item.fire_ball" />
<equipment slot="Item2"
id="Item.battania_noble_sword_3_t5" />
<equipment slot="Item3"
id="Item.fire_arrow" />
<equipment slot="Body"
id="Item.light_tunic" />
<equipment slot="Leg"
id="Item.ladys_shoe" />
<equipment slot="Cape"
id="Item.female_hood" />
</EquipmentRoster>
<EquipmentSet id="vlandia_troop_civilian_template_t3"
civilian="true" />
</Equipments>
</NPCCharacter>
可以看到使用的武器是之前定义的火球和火箭,非常的猛。因此为了平衡,法师部队是没甲的,一冲就烂。但是法师还是有近战能力的(不近战还能叫法师?)。为什么法师全是女兵is_female="true"?因为我是LSP。
在std_spnpccharacters_xml-zho-CN.xml中添加如下行:
<string id="FUCK9CMZ" text="法师学徒"/>
想要招募自定义兵种还是挺麻烦的,可以选择在原有的兵种树上增加升级分支,这样会导致AI也会升级你自定义的兵种(法师部队对轰)。如果把法师部队放在树的较高位置,会导致部队难以成型,而如果放在树的较低位置,可能会发现某个文化的电脑如culture="Culture.khuzait"(库赛特)全升级了法师。。攻城战我都不敢抬头。另一个方式是自己新建一个树,可以保证没有AI会用你的东西,但是缺点是基础兵种只能输入作弊码获取了,想要从城镇中招募的话,估计得新建一个不同文化才行,工程量略大,不然电脑的法师还是遍地跑。下面是使得1代女剑士能够升级成法师,并且能够在库赛特文化城镇中招募的代码段:
<NPCCharacter id="sword_sister"
default_group="Infantry"
is_female="true"
is_hero="false"
level="6"
name="{=ZK0GXYCx}Sword Sister"
is_basic_troop="true"
occupation="Soldier"
culture="Culture.khuzait"
skill_template="SkillSet.infantry_heavyinfantry_level21_template_skills">
<face>
<face_key_template value="BodyProperty.villager_empire" />
</face>
<skills>
<skill id="Bow"
value="300" />
</skills>
<upgrade_targets>
<upgrade_target id="NPCCharacter.sorcerer" />
</upgrade_targets>
<Equipments>
<EquipmentRoster>
<equipment slot="Item0"
id="Item.pointed_falchion_sword_t4" />
<equipment slot="Leg"
id="Item.strapped_shoes" />
<equipment slot="Body"
id="Item.eastern_studded_leather" />
</EquipmentRoster>
<EquipmentSet id="empire_troop_civilian_template_t1"
civilian="true" />
</Equipments>
</NPCCharacter>
可以看到,upgrade_target 段就是升级目标,注意,这里的升级目标最多两个,不然会导致游戏崩溃。sword_sister是spnpccharacters.xml中自带的兵种,这里没做什么修改,把基础等级改低一些level="6"可以方便升级。spcultures.xml中将某个文化的基础兵种改为:
basic_troop="NPCCharacter.sword_sister"
即可在该文化的城镇中招募女剑士(注意,原来的基础兵种就没法招募了)。
最后,都当上法师了,整个容不过分吧?在Mount & Blade II Bannerlord\Modules\SandBoxCore\ModuleData\sandboxcore_bodyproperties.xml中添加自定义的人物模板。
<BodyProperty id="sorcerer">
<BodyPropertiesMin version="4"
age="24.03"
weight="0.1867"
build="0.0200"
key="0000180FD3143001727664344964DCB3C74E666255A0B4467645B944838F444302504624F577B74800000000000000000000000000000000000000003EB41003" />
<BodyPropertiesMax version="4"
age="32.04"
weight="0.3000"
build="0.0200"
key="0000180FD3143001727664344964DCB3C74E666255A0B4467645B944838F444302504624F577B74800000000000000000000000000000000000000003EB41003" />
</BodyProperty>
这也是spnpccharacters.xml 兵种代码段中那行 <face_key_template value="BodyProperty.sorcerer" />的由来。key="16进制数"就是捏脸数据了,网上随便复制的,这里两个key是一样的,结果是所有人都是一张脸,复制人,如果不同,生成部队时会在上面的key和下面的key之间随机取值。(若要不同,下面的key理应比上面的key值更大,但未验证)
对了,修改完的文件最好也备份一份,不然游戏更新一下全无了,那血压蹭蹭就上去了(别问我怎么知道的)。如果更新导致修改没了,用代码合并工具把修改的部分合并到官方更新的文件里面即可,或者一点点把修改过的部分从备份的文件里面复制到更新的文件里面去。。
仔细一看挺麻烦的,早知道就直接打MOD了。。