首页所有页面

宣战理由模组制作


Casus Belli mod 相当复杂,涉及很多旗帜和瞄准镜。

CB life-cycle is the following:

  • When selecting a target character, can_use is evaluated
  • If character is eligible, can_use_title 是根据领域内的头衔来评估的(扫描哪些头衔取决于CB标志,比如 check_all_titles, check_de_jure_tier,...)
  • 战争是在争夺的头衔上宣战的(对AI来说,这也取决于 ai_will_do and some hardcoded logic)
  • on_add, on_add_title and on_add_posttitle are executed.
  • During the duration of the war, is_valid and is_valid_title 定期执行以确保CB有效(否则战争将以无定论结束)
  • 每场战斗和占领领地都会根据CB参数贡献战争分数。根据CB类型,可能会有额外的战争分数。
  • Depending on the output of the war either on_success, on_fail or on_reverse_demand and associated title/posttitle blocks are executed.
  • 攻击方和防守方之间会达成休战,休战持续时间取决于 truce_days

Special flags

Name Type Effect Example
name key 本Casus Belli的本地化名称。如果涉及标题,“标题”作为本地化范围。 name = CB_NAME_RELIGIOUS
war_name key 这是用来形容随之而来的战争的本地名称。如果涉及标题,你可以在本地化文本中使用变量“$OTHER_TITLE$”来显示标题名称。 war_name = WAR_NAME_RELIGIOUS
sprite int Index of sprite to use for CB icon sprite = 1
truce_days int 战争结束后,停战协议会被执行多久。 truce_days = 100
is_permanent bool CBs设为“no”时,无法通过常规CB接口声明;它们是通过事件、决策等方式宣布的。 is_permanent = no
is_independence bool 允许攻击者召集其他附庸或附庸,如果可能的话。如果宗主国是附庸国,AI使用cbs旗是必需的。 is_independence = yes
hostile_against_others bool Whether others attacking the same target be considered enemies hostile_against_others = yes
full_hostility bool If set to yes in addition to hostile_against_others会使任何针对带有旗帜CB的领域相互敌对。他们也会对任何针对卫冕者主冠军的人表现出敌对态度。默认是“不”。 full_hostility = yes
can_ask_to_join_war bool Whether others ask to join this war can_ask_to_join_war = no
reflect_titleholder_change bool reflect_titleholder_change = no
is_claim_all bool is_claim_all = yes
is_revolt_cb bool Whether CB is considered a revolt against the liege is_revolt_cb = yes
major_revolt bool Whether CB is a major (faction-based) revolt major_revolt = yes
press_claim bool press_claim = yes
allow_whitepeace bool Whether the war can end in a white peace
allowed_to_target_suzerains bool Prevent a tributary to target his suzerain allowed_to_target_tributaries = no
allowed_to_target_tributaries bool Prevent a suzerain to target his tributaries
can_call_allies bool Whether either side can call allies
attacker_can_call_allies bool attacker_can_call_allies = no
defender_can_call_allies bool defender_can_call_allies = no
can_call_vassals bool Whether vassals can be called to assist can_call_vassals = no
can_attack_vassals bool can_attack_vassals = yes
attacker_alliance_occ_warscore bool 占领任何攻击者的领地是否计入战争得分
check_de_jure_tier tier 扫描所有de jure王国,寻找由特定性格的附庸(或以下)持有的县。仅当 is_permanent = 是时才有效 check_de_jure_tier = KING
check_dejure_duchies bool [{{{1}}}]
check_all_titles bool 如果是永久的,将此设置为真时会与某人所有头衔,包括附庸持有的头衔进行核对
check_all_trade_posts bool check_all_trade_posts = yes
check_actor_direct_vassals bool [{{{1}}}]
other_de_jure_claim bool Optimization for de jure claims of vassals other_de_jure_claim = yes
is_holy_war bool is_holy_war = yes
apply_short_occ_mod bool Do not apply the 'recently_conquered' modifier to Holdings apply_short_occ_mod = no
piety_cost double 即使虔诚度不够,Cb依然可见,可以选择。
prestige_cost double 即使声望不够,Cb也能被看到选择。
allow_distant bool AI parameter allow_distant = yes
attacker_ai_victory_worth AI接受防御方投降的最低战争分数。-1 表示永远接受。 attacker_ai_victory_worth = { factor = -1 }
attacker_ai_defeat_worth Minimum warscore for AI to admit defeat to defender attacker_ai_defeat_worth = { factor = 100 }
defender_ai_victory_worth Minimum warscore for AI to accept surrender from attacker attacker_ai_victory_worth = { factor = -1 }
defender_ai_defeat_worth Minimum warscore for AI to admit defeat to attacker defender_ai_defeat_worth = { factor = 100 }
battle_warscore_mult double 修改使用该CB的战争中获得的战争分数 battle_warscore_mult = 0.5
attacker_rel_head_is_ally bool 攻击者可以召集他的(主要)教皇参战 attacker_rel_head_is_ally = yes
display_on_map bool Cb is displayed in the diplomatic map mode (default is yes) display_on_map = no
coalition_threat bool Does not cause a threat increase. Deprecated since 2.8. coalition_threat = no
infamy_modifier float Multiplied by resulting threat from a war infamy_modifier = 0.85
is_tyranny_cb bool is_tyranny_cb = yes
ticking_war_score_multiplier float Changes the speed of ticking warscore. Deprectated since 2.8? ticking_war_score_multiplier = 5.0
att_ticking_war_score_multiplier float Changes the speed of ticking warscore for the attacker att_ticking_war_score_multiplier = 5.0
def_ticking_war_score_multiplier float Changes the speed of ticking warscore for the defender def_ticking_war_score_multiplier = 5.0
max_defender_occupation_score float Defines how much warscore 防御者通过占领省份可以获得收益。默认是100。确保CB有滴答声 warscore 如果用这个,否则你可能会陷入无休止的战争 max_defender_occupation_score = 85
max_attacker_occupation_score float Defines how much warscore 进攻者通过占领省份来获得利益。默认是100。确保CB有滴答声 warscore 如果用这个,否则你可能会陷入无休止的战争 max_attacker_occupation_score = 85
max_defender_battle_score float Defines how much warscore 防御方通过战斗可以获得利益。默认使用定义 MAX_WARSCORE_FROM_BATTLE_DEFENDERS max_defender_battle_score = 50
max_attacker_battle_score float Defines how much warscore 攻击者可以通过战斗获得利益。默认使用定义MAX_WARSCORE_FROM_BATTLE_ATTACKERS的 max_attacker_battle_score = 50
hostages_block_cb bool 默认是“是”。如果设置为“否”,防御方将你的近亲囚禁并不阻止你宣战 hostages_block_cb = no
attacker_unoccupied_warscore bool If attacker completely unoccupied, attacker will get ticking warscore. Only works if no title is targetted attacker_unoccupied_warscore = yes
defender_unoccupied_warscore bool If defender completely unoccupied, defender will get ticking warscore. Only works if no title is targetted defender_unoccupied_warscore = yes
capturing_attacker_is_complete_victory bool 俘虏攻击者是否被视为防御方的自动胜利。默认是可以。如果设置为“否”,则捕获会得到CAPTURED_HEIR_WAR_SCORE warscore capturing_attacker_is_complete_victory = yes
capturing_defender_is_complete_victory bool 俘虏防守者是否被视为攻击方的自动胜利。默认是可以。如果设置为“否”,则捕获会得到CAPTURED_HEIR_WAR_SCORE warscore capturing_defender_is_complete_victory = yes
third_party_portrait scope 如果设置为如此,这会覆盖通常在战争概览中显示的第三方。瞄准镜和can_use一样。 third_party_portrait = event_target:invasion_of_china_claimant
sort_priority int 可以用来决定CBs在界面中出现的顺序。 sort_priority = 1000
diplo_view_region region 在外交视图中选择CB时,可以用来覆盖高亮的省份。 diplo_view_region = custom_leon

