War modding:修订间差异

本页面部分全部内容上次核对于3.3版本
(文本替换 - 替换“Category:Modding]]”为“Category:模组制作]]”)
(对此页面的部分内容进行了简单汉化)
第1行: 第1行:
{{Version|3.3}}
{{Version|3.3}}


This page is about modding [[Warfare|Casus Belli and War Goal]].
这个界面是关于制作 [[Warfare|Casus Belli (宣战理由) and War Goal (战争目标)]].


== Casus Belli ==
== Casus Belli (宣战理由) ==
Casus Belli are defined at "common/casus_belli/xxx.txt".
宣战理由的定义文件在 "common/casus_belli/xxx.txt".


=== Data Structure ===
=== 数据结构 ===
* '''show_in_diplomacy = <yes/no>''' – Determines should this casus belli be shown in diplomacy view.
* '''show_in_diplomacy = <yes/no>''' – 决定这个宣战理由是否在外交中表现出来。
* '''show_notification = <yes/no>''' – Determines should this casus belli generate a notification message on granted.
* '''show_notification = <yes/no>''' – 确定这个宣战理由是否在得到时生成通知消息。
* '''aggregated_message_key''' – Localisation key <small>(e.g. = "MESSAGE_NEW_CASUS_BELLI_TRIAL_OF_ADVANCEMENT_TARGET")</small>
* '''aggregated_message_key''' – Localisation key (本地化条目) <small>(e.g. = "MESSAGE_NEW_CASUS_BELLI_TRIAL_OF_ADVANCEMENT_TARGET")</small>
* '''potential''' – A block of [[Conditions]] to determine is this casus belli valid. If false, this casus belli can't be added by any mean. <small>([[Scopes]]: <code>ROOT</code>/<code>THIS</code> = casus belli owner, <code>FROM</code> = casus belli target country)</small>
* '''potential''' – 决定这个宣战理由是否有效的条件块。如果条件块判定为假(false),这个宣战理由不会被给予。 (<small>[[Scopes|范围]] <code>ROOT</code>/<code>THIS</code> = casus belli owner, <code>FROM</code> = casus belli target country </small>
* '''is_valid''' – A block of [[Conditions]] to be checked everyday. If true, this casus belli is automatically enabled, otherwise its automatically disabled. This property is irrelevant if this casus belli is added by script.
* '''is_valid''' – 一个每天要检查的[[Conditions|条件块]] 。 如果条件块判定为真(true),则自动启用这个宣战理由,否则禁用这个。如果这个宣战理由是由脚本(script)添加的,那么此属性无关紧要。
* '''destroy_if''' – A block of [[Conditions]] to be checked everyday. If true, this casus belli is automatically disabled. Affects only script added casus belli.
* '''destroy_if''' – 一个每天要检查的[[Conditions|条件块]] 。如果条件块判定为真(true),则自动禁用这个宣战理由,只影响脚本(script)添加的战争原因。


=== CB Example ===
=== 宣战理由例子 ===
The Subjugation casus belli:
要求臣服(subjugation)宣战理由
<syntaxhighlight lang="Haskell">
<syntaxhighlight lang="Haskell">
cb_subjugation = {
cb_subjugation = {
第34行: 第34行:
}
}
}</syntaxhighlight>
}</syntaxhighlight>
Only Awakened Fallen Empires can have this casus belli automatically granted. Regular empires must have it granted via script: <code>add_casus_belli = { type = cb_subjugation who = from days = 360 }</code>
只有'''觉醒的堕落帝国'''才会自动授予这种理由。普通帝国必须通过脚本授予它: <code>add_casus_belli = { type = cb_subjugation who = from days = 360 }</code>


An localisation must be defined with key "<code>casus_belli_xxx:</code>".
本地化必须使用这个条目来定义: "<code>casus_belli_xxx:</code>".


== War Goal ==
== 战争目标 ==
War Goals are defined at "common/war_goals/xxx.txt".
战争目标的定义文件在"common/war_goals/xxx.txt".


