王国风云2
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问王国风云2百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“宣战理由模组制作”的源代码
←
宣战理由模组制作
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|2.7}} [[Casus Belli]] are quite complex to mod, as lot of flags and scopes are involved. CB life-cycle is the following: * When selecting a target character, <code>can_use</code> is evaluated * If character is eligible, <code>can_use_title</code> is evaluated on the titles in the realm (which titles are scanned depend on CB flags like <code>check_all_titles</code>, <code>check_de_jure_tier</code>,...) * War is declared on the contested title (for AI this also depends on <code>ai_will_do</code> and some hardcoded logic) * <code>on_add</code>, <code>on_add_title</code> and <code>on_add_posttitle</code> are executed. * During the duration of the war, <code>is_valid</code> and <code>is_valid_title</code> are regularly executed to ensure CB remains valid (otherwise war ends as inconclusive) * Each battle and occupied holding contribute to warscore based on CB parameters. Depending on CB type, there might be an additional ticking warscore. * Depending on the output of the war either <code>on_success</code>, <code>on_fail</code> or <code>on_reverse_demand</code> and associated title/posttitle blocks are executed. * A truce is applied between attacker and defender, whose duration depend on value of <code>truce_days</code> ==Special flags== {| class="wikitable sortable" |- !Name !Type !Effect !Example |- |name |key |Localized name to use for this Casus Belli. If a title is involved "Title" is available as a localization scope. |name = CB_NAME_RELIGIOUS |- |war_name |key |Localized name to use for the resulting war. If a title is involved you can use the variable "$OTHER_TITLE$" in your localized text to display the title name. |war_name = WAR_NAME_RELIGIOUS |- |sprite |int |Index of sprite to use for CB icon |sprite = 1 |- |truce_days |int |How long of a truce is enforced after war end. |truce_days = 100 |- |is_permanent |bool |CBs with this set to 'no' can not be declared via the the regular CB interface; they’re instead declared via events, decisions, etc. |is_permanent = no |- |is_independence |bool | |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 <code>hostile_against_others</code>, will cause anyone targeting a realm with a CB with the flag to be hostile towards one another. They will also be hostile to anyone targeting the defender's primary title. Defaults to no. |<code>full_hostility = yes</code> |- |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 |<code>allowed_to_target_tributaries = no</code> |- |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 |Whether occupying any holding of any attacker counts towards war score | |- |check_de_jure_tier |tier |Scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes |check_de_jure_tier = KING |- |check_dejure_duchies |bool |{{sup}} | |- |check_all_titles |bool |If permanent, setting this to true will check against all of someones titles, including vassal held titles | |- |check_all_trade_posts |bool | |check_all_trade_posts = yes |- |check_actor_direct_vassals |bool |{{sup}} | |- |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 is visible to select even if not having enough piety. | |- |prestige_cost |double |Cb is visible to select even if not having enough prestige. | |- |allow_distant |bool |AI parameter |allow_distant = yes |- |attacker_ai_victory_worth | |Minimum warscore for AI to accept surrender from defender. -1 means always accept. |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 |Modifies the warscore gained from battles in wars using that CB |battle_warscore_mult = 0.5 |- |attacker_rel_head_is_ally |bool |The attacker can call his (main) Pope into the war |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. |<code>coalition_threat = no</code> |- |infamy_modifier |float |Multiplied by resulting threat from a war |<code>infamy_modifier = 0.85</code> |- |is_tyranny_cb |bool | |<code>is_tyranny_cb = yes</code> |- |ticking_war_score_multiplier |float | Changes the speed of ticking [[warscore]]. Deprectated since 2.8? |<code>ticking_war_score_multiplier = 5.0</code> |- |att_ticking_war_score_multiplier |float | Changes the speed of ticking [[warscore]] for the attacker |<code>att_ticking_war_score_multiplier = 5.0</code> |- |def_ticking_war_score_multiplier |float | Changes the speed of ticking [[warscore]] for the defender |<code>def_ticking_war_score_multiplier = 5.0</code> |- |max_defender_occupation_score |float | Defines how much [[warscore]] it is possible for the defender to gain by occupying provinces. Defaults to 100. Make sure the CB has ticking [[warscore]] if using this or you could end up with never-ending wars |<code>max_defender_occupation_score = 85</code> |- |max_attacker_occupation_score |float | Defines how much [[warscore]] it is possible for the attacker to gain by occupying provinces. Defaults to 100. Make sure the CB has ticking [[warscore]] if using this or you could end up with never-ending wars |<code>max_attacker_occupation_score = 85</code> |- |max_defender_battle_score |float | Defines how much [[warscore]] it is possible for the defender to gain by fighting battles. Defaults to the defines MAX_WARSCORE_FROM_BATTLE_DEFENDERS |<code>max_defender_battle_score = 50</code> |- |max_attacker_battle_score |float | Defines how much [[warscore]] it is possible for the attacker to gain by fighting battles. Defaults to the defines MAX_WARSCORE_FROM_BATTLE_ATTACKERS |<code>max_attacker_battle_score = 50</code> |- |hostages_block_cb |bool | Defaults to "yes". If set to "no", the defender having close relatives of yours imprisoned does not prevent you from declaring war |<code>hostages_block_cb = no</code> |- |attacker_unoccupied_warscore |bool | If attacker completely unoccupied, attacker will get ticking [[warscore]]. Only works if no title is targetted |<code>attacker_unoccupied_warscore = yes</code> |- |defender_unoccupied_warscore |bool | If defender completely unoccupied, defender will get ticking [[warscore]]. Only works if no title is targetted |<code>defender_unoccupied_warscore = yes</code> |- |capturing_attacker_is_complete_victory |bool | Whether capturing the attacker as a prisoner is considered automatic victory for the defender. Defaults to yes. If set to no, capture instead gives CAPTURED_HEIR_WAR_SCORE [[warscore]] |<code>capturing_attacker_is_complete_victory = yes</code> |- |capturing_defender_is_complete_victory |bool | Whether capturing the defender as a prisoner is considered automatic victory for the attacker. Defaults to yes. If set to no, capture instead gives CAPTURED_HEIR_WAR_SCORE [[warscore]] |<code>capturing_defender_is_complete_victory = yes</code> |- |third_party_portrait |scope |If set, this will override what'd normally show as the third party on the war overview. The scopes are the same as in can_use. |<code>third_party_portrait = event_target:invasion_of_china_claimant</code> |- |sort_priority |int |Can be used to decide the order in which CBs show up in the UI. |<code>sort_priority = 1000</code> |- |diplo_view_region |region |Can be used to override which provinces are highlighted when the CB is selected in the diplomacy view. |<code>diplo_view_region = custom_leon</code> |- |} ==Scopes== For Casus Belli, inside [[scopes]]: *Default scope for character scopes is usually the character who has a case for war. *Default scope for title scopes is the title the war is declared over. *ROOT is the character who has a case for war. (for both titles and character scopes) *FROM is the character who is being declared war on. (for both titles and character scopes) {| class="wikitable sortable" |- !Name !Type !Effect !Example |- |can_use_title |title [[conditions]] |This section sets up the conditions under which the CB can be used (title scope) | |- |can_use |character [[conditions]] |This section sets up the conditions under which the CB can be used (character scope). If valid is displayed in the diplomacy view. | |- |can_use_gui |character [[conditions]] |This sections sets up further conditions to prevent starting the war even though it shows up in the UI. '''Warning''': it will only appear in the tooltip when it evaluates to false ! |can_use_gui = { ROOT = { piety = 100 } } |- |is_valid |character [[conditions]] |This section tests if the CB remains valid. If the test fails, the war ends inconclusively (character scope) | |- |is_valid_title |title [[conditions]] |This section tests if the CB remains valid. If the test fails, the war ends inconclusively (title scope) |is_valid_title = { FROM = { has_landed_title = PREV } } |- |ai_will_do |clause |Warning: using FROM inside ROOT scope is broken until [[Patch 2.5]].<ref>https://forum.paradoxplaza.com/forum/index.php?threads/captain-to-the-rescue.874495/page-8#post-19846143</ref> | |- |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 = { prestige = -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]] |What happens after loss (character scope) (e.g., loss of prestige/piety/gold) |on_reverse_demand = { ROOT = { prestige = -150 } } |- |on_reverse_demand_title |title [[commands]] |What happens after loss (title scope) (e.g., loss of claim) |on_reverse_demand_title = { ROOT = { remove_claim = PREV } } |- |on_reverse_demand_posttitle |character [[commands]] | | |- |on_attacker_leader_death |war [[commands]] |What happens if the leader of the attacking alliance dies |on_attacker_leader_death { end_war = invalid } |- |on_defender_leader_death |war [[commands]] |What happens if the leader of the defending alliance dies | |- |on_thirdparty_death |war [[commands]] | | |- |on_invalidation |war [[commands]] | | |- |} ==Example== <pre> <cb_name> = { name = <cb_name> war_name = <cb_war_name> # other special flags go here # scopes go here } </pre> ==Localisation== * '''<cb_name>''': name of the cassus belli. * '''<cb_war_name>''': name of the war after it starts. * '''<cb_name>_desc''': description of the cassus belli when declaring war. ==References== <references /> [[Category:Modding]] {{ModdingNavbox}}
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:ModdingNavbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Sup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
宣战理由模组制作
。
×
登录
密码
记住登录
加入王国风云2百科
忘记密码?
其他方式登录