本帖最后由 野蛮人y 于 2024-8-4 23:38 编辑
战场延续功能:原战团主角倒下即败退出战场,更改胜负条件,直到最后一个友军倒下才败;
1.添加死亡视角摄像 by MadVader http://forums.taleworlds.com/index.php/topic,134460.0.html中文站转载地址http://bbs.mountblade.com.cn/thread-485769-1-1.html 转载者Brotherdragon
在mission_templates.py前面定义4个摄像功能触发器
common_init_deathcam=()
common_start_deathcam= ()
common_move_deathcam= ()
common_rotate_deathcam= ()
2.主角倒下即退出战场部分更改成如下battle_continuate=(),在mission_templates.py前面定义触发器,
battle_continuate =(
1, 4, ti_once, [(main_hero_fallen)],
[
(assign, "$pin_player_fallen", 1),
(assign, ":allynum", 0),
(assign, ":enemynum", 0),
(get_player_agent_no, ":playagent"),
(agent_get_team, ":ally_team", ":playagent"),
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_team, ":agent_team", ":cur_agent"),
(try_begin),
(teams_are_enemies, ":agent_team", ":ally_team"),
(val_add, ":enemynum", 1),
(else_try),
(val_add, ":allynum", 1),
(try_end),
(try_end),
(try_begin),
(eq,":allynum",0), #all death or wounded
(gt,":enemynum",0),
(assign,"$g_battle_continuation",0), #all death or wounded
(assign,"$g_battle_result",-1), ##战场友军为零输
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(call_script, "script_custom_battle_end"),
(finish_mission),
(else_try),
(ge,":allynum",1), ##还有友军
(gt,":enemynum",0),
(assign, "$g_battle_continuation", 1), #战场继续
(question_box,"str_do_you_want_to_retreat"),
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20, 1),
(assign, "$g_battle_result", 0),
(set_mission_result,-1),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission),
(else_try),
(gt,":allynum",0), #all death or wounded
(eq,":enemynum",0),
(assign,"$g_battle_result",1), ##战场敌军为零胜
(try_end),
]
)
3.把原判败条件注释掉custom_battle_check_defeat_condition更改为如下,每5秒检测一次
#################Yeoman##################
custom_battle_check_defeat_condition = (
5, 0, 0,
[
(main_hero_fallen),
(assign, ":allynum", 0),
(assign, ":enemynum", 0),
(get_player_agent_no, ":playagent"),
(agent_get_team, ":ally_team", ":playagent"),
(try_for_agents,":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_get_team, ":agent_team", ":cur_agent"),
(try_begin),
(teams_are_enemies, ":agent_team", ":ally_team"),
(val_add, ":enemynum", 1),
(else_try),
(val_add, ":allynum", 1),
(try_end),
(try_end),
(try_begin),
(eq, ":allynum", 0),##友军全死伤
(assign,"$g_battle_continuation",0),##结束战场 输
(assign,"$g_battle_result",-1),
(else_try),
(ge, ":allynum", 1),##还有存活友军
(ge, ":enemynum", 1),##还有存活敌军
(assign,"$g_battle_continuation",1),# 战场继续
(assign,"$g_battle_result",0), #胜负未定
(else_try),
(ge, ":allynum", 1),
(eq, ":enemynum", 0),##敌军全死伤 胜
(assign, "$g_battle_won",1),
(assign, "$g_battle_result", 1),
(display_message,"str_msg_battle_won"),
(set_mission_result,1),
(try_end),
],
[
(neq,"$g_battle_result",0),
(call_script, "script_count_mission_casualties_from_agents"),
(call_script, "script_custom_battle_end"),
(finish_mission,0),
])
####################Y#################
上面还有个判胜条件把玩家倒下那句注释掉:
custom_battle_check_victory_condition = (
1, 60, ti_once,
[
(store_mission_timer_a,reg(1)),
(ge,reg(1),10),
(all_enemies_defeated, 2),
# (neg|main_hero_fallen, 0), ##战场延续主角伤敌全死也是胜
4.在战斗场景引用前面定义好的摄像功能、主角倒下胜负判定(这个不要应该也可以,就为了弹出个菜单要不要继续观战)、5秒胜负判定条件,
以野战场景为例, "lead_charge",mtf_battle_mode|mtf_synch_inventory,charge, 注释掉主角倒下即退出战场
# (1, 4, ti_once, [(main_hero_fallen)],
# [
# (assign, "$pin_player_fallen", 1),
# (str_store_string, s5, "str_retreat"),
# (call_script, "script_simulate_retreat", 10, 20, 1),
# (assign, "$g_battle_result", -1),
# (set_mission_result,-1),
# (call_script, "script_count_mission_casualties_from_agents"),
# (finish_mission,0)]),
更改为如下:
##############Yeoman#############
common_init_deathcam,
common_start_deathcam,
common_move_deathcam,
common_rotate_deathcam,
battle_continuate,
custom_battle_check_defeat_condition,
################Y################
|