=== Data Structure ===
=== 数据结构 ===
* '''casus_belli = <casus belli key>''' – Required. Determines the CB to use this War Goal against the target.
* '''casus_belli = <casus belli key>''' – 必须。决定对目标使用此站长目标的宣战理由。
* '''hide_if_no_cb = <yes/no>''' – If yes, this war goal is hidden if the required casus belli isn't present.
* '''hide_if_no_cb = <yes/no>''' – 如果判定为是,则若没有必要的战争理由,这个战争目标是隐藏的。
* '''total_war = <yes/no>''' – Determines is this war goal a total war.
* '''total_war = <yes/no>''' – 决定这场战争目标是否是一场全面战争。
** Systems occupied by this side will be immediately ceded, making <code>cede_claims</code> and <code>release_occupied_systems_on_status_quo</code> fields irrelevant.
** 被这一方面占领的星系将立即被割让, 让<code>cede_claims</code> <code>release_occupied_systems_on_status_quo</code> 字段变得无关紧要。
** If the other side surrenders, all of their systems will be ceded. AI will never surrender to a total war war goal even if they are allowed to.
** 如果另一方投降,他们所有的星系都将被放弃。即使被允许,AI也不会向全面战争的战争目标投降。
** Since claims make no sense during a total war, vanilla game rules will prevent claims from being made if an empire can only use total war war goals on another empire, such as the case of {{iconify|Fanatic Purifiers}}.
** 由于领土主张在全面战争中没有意义,如果一个帝国只能对另一个帝国使用全面战争的战争目标,那么普通游戏规则将阻止领土索赔,例如 {{iconify|Fanatic Purifiers}}  。
* '''set_defender_wargoal = <war goal key>''' – Optional. The defender will be forced to use the specified War Goal.
* '''set_defender_wargoal = <war goal key>''' – 可选。防御方将被迫使用指定的战争目标
* '''defender_default = <yes/no>''' – If the defender hasn't picked a War Goal in time, it will have the defender default war goal (vanilla is wg_humiliation). If multiple war goals are set to be defender default, the first one scripted in the file is chosen.
* '''defender_default = <yes/no>''' – 如果防御方没有及时选择战争目标,它将让防御方默认战争目标( 默认为羞辱wg_humiliation) 。如果多个战争目标被设置为默认防御方,则选择文件中脚本化的第一个。
* '''threat_multiplier = <float>''' – Threat generated by conquering systems and planets is multiplied by this value during a war of this war goal.
* '''threat_multiplier = <float>''' – 征服星系和行星所产生的威胁会在此战争目标的战争中乘以这个数值。
* '''cede_claims = <yes/occupied_only/no>''' – Determines should the attacker cede claimed systems from the defenders.
* '''cede_claims = <yes/occupied_only/no>''' – 确定进攻方是否应该从防御方手中割让已宣称的星系。
** If yes, users of this war goal will cede all claims from the other side if won the war, and will only cede fully occupied claims if the war ended in a status quo.
** 如果yes,当赢得了战争时,这个战争目标的使用者将放弃来自另一方的所有主张,并且只有在战争以现状结束时才会放弃完全占领的领土宣称。
** if occupied_only, users of this war goal will only cede fully occupied claims only if they didn't lose this war.
** 如果occupied_only,这个战争目标的使用者只有在没有输掉这场战争的情况下才会放弃完全占领的领土。
** If no, users of this war goal will never cede claims.
** 如果no,这个战争目标的使用者永远不会放弃领土宣称。
* '''release_occupied_systems_on_status_quo = <yes/no>''' – If yes, after a status quo, systems occupied will be released as an independent empire if any colony with at least one non-robot sapiant pop present on that planet.
* '''release_occupied_systems_on_status_quo = <yes/no>''' – 如果是,在维持现状之后,当那个星球上有至少一个非机器人的智慧生命pop存在,被占领的星系将作为一个独立的帝国被释放。
** Users of this war goal will always cede fully occupied claims first. If all capable colonies were ceded this way, the occupied systems won't be released.
** 这个战争目标的使用者总是首先放弃完全占领的领土。如果所有殖民地都以这种方式割让,被占领的星系将不会被释放。
* '''surrender_acceptance = <int>''' – Determines AI surrender acceptance.
* '''surrender_acceptance = <int>''' – Determines AI surrender acceptance.
* '''war_exhaustion = <float>''' – War Exhaustion generated during this war is multiplied by this value.
* '''war_exhaustion = <float>''' – War Exhaustion generated during this war is multiplied by this value.

2023年7月31日 (一) 02:49的版本


这个界面是关于制作 Casus Belli(宣战理由) and War Goal(战争目标).

Casus Belli(宣战理由)

宣战理由的定义文件在 "common/casus_belli/xxx.txt".

