政策のMOD制作¶
このページでは、既存の政策を変更する方法と新しい政策を作成する方法を説明します。
政策はcommon/policies/xxx.txtで定義されます。
データ構造¶
potential— 帝国にこの政策を表示するか決定する条件ブロック。政策が表示されなければ、その選択肢はどれも有効になりません。国家スコープ。allow— 帝国がこの政策を変更できるか決定する条件ブロック。バニラでは、戦争中の外交スタンスと戦争哲学の変更を防ぐために使用されます。国家スコープ。option— 政策へ選択肢を追加する項目。複数指定できます。すべての帝国について、少なくとも1つの有効な選択肢が必要です。name— 選択肢の名前と説明を決定するローカライズキー。icon— 選択肢のアイコンを決定するGFX項目への参照。アイコンが表示されるのは外交スタンスだけで、その他の政策選択肢のアイコンは表示されません。potential/valid— 帝国が選択肢を表示/選択できるか決定する条件ブロック。有効な選択肢が偽になった場合、プレイヤー操作の帝国もその選択肢から外され、ai_weightが最も高い有効な選択肢へ切り替えられます。国家スコープ。policy_flags = { flag_xxx flag_yyy }—has_policy_flag条件で確認する文字列の一覧。政策フラグがない選択肢は条件から確認できません。modifier— この選択肢が有効な帝国に適用する補正ブロック。on_enabled/on_disabled— 選択肢が選ばれたとき/別の選択肢へ切り替えられたときに帝国へ実行するエフェクトブロック。国家スコープ。ai_weight— AIは各政策について、重みが最も高い選択肢を常に選びます。プレイヤーの政策もデフォルトではai_weightが最も高い選択肢になります。
バニラの例¶
以下は外交スタンス政策の抜粋です。
diplomatic_stance = {
potential = {
OR = {
is_country_type = default
is_country_type = fallen_empire
is_country_type = awakened_fallen_empire
is_country_type = primitive
is_country_type = awakened_marauders
}
}
option = {
name = "diplo_stance_belligerent"
icon = "GFX_diplomatic_stance_belligerent"
potential = {
OR = {
is_country_type = default
is_country_type = awakened_fallen_empire
}
is_homicidal = no # これらの帝国には独自の派生版がある。
NOT = { has_valid_civic = civic_inwards_perfection }
}
policy_flags = {
diplo_stance_belligerent
}
modifier = {
country_war_exhaustion_mult = -0.1
country_naval_cap_mult = 0.1
country_claim_influence_cost_mult = -0.1
}
ai_weight = {
weight = 10
modifier = {
factor = 0
NOT = { has_country_flag = has_encountered_other_empire }
}
...
}
}
option = {
name = "diplo_stance_cooperative"
icon = "GFX_diplomatic_stance_cooperative"
potential = {
OR = {
is_country_type = default
is_country_type = awakened_fallen_empire
}
is_unfriendly = no # 絶滅主義者でも野蛮な略奪者でもない。
NOT = { has_valid_civic = civic_inwards_perfection }
}
policy_flags = {
diplo_stance_cooperative
}
modifier = {
diplo_weight_mult = 0.25
envoy_improve_relations_mult = 0.5
country_border_friction_mult = -0.5
}
ai_weight = {
weight = 10
modifier = {
factor = 0
NOT = { has_country_flag = has_encountered_other_empire }
}
...
}
}
...
}
関連する動的MOD制作ステートメント¶
条件:
has_policy_flag = <policy flag key>— 帝国が、その政策フラグを持つ有効な政策選択肢をいずれか持っているか確認します。last_changed_policy = <policy key>— 帝国が最後に変更した政策が指定した政策か確認します。On Actionイベントで使用されます。
エフェクト:
# 帝国の政策を変更する。
set_policy = {
policy = <policy key>
option = <policy option name>
cooldown = <yes/no> # 10年間の政策変更クールダウンを設定するか。
}
出典: Stellaris Wiki — Policies modding(原文更新日: 2021年4月19日、版ID 56644)
翻訳日: 2026年9月15日 / 対応バージョン: 2.6
本ページは原文Wiki(CC BY-SA 3.0)の内容を翻訳した非公式ファン翻訳です。