War modding:修订间差异

本页面部分全部内容上次核对于3.3版本
(merge from offical wiki)
 
(文本替换 - 替换“Category:Modding]]”为“Category:模组制作]]”)
第197行: 第197行:


{{ModdingNavbox}}
{{ModdingNavbox}}
[[Category:Modding]]
[[Category: 模组制作]]

2022年3月8日 (二) 20:27的版本


This page is about modding Casus Belli and War Goal.

Casus Belli

Casus Belli are defined at "common/casus_belli/xxx.txt".

Data Structure

  • show_in_diplomacy = <yes/no> – Determines should this casus belli be shown in diplomacy view.
  • show_notification = <yes/no> – Determines should this casus belli generate a notification message on granted.
  • aggregated_message_key – Localisation key (e.g. = "MESSAGE_NEW_CASUS_BELLI_TRIAL_OF_ADVANCEMENT_TARGET")
  • potential – A block of Conditions to determine is this casus belli valid. If false, this casus belli can't be added by any mean. (Scopes: ROOT/THIS = casus belli owner, FROM = casus belli target country)
  • 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.
  • destroy_if – A block of Conditions to be checked everyday. If true, this casus belli is automatically disabled. Affects only script added casus belli.

CB Example

The Subjugation casus belli:

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 }
	}
}

Only Awakened Fallen Empires can have this casus belli automatically granted. Regular empires must have it granted via script: add_casus_belli = { type = cb_subjugation who = from days = 360 }

An localisation must be defined with key "casus_belli_xxx:".

War Goal

War Goals are defined at "common/war_goals/xxx.txt".

Data Structure

  • casus_belli = <casus belli key> – Required. Determines the CB to use this War Goal against the target.
  • hide_if_no_cb = <yes/no> – If yes, this war goal is hidden if the required casus belli isn't present.
  • total_war = <yes/no> – Determines is this war goal a total war.
    • Systems occupied by this side will be immediately ceded, making cede_claims and release_occupied_systems_on_status_quo fields irrelevant.
    • 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.
    • 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 种族洁癖 Fanatic Purifiers 种族洁癖Fanatic Purifiers.
  • set_defender_wargoal = <war goal key> – Optional. The defender will be forced to use the specified War Goal.
  • 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.
  • threat_multiplier = <float> – Threat generated by conquering systems and planets is multiplied by this value during a war of this war goal.
  • cede_claims = <yes/occupied_only/no> – Determines should the attacker cede claimed systems from the defenders.
    • 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.
    • if occupied_only, users of this war goal will only cede fully occupied claims only if they didn't lose this war.
    • If no, users of this war goal will never cede claims.
  • 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.
    • 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.
  • 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 创意工坊模组制作教程