数据结构

  • show_in_diplomacy = <yes/no> – 决定这个宣战理由是否在外交中表现出来。
  • show_notification = <yes/no> – 确定这个宣战理由是否在得到时生成通知消息。
  • aggregated_message_key – Localisation key(本地化条目) (e.g. = "MESSAGE_NEW_CASUS_BELLI_TRIAL_OF_ADVANCEMENT_TARGET")
  • potential – 决定这个宣战理由是否有效的条件块。如果条件块判定为假(false),这个宣战理由不会被给予。 (范围ROOT/THIS = casus belli owner, FROM = casus belli target country)
  • is_valid – 一个每天要检查的条件块。 如果条件块判定为真(true),则自动启用这个宣战理由,否则禁用这个。如果这个宣战理由是由脚本(script)添加的,那么此属性无关紧要。
  • destroy_if – 一个每天要检查的条件块。如果条件块判定为真(true),则自动禁用这个宣战理由,只影响脚本(script)添加的战争原因。

宣战理由例子

要求臣服(subjugation)宣战理由

cb_subjugation = {
	show_in_diplomacy = yes
	show_notification = yes
	potential = {
		OR = {
			is_country_type = default
			is_country_type = awakened_fallen_empire
		}
		NOT = { is_in_federation_with = from }
		is_subject = no
	}
	is_valid = {
		NOT = { is_overlord_to = FROM }
		is_country_type = awakened_fallen_empire
		NOT = { has_authority = auth_machine_intelligence }
	}
}

只有觉醒的堕落帝国才会自动授予这种理由。普通帝国必须通过脚本授予它: add_casus_belli = { type = cb_subjugation who = from days = 360 }

本地化必须使用这个条目来定义: "casus_belli_xxx:".

战争目标

战争目标的定义文件在"common/war_goals/xxx.txt".

数据结构

  • casus_belli = <casus belli key> – 必须。决定对目标使用此站长目标的宣战理由。
  • hide_if_no_cb = <yes/no> – 如果判定为是,则若没有必要的战争理由,这个战争目标是隐藏的。
  • total_war = <yes/no> – 决定这场战争目标是否是一场全面战争。
    • 被这一方面占领的星系将立即被割让, 让cede_claimsrelease_occupied_systems_on_status_quo 字段变得无关紧要。
    • 如果另一方投降,他们所有的星系都将被放弃。即使被允许,AI也不会向全面战争的战争目标投降。
    • 由于领土主张在全面战争中没有意义,如果一个帝国只能对另一个帝国使用全面战争的战争目标,那么普通游戏规则将阻止领土索赔,例如 种族洁癖 Fanatic Purifiers 种族洁癖Fanatic Purifiers
  • set_defender_wargoal = <war goal key> – 可选。防御方将被迫使用指定的战争目标
  • defender_default = <yes/no> – 如果防御方没有及时选择战争目标,它将让防御方默认战争目标(默认为羞辱wg_humiliation)。如果多个战争目标被设置为默认防御方,则选择文件中脚本化的第一个。
  • threat_multiplier = <float> – 征服星系和行星所产生的威胁会在此战争目标的战争中乘以这个数值。
  • cede_claims = <yes/occupied_only/no> – 确定进攻方是否应该从防御方手中割让已宣称的星系。
    • 如果yes,当赢得了战争时,这个战争目标的使用者将放弃来自另一方的所有主张,并且只有在战争以现状结束时才会放弃完全占领的领土宣称。
    • 如果occupied_only,这个战争目标的使用者只有在没有输掉这场战争的情况下才会放弃完全占领的领土。
    • 如果no,这个战争目标的使用者永远不会放弃领土宣称。
  • release_occupied_systems_on_status_quo = <yes/no> – 如果是,在维持现状之后,当那个星球上有至少一个非机器人的智慧生命pop存在,被占领的星系将作为一个独立的帝国被释放。
    • 这个战争目标的使用者总是首先放弃完全占领的领土。如果所有殖民地都以这种方式割让,被占领的星系将不会被释放。
  • surrender_acceptance = <int> – Determines AI surrender acceptance.
  • war_exhaustion = <float> – War Exhaustion generated during this war is multiplied by this value.
  • show_claims_in_description = <yes/no> – Determines should claims be displayed in description.
  • potential & possible – Trigger block of Conditions to check if this war goal listed / usable against target empire. (Scopes: ROOT/THIS = war goal country, FROM = war goal target country)
  • on_accept & on_status_quoEffect blocks, to be executed after this war goal is accepted (because the opponent surrendered) or when the war is ended in a status quo.
    (Scopes: ROOT/THIS = war goal country, FROM = war goal target country)
    • Use the following conditions to check if any empire was released this way:
