中世纪2MOD添加单位模型教程
希望对对中世纪以及罗马MOD制作感兴趣的人能有帮助言归正传
首先,我们先学着自己添加一个兵种到游戏里,这是自己做的拜占廷骑马火枪骑士,和摩尔的骆驼火枪还有俄罗斯的哥萨克相比各有千秋吧,威力很大,冲锋起来更是威力惊人。但是事实上,历史上并不存在这种单位,只是MOD添加上去的。
添加方法,
第一步:添加单位文件
进入你的游戏DATA文件夹里,export_descr_unit.txt看到了吧,打开它,当然要先备份一下,把下面一段拷到文件里
type Reiters
dictionary Reiters ; Reiters
category cavalry
class missile
voice_type Heavy
banner faction main_cavalry
banner holy crusade_cavalry
soldier Reiters, 32, 0, 1
mount heavy horse
mount_effect elephant -4, camel -4
attributes sea_faring, hide_forest, hardy, can_withdraw, can_formed_charge, cantabrian_circle, gunpowder_unit, start_not_skirmishing, guncavalry
formation 2, 4.4, 3, 6, 4, square
stat_health 1, 0
stat_pri 20, 3, pistol_bullet, 45, 20, missile, missile_gunpowder, piercing, none, musket_shot_set, 25, 1
;stat_pri_ex 0, 0, 0
stat_pri_attr ap
stat_sec 11, 5, no, 0, 0, melee, melee_blade, piercing, spear, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr no
stat_pri_armour7, 6, 0, metal
;stat_armour_ex 7, 8, 0, 0, 6, 0, 0, metal
stat_sec_armour0, 0, flesh
stat_heat 5
stat_ground 0, -2, -4, 0
stat_mental 9, normal, trained
stat_charge_dist 45
stat_fire_delay0
stat_food 60, 300
stat_cost 1, 920, 250, 120, 95, 920, 4, 230
armour_ug_levels 3, 4
armour_ug_models Reiters, Reiters_ug1
ownership hre
era 2 hre
;unit_info 11, 20, 13
拷进去后我们要做的是对它进行小的改动,使其更真实。
要先改的是type ,因为要做的是拜占廷骑马火枪骑士,我们把它取名叫Byzantine Dragoons,根据游戏的格式要求把它更名为GR_Dragoons
下面是dictionary ,把它更名为 Byzantine_Dragoons
下两行 category class仍然保持不便 cavalry missile 不要改动 voice_type banner faction也不需要改动
下面的soldier很重要,改成soldier GR_Dragoons, 32, 0, 1 注意名字要和上面的一致
下面略过,不要更改。
到stat_pri这行要注意下,这是表示主武器的值,这里的数据从摩尔骆驼的对应行拷过来,当然你可以自己改,主要是摩尔火枪骆驼主武器比较强大。
副武器stat_sec_armour 没做更改,为了让其近战更真实。
最后修改完的范例文件是这样的,需要注意的是兵种名字一定要一样啊,不然跳出没商量
type GR_Dragoons
dictionary GR_Dragoons ; Byzantine Dragoons
category cavalry
class missile
voice_type Heavy
banner faction main_cavalry
banner holy crusade_cavalry
soldier GR_Dragoons, 32, 0, 1
mount eastern armoured horse
mount_effect elephant -4, camel -4
attributes sea_faring, hide_forest, hardy, can_withdraw, can_formed_charge, cantabrian_circle, gunpowder_unit, start_not_skirmishing, guncavalry
formation 2, 4.4, 3, 6, 4, square
stat_health 1, 0
stat_pri 16, 3, musket_bullet, 180, 20, missile, missile_gunpowder, piercing, none, musket_shot_set, 25, 1
;stat_pri_ex 0, 0, 0
stat_pri_attr ap
stat_sec 11, 5, no, 0, 0, melee, melee_blade, piercing, spear, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr no
stat_pri_armour7, 6, 0, metal
;stat_armour_ex 7, 8, 0, 0, 6, 0, 0, metal
stat_sec_armour0, 0, flesh
stat_heat 5
stat_ground 0, -2, -4, 0
stat_mental 9, normal, trained
stat_charge_dist 45
stat_fire_delay0
stat_food 60, 300
stat_cost 1, 920, 250, 120, 95, 920, 4, 230
armour_ug_levels 3, 4
armour_ug_models GR_Dragoons, GR_Dragoons_ug1
ownership byzantium
era 2 byzantium
;unit_info 11, 20, 13
第二步:现在要把它写入数据库文件里
这会用到 data/unit_models/battle_models.modeldb 这个文件。
用记事本打开这个文件,可能东西比较多,看起来很混乱,不急慢慢来。
为谨慎起见,我们拷贝下面一行
7 reiters 1 4 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod0.mesh 121 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod1.mesh 900 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod2.mesh 2500 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod3.mesh 6400 1 3 hre 73 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_hre.texture 76 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_normal.texture 35 unit_sprites/hre_Reiters_sprite.spr 1 3 hre 65 unit_models/AttachmentSets/Final European CB Gun_hre_diff.texture 65 unit_models/AttachmentSets/Final European CB Gun_hre_norm.texture 01 5 Horse 14 MTW2_HR_Pistol 13 MTW2_HR_Spear 1 22 MTW2_HR_Pistol_Primary 1 21 MTW2_HR_spear_Primary 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002 11 reiters_ug1 1 4 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod0.mesh 121 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod1.mesh 900 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod2.mesh 2500 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod3.mesh 6400 1 3 hre 73 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_hre.texture 76 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_normal.texture 39 unit_sprites/hre_Reiters_ug1_sprite.spr 1 3 hre 65 unit_models/AttachmentSets/Final European CB Gun_hre_diff.texture 65 unit_models/AttachmentSets/Final European CB Gun_hre_norm.texture 01 5 Horse 14 MTW2_HR_Pistol 13 MTW2_HR_Spear 1 22 MTW2_HR_Pistol_Primary 1 21 MTW2_HR_spear_Primary 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
7表示 reiters这个词的字母数,下面的 1 4 里 4代表了游戏载入模型时Level of Detail(LCD)层次细节个数,这在你为模型设定层次细节时起作用。
然后是下面一段53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod0.mesh 121 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod1.mesh 900 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod2.mesh 2500 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod3.mesh 6400
这里表示模型的层次细节,
接下去看
1 3 hre 73 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_hre.texture 76 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_normal.texture 35 unit_sprites/hre_Reiters_sprite.spr
1表示模型被游戏载入次数的数目,不理解的话可以这样想,就是只有一个派系可以使用它,改成2就是2个派系。在这后面可以看到只有 HRE 可以使用它,所以它是 HRE 独有, HRE 指 holy Rome Empires 神圣罗马帝国
3是对应派系的字符数,HRE 就是3。
最后
1 3 hre 65 unit_models/AttachmentSets/Final European CB Gun_hre_diff.texture 65 unit_models/AttachmentSets/Final European CB Gun_hre_norm.texture 01 5 Horse 14 MTW2_HR_Pistol 13 MTW2_HR_Spear 1 22 MTW2_HR_Pistol_Primary 1 21 MTW2_HR_spear_Primary 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
这里是模型的基本设定,包括属性,类别等。
好吧 我们把它改成自己想要的值(改法参照上文)
11 GR_Dragoons 1 4 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod0.mesh 121 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod1.mesh 900 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod2.mesh 2500 53 unit_models/_Units/RN_Half_3Q_Plate/reiters_lod3.mesh 6400 1 9 byzantium 79 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_byzantium.texture 76 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_normal.texture 41 unit_sprites/byzantium_Reiters_sprite.spr 1 9 byzantium 65 unit_models/AttachmentSets/Final European CB Gun_hre_diff.texture 65 unit_models/AttachmentSets/Final European CB Gun_hre_norm.texture 01 5 Horse 14 MTW2_HR_Pistol 13 MTW2_HR_Spear 1 22 MTW2_HR_Pistol_Primary 1 21 MTW2_HR_spear_Primary 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002 11 reiters_ug1 1 4 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod0.mesh 121 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod1.mesh 900 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod2.mesh 2500 57 unit_models/_Units/RN_Half_3Q_Plate/reiters_ug1_lod3.mesh 6400 1 9 byzantium 79 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_byzantium.texture 76 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_normal.texture 45 unit_sprites/byzantium_Reiters_ug1_sprite.spr 1 9 byzantium 65 unit_models/AttachmentSets/Final European CB Gun_hre_diff.texture 65 unit_models/AttachmentSets/Final European CB Gun_hre_norm.texture 01 5 Horse 14 MTW2_HR_Pistol 13 MTW2_HR_Spear 1 22 MTW2_HR_Pistol_Primary 1 21 MTW2_HR_spear_Primary 16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
现在你需要创建一个文件 unit_models/_Units/RN_Half_3Q_Plate/textures/rn_half_3q_plate_byzantium.texture并把上面的内容复制进去 一个新的拜占廷火枪模型就做好了。
第三步:模型图色更改
找到unit_models/_Units/RN_Half_3Q_Plate/textures,在这里你可以看到不同势力的模型文件,用文本编辑器打开一个,比如rn_half_3q_plate_england.texture这个文件,把里面的内容开头的48个字节剪切到写字板,稍候要再复制回来,把文件重命名下,从.texture改成.dds,用图片编辑软件例如PHOTOSHOP打开,现在要把图片里的所有代表英格兰的红色部分改成代表东罗马帝国的紫色,使用图片颜色替换就可以,会用photoshop的人应该不会觉的难,然后使用任务栏上的刷子刷吧,很快就完事了。
做完这些后,把刚才剪切的48个字节重新粘贴到文件的开头部分,保存文件,把名字改回.texture,这点很重要。
现在回到游戏,你就可以在个人战役里使用新的单位了。。
有人要问: 那游戏里单位的头像图片怎么办? 我可不想看到的全是农民伯伯。好了,继续第四步就可以了
第四步:
进入data/ui/units/hre文件夹,复制 #reiters.tga 到data/ui/units/byzantium 文件夹下,然后把它改名叫#gr_dragoons.tga,对,就这么简单。你甚至可以自己修改下图片,换换颜色什么的就自由发挥吧。。
第五步:
现在打开export_units.txt文件,注意备份,
找到这段{Reiters} Reiters
{Reiters_descr} Reiters derive their name from the German word reiter, meaning horseman. Generally from German states, Reiters are armed with a pistol and spear, and well protected by plate armour. They often employ the shooting circle tactic to create a continuous cycle of firing and reloading. Once the enemy are softened up by this treatment, they charge in and finish them off the old fashioned way.
{Reiters_descr_short} Effective gunpowder units, Reiters are armed with a pistol and spear, and protected by plate armour.
改成
{GR_Dragoons} Reiters
{GR_Dragoons_descr} Reiters derive their name from the German word reiter, meaning horseman. Generally from German states, Reiters are armed with a pistol and spear, and well protected by plate armour. They often employ the shooting circle tactic to create a continuous cycle of firing and reloading. Once the enemy are softened up by this treatment, they charge in and finish them off the old fashioned way.
{GR_Dragoons_descr_short} Effective gunpowder units, Reiters are armed with a pistol and spear, and protected by plate armour.
111111111111 楼主是超人 顶顶多好 真心顶 很好哦 不错不错 说的非常好 很好哦 楼主是超人 不错不错