Scopes

For Casus Belli, inside scopes:

  • 角色的默认范围不能指望。 用 ROOT、FROM 和 FROMFROM 明确指定你想要的字符。
  • 头衔范围的默认范围是战争宣战的焦点。
  • 根部是那个有战争理由的角色。(包括标题和角色范围)
  • FROM是被宣战的角色。(包括标题和角色范围)
  • FROMFROM是第三方索赔方,使用于other_claim(_)Casus Belli。


Name Type Effect Example
can_use_title title conditions 本节规定了使用CB的条件(标题范围)
can_use character conditions 本节设定了CB的使用条件(字符范围)。

警告:如果此结果判定为错误,CB仍然会 seem 但界面会提示你“尚未选择有效CB”。 或许最好把尽可能多的角色范围要求放在CB里can_use_gui。

can_use_gui character conditions 这个部分设置了更多条件,防止战争爆发,尽管界面上显示了。 can_use_gui = { ROOT = { piety = 100 } }
is_valid character conditions 本节测试CB是否有效。如果测试失败,战争将以无定论结束(角色范围)
is_valid_title title conditions 本节测试CB是否有效。如果测试失败,战争将以无定论结束(标题范围) is_valid_title = { FROM = { has_landed_title = PREV } }
ai_will_do clause Warning: using FROM inside ROOT scope is broken until Patch 2.5.[1]
on_add character commands The immediate effect of declaring war using this CB on_add = { ROOT = { piety = -100 } }
on_add_title title commands
on_add_posttitle character commands
on_success character commands What happens when attacker wins (character scope) on_success = { FROM = { 威望 = -50 } }
on_success_title title commands What happens when attacker wins (title scope) on_success_title = { usurp_title_plus_barony_if_unlanded = ROOT }
on_success_posttitle character commands What happens when attacker wins, after transfer of title
on_fail character commands What happens when attacker white peaces out (character scope)
on_fail_title title commands What happens when attacker white peaces out (title scope)
on_fail_posttitle character commands
on_reverse_demand character commands 失去后会发生什么(角色范围)(例如,声望/虔诚/黄金的丧失) on_reverse_demand = { ROOT = { 声望 = -150 } }
on_reverse_demand_title title commands 失去产权后会发生什么(产权范围)(例如,失去索赔权) on_reverse_demand_title = { ROOT = { remove_claim = PREV } }
on_reverse_demand_posttitle character commands
on_attacker_leader_death war commands 如果进攻联盟的领导者阵亡,会发生什么 on_attacker_leader_death { end_war = invalid }
on_defender_leader_death war commands 如果防守联盟的领导者死了,会发生什么
on_thirdparty_death war commands
on_invalidation war commands

Example

<cb_tag> = {

    name = <cb_name>

    war_name = <cb_war_name>

    

    # other special flags go here



    # scopes go here

}    

Localisation

  • <cb_name>: name of the cassus belli.
  • <cb_war_name>: name of the war after it starts.
  • <cb_tag>_desc: description of the cassus belli when declaring war.

参考资料

相关页面 (60)

Casus BelliCommandsConditionsEU4转档器模组制作Map modePatch 2.5ScopesSteam创意工坊Warscore事件模组制作作用域修正内阁成员模组制作决议模组制作剧本模组制作单位模组制作历史模组制作另类开局模组制作图形模组制作地图外政权模组制作地图模组制作头衔模组制作奇观模组制作宗教模组制作定义宝物模组制作家族模组制作小地图模组制作建筑模组制作指令控制台指令政体模组制作故障排除文化模组制作朝贡国类型模组制作本地化条件模组制作死亡模组制作法律模组制作游戏规则模组制作特质模组制作界面模组制作疾病模组制作目标模组制作盾徽模组制作省份模组制作社团模组制作科技模组制作称号模组制作继承模组制作编辑游戏存档肖像模组制作脚本荣誉头衔模组制作血脉模组制作角色模组制作贸易路线模组制作音乐模组制作验证器