exists = last_created_country
last_created_country = { has_country_flag = released_empire }
  • on_wargoal_set – Effect block, to be executed when this war goal is accepted. (Scopes: ROOT/THIS = war goal country, FROM = war goal target country)
  • allowed_peace_offers = { … } – Determines what kind of peace offer is allowed when using this War Goal. Can consist of any number of the following: status_quo, surrender, demand_surrender. Vanilla Total War War Goals use this to prevent surrenders during Total Wars, making them can only end in a status quo or the total destruction of either side.
  • ai_weight = <int>/{ … } – Either a weight number or a block, containing: modifier_rule fields. (Scopes: ROOT/THIS = the acting country, FROM = the targeted country)
  • galactic_empire_joins_defender – Optional. Trigger block of Conditions to check if the members of the Galactic Imperium join the war. (Scopes: ROOT/THIS = war goal country, FROM = war goal target country)

In addition, an icon (at /interface with "GFX_xxx") and a localisation should be defined (with keys "war_goal_xxx:", "war_goal_xxx_desc:").

WG Example

The Subjugation war goal:

wg_subjugation = {
	casus_belli = cb_subjugation

	hide_if_no_cb = no
	release_occupied_systems_on_status_quo = yes

	allowed_peace_offers = {
		status_quo
		surrender
		demand_surrender
	}

	surrender_acceptance = -100

	potential = {
		NOR = {
			has_valid_civic = civic_inwards_perfection
			has_authority = auth_corporate
		}
		has_total_war_cb = no
		NAND = {
			is_galactic_emperor = yes
			from = { is_galactic_community_member = yes }
		}
	}
	possible = {
		custom_tooltip = {
			fail_text = has_claimed_all_systems
			from = {
				is_country_type = default
				any_owned_planet = {
					is_colony = yes
					root = {
						NOT = { has_claim = prev.solar_system }
					}
				}
			}
		}
		custom_tooltip = {
			fail_text = cannot_subjugate_empire_member
			NAND = {
				has_galactic_emperor = yes
				is_galactic_community_member = no
				from = { is_galactic_community_member = yes }
			}
		}
		custom_tooltip = {
			fail_text = "cannot_use_against_custodian"
			from = { is_galactic_custodian = no }
		}
		custom_tooltip = {
			fail_text = "cannot_use_against_emperor"
			from = { is_galactic_emperor = no }
		}
		custom_tooltip = {
			fail_text = "cannot_use_against_btc"
			from = { has_been_declared_crisis = no }
		}
		custom_tooltip = {
			fail_text = pax_galactica_active
			NAND = {
				is_active_resolution = resolution_emperor_pax_galactica
				is_galactic_community_member = yes
				from = { is_galactic_community_member = yes }
			}
		}
	}
	on_accept = {
		hidden_effect = {
			from = {
				add_threat = {
					who = root
					amount = 0.5
				}
			}
		}
		if = {
			limit = { from = { has_been_declared_crisis = no } }
			from = {
				set_subject_of = {
					who = root
					subject_type = vassal
				}
			}
		}
	}

	on_status_quo = {
		if = {
			limit = {
				exists = last_created_country
				last_created_country = {
					has_country_flag = released_empire
				}
			}

			last_created_country = {
				set_subject_of = {
					who = root
					subject_type = vassal
				}
			}
		}
	}

	ai_weight = {
		weight = 10
		modifier = {
			factor = 0
			has_ai_personality_behaviour = wants_tribute
		}
	}
}

On victory, the winners will cede all claims and the primary loser will become a vassal of the primary winner.

  • If winners would cede all colonies of the primary loser, making them nonexistent, this war goal can't be used at the first place. However the attacker can add further claims after they declared the war.

On status quo, Empires of this side will cede all fully occupied claims, then an independent empire is created from all remaining fully occupied enemy systems and it becomes a vassal of the primary winner.


帝国 帝国思潮政府 • 国民理念 • 起源承诺议程传统 • 飞升天赋法令政策遗珍科技自定义帝国
人口 岗位派系
领袖 领袖领袖特质
物种 物种物种特质
行星 行星行星特征 • 轨道矿藏建筑 • 区划行星决议
星系 星系恒星基地巨型结构虫洞 • 星门地图
舰队 舰队舰船 • 部件
地面战 陆军轰炸姿态
外交 外交 • 联邦 • 星海共同体评价修正宣战理由 • 战争目标
事件 事件异常现象特殊项目考古遗址
游玩 游玩定义研究 • 经济游戏开局
动态修改 动态指令效果触发条件作用域修正变量AI
媒体/本地化 Maya 导出器图形肖像旗帜事件图片界面图标音乐本地化
Other 控制台命令存档编辑Steam 创意工坊模组制作教程