hi我是普信女早上研究给新添加的阵营添加旗帜出了点小问题,然后中文站的帖子我有点太笨了,没看懂,哈哈所以结合了一下,写了一个简单一点的
首先第一步先搭配mod学徒领主更换旗帜的源码
领主更换旗帜(配合国家统一旗帜的功能使用)
https://bbs.mountblade.com.cn/thread-2043949-1-1.html
(出处: 骑马与砍杀中文站论坛)
把mod学徒的这一段代码添加进module_simple_triggers.py
打开module_simple_triggers.py以后在最下面一行】上面添加下面这一段代码
- (24, [
- (try_for_range,":lords",lords_begin,lords_end),#循环所有领主
- (troop_get_slot,":cur_party",":lords",slot_troop_leaded_party),#获取领导的队伍
- (ge,":cur_party",0),#必须有队伍
- (store_faction_of_party, ":cur_faction", ":cur_party"),#获取队伍阵营
- (faction_get_slot,":king",":cur_faction",slot_faction_leader),#获取阵营国王
- (troop_get_slot, ":banner", ":king", slot_troop_banner_scene_prop),#获取国王旗帜
- (troop_set_slot, ":lords", slot_troop_banner_scene_prop, ":banner"), #设置领主旗帜
- (try_end), #结束
- ]),
第二步我们使用大M的这一段代码进行更改
script里搜索Assign banners and renown.
找到了以后然后替换成这一段
- (try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
- (faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
- (faction_get_slot, ":cur_faction_banner", ":cur_faction", slot_faction_banner),
- (val_sub, ":cur_faction_banner", banner_meshes_begin),
- (val_add, ":cur_faction_banner", banner_scene_props_begin),
- (troop_set_slot, ":cur_faction_king", slot_troop_banner_scene_prop, ":cur_faction_banner"),
- (try_end),
- #(assign, ":num_khergit_lords_assigned", 0),
- #(assign, ":num_sarranid_lords_assigned", 0),
- #(assign, ":num_other_lords_assigned", 0),
- (try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
- (this_or_next|troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
- (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_inactive_pretender),
- (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
- (neg|faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
- ## ZZ all lord use their faction banner
- (faction_get_slot, ":cur_faction_banner", ":kingdom_hero_faction", slot_faction_banner),
- (val_sub, ":cur_faction_banner", banner_meshes_begin),
- (val_add, ":cur_faction_banner", banner_scene_props_begin),
- (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":cur_faction_banner"),
- ## ZZ
- #(try_begin),
- # (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate
- # (store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset),
- # (store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"),
- # (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
- # (val_add, ":num_khergit_lords_assigned", 1),
- #(else_try),
- # (eq, ":kingdom_hero_faction", "fac_kingdom_6"), #Sarranid Sultanate
- # (store_add, ":kingdom_6_banners_begin", banner_scene_props_begin, sarranid_banners_begin_offset),
- # (store_add, ":banner_id", ":kingdom_6_banners_begin", ":num_sarranid_lords_assigned"),
- # (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
- # (val_add, ":num_sarranid_lords_assigned", 1),
- #(else_try),
- # (assign, ":hero_offset", ":num_other_lords_assigned"),
- # (try_begin),
- # (gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to other lords
- # (val_add, ":hero_offset", khergit_banners_end_offset),
- # (val_sub, ":hero_offset", khergit_banners_begin_offset),
- # (try_end),
- # (try_begin),
- # (gt, ":hero_offset", sarranid_banners_begin_offset),#Do not add sarranid banners to other lords
- # (val_add, ":hero_offset", sarranid_banners_end_offset),
- # (val_sub, ":hero_offset", sarranid_banners_begin_offset),
- # (try_end),
- # (store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"),
- # (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
- # (val_add, ":num_other_lords_assigned", 1),
- #(try_end),
- #(try_begin),
- # (this_or_next|lt, ":banner_id", banner_scene_props_begin),
- # (gt, ":banner_id", banner_scene_props_end_minus_one),
- # (display_message, "@{!}ERROR: Not enough banners for heroes!"),
- #(try_end),
第三步我们需要定义,如果有说错的地方可以出来,谢谢
打开module_constants.py然后在这个文本的最后一行】上面 添加这一段
banner_map_icon_end= 999
scene_banners_end= 1000
第四步定义完以后打开module_map_icons.py,然后搜索banner_136在他的下面添加一段新的旗帜代码
("map_flag_kingdom_guojun",0,"模型名字", banner_scale,0),
这个只是例子需要自己准备旗帜模型
第五步打开module_meshes.py以后搜索banner_f21在他的下面添加这一段代码
("banner_kingdom_guuojun", 0, "模型名字", 0, 0, 0, -90, 0, 0, 1, 1, 1),##竖着的旗帜模型
这边应该是背景显示用的旗帜,具体我不太清楚哈 因为我看都是竖着的旗帜
第六步打开module_scene_props.py以后搜索("banner_f21", 0, "banner_a15", "0", []),在下面,然后添加这一段
("map_flag_kingdom_guojun", 0, "模型名字", "0", []),
这里应该是领主大厅的旗帜模型
应该是没有漏了,然后最后一步
打开module_scripts.py然后搜索# We assume there are enough banners for all kingdom heroes.
(faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_kingdom_guuojun"),##我这边是1号阵营引用了这段代码
(faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_b"),
(faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
(faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_kingdom_a"),
(faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_d"),
(faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_e"),
可以看到这边大地图引用的旗帜都是以mesh_为主
我们刚才添加的是("banner_kingdom_guuojun", 0, "模型名字", 0, 0, 0, -90, 0, 0, 1, 1, 1),##竖着的旗帜模型这一段,所以我们在这边找到你要更改的阵营,引用这段代码
大概原理好像是你在大地图那边添加模型以后把其他都添加好,然后进入游戏他就会按照顺序给你添加你添加的那个模型(如果说错了,求指正,谢谢)
然后还是要感谢112233lyh的帖子让我才能完善
|