コンテンツにスキップ
Stellaris v2.6 対応 翻訳

伝統のMOD制作

旧バージョンの資料

原文はゲームバージョン2.6向けです。現在のファイル構造やキーとは異なる可能性があります。

伝統とアセンションパークはStellarisのメカニクスです。

伝統ツリー

伝統ツリーはcommon/tradition_categories/xxx.txtで定義します。

データ構造

  • tree_template: 伝統を配置するテンプレートです。common外のinterfaceフォルダーにある.guiファイルで定義します。バニラの全テンプレートはinterface/topbar_traditions_view.guiにあります。
  • adoption_bonus: この伝統ツリーを採用したときに有効化する伝統です。
  • finish_bonus: この伝統ツリーを完成したときに有効化する伝統です。アセンションパークスロットを与えるのが基本です。
  • traditions: この伝統ツリーに含める伝統の集合です。
  • tradition_swap: 伝統の差し替え定義です。現在は伝統ツリーではなく、各伝統側で使います。
    • name: この差し替えを適用したときに使う代替ローカライズキーです。
    • trigger: 差し替えを適用するかを決める条件ブロックです(国家スコープ)。
    • weight: 複数の差し替えが有効なら、重みが最大のものを使います。

伝統ツリー自体にai_weightはありません。AIは、各伝統ツリー採用効果にあるai_weightに基づいてツリーを選びます。

ローカライズキー

tradition_example:0 "Example"
tradition_example_desc:0 "Let me show you an example."
tradition_example_swap:0 "Example Swapped"
tradition_example_swap_desc:0 "Let me show you a swapped example."

伝統ツリーの例

外交の伝統ツリーです。

tradition_diplomacy = {
    tree_template = "tree_11_12"
    adoption_bonus = "tr_diplomacy_adopt"
    finish_bonus = "tr_diplomacy_finish"
    traditions = {
        "tr_diplomacy_secure_shipping"
        "tr_diplomacy_insider_trading"
        "tr_diplomacy_the_federation"
        "tr_diplomacy_entente_coordination"
        "tr_diplomacy_open_markets"
    }

    potential = {
        NOR = {
            has_valid_civic = civic_inwards_perfection
            has_valid_civic = civic_hive_devouring_swarm
        }
    }

    ai_weight = {
        factor = 5
        modifier = { factor = 10 has_federation = yes }
        modifier = { factor = 4 has_ethic = ethic_xenophile }
        modifier = { factor = 6 has_ethic = ethic_fanatic_xenophile }
        modifier = {
            factor = 0
            OR = { is_xenophobe = yes is_homicidal = yes }
        }
        modifier = { factor = 0.5 is_gestalt = yes }
    }
}

動的な名称

帝国によって伝統ツリー名が変わっても、ゲーム内テキストが常に「外交の伝統」と表示する場合があります。この問題を処理するスクリプトローカライズGetDiplomacyTraditionNameがあります。詳細は動的MOD制作を参照してください。

伝統

伝統はcommon/traditions/xxx.txtで定義します。伝統キーは必ず小文字で命名してください。

データ構造

  • possible: 帝国がこの伝統を採用できるかを調べる条件ブロックです。同じツリーの先行伝統をすべて採用したかの確認によく使います。
  • modifier: 採用した帝国へ適用する補正ブロックです。他のゲームオブジェクトと異なり、ここに記述した補正から伝統のツールチップは自動生成されません。
  • on_enabled: 採用時に実行する効果ブロックです。
  • tradition_swap: 伝統の差し替えです。
    • name: 差し替え時に使う代替キーです。
    • inherit_effects = <yes/no>: noなら代替の効果説明ローカライズキーを使い、基本のmodifierを無視します。
    • inherit_icon = <yes/no>: noなら代替アイコンを使います。
    • inherit_name = <yes/no>: noなら名称と説明に代替ローカライズキーを使います。
    • trigger: 適用条件です(国家スコープ)。
    • modifier: 基本のmodifierに代わって使う補正です。
    • weight: 複数候補のうち最大のものを選びます。
  • ai_weight: AIがこの伝統を採用する可能性です。

ローカライズキー

tr_example_the_example:0 "The Example"
tr_example_the_example_desc:0 "Effect description of this tradition."
tr_example_the_example_delayed:0 "Flavor text of this tradition."
tr_example_the_example_swapped:0 "The Swapped Example"
tr_example_the_example_swapped_desc:0 "Effect description of this swapped tradition."
tr_example_the_example_swapped_delayed:0 "Flavor text of this swapped tradition."

アイコン定義

次の形式のGFXタイプをinterface/xxx.gfxで定義しないと、伝統にアイコンは表示されません。xxx.ddsは任意の場所に置けますが、gfx/interface/icons/traditions/を推奨します。

spriteTypes = {
    spriteType = {
        name = "GFX_tr_example_the_example"
        textureFile = "gfx/interface/icons/traditions/tr_example_the_example.dds"
    }
}

関連するスクリプト文

  • has_tradition = <キー>: 差し替えの有無を問わず、この伝統を持つか調べる条件です。基本伝統だけを指定します。
  • has_active_tradition = <キー>: 指定キーそのものが有効か調べます。基本伝統と差し替え伝統のどちらも、正しいキーなら調べられます。
  • has_non_swapped_tradition = <キー>: 基本伝統を持ち、差し替えられていないか調べる旧条件です。現在はhas_active_traditionへ統合され、使われません。
  • has_swapped_tradition = <キー>: 指定の差し替え伝統になっているか調べる旧条件です。現在はhas_active_traditionへ統合され、使われません。
  • add_tradition = <キー>: 帝国へ指定伝統を与える効果です。基本伝統だけを指定します。

伝統の例

外交の伝統「連邦」です。

tr_diplomacy_the_federation = {
    # 連邦メカニクスをアンロック
    modifier = { envoys_add = 1 }

    tradition_swap = {
        name = tr_adaptability_dietary_enrichment
        inherit_effects = no
        inherit_icon = no
        inherit_name = no
        trigger = {
            OR = {
                has_valid_civic = civic_fanatic_purifiers
                has_valid_civic = civic_inwards_perfection
                has_valid_civic = civic_hive_devouring_swarm
                # Federationsがあれば野蛮な略奪者は軍事同盟と覇権体制を作れる
                AND = {
                    has_valid_civic = civic_barbaric_despoilers
                    has_federations_dlc = no
                }
            }
            is_lithoid_empire = no
        }
        modifier = { country_food_produces_mult = 0.10 }
        weight = { factor = 1 }
    }

    tradition_swap = {
        name = tr_adaptability_recycling
        inherit_effects = no
        inherit_icon = no
        inherit_name = no
        trigger = {
            OR = {
                has_valid_civic = civic_fanatic_purifiers
                has_valid_civic = civic_inwards_perfection
                has_valid_civic = civic_hive_devouring_swarm
                AND = {
                    has_valid_civic = civic_barbaric_despoilers
                    has_federations_dlc = no
                }
            }
            is_lithoid_empire = yes
        }
        modifier = { planet_building_refund_mult = 0.15 }
        weight = { factor = 1 }
    }

    tradition_swap = {
        name = tr_versatility_universal_compatibility
        inherit_effects = no
        inherit_icon = no
        inherit_name = no
        trigger = { is_machine_empire = yes }
        modifier = { country_synthetic_trust_cap_add = 50 }
        weight = { factor = 1 }
    }

    ai_weight = { factor = 1000 }
}

伝統ツリー採用効果

採用効果も伝統ですが、アイコンは不要で、ローカライズキーの形式が異なります。

tr_example_adopt:0 "Example Traditions"
tr_example_adopt_desc:0 "$tradition_example_desc$\n\n$tr_example_adopt_effect$\n\n$tr_example_finish_effect$"
tr_example_adopt_effect:0 "§E$TRADITIONS_ADOPT$:§!\nDescription of Adoption Effects of this Tradition Group."

tr_???_adopt_descは、伝統ツリーへカーソルを合わせたとき、採用効果と完成効果を表示するツールチップです。ゲーム内では次の構成になります。

例を紹介します。

採用効果
この伝統ツリーの採用効果の説明。

完成効果
例の伝統をすべて採用すると何かが起こります。さらに、アセンションパークスロットを1つアンロックします。

外交の採用効果の例です。

tr_diplomacy_adopt = {
    modifier = {
        diplomacy_upkeep_mult = -0.5
        pop_growth_from_immigration = 0.10
    }

    tradition_swap = {
        name = tr_adaptability_adopt
        inherit_effects = no
        inherit_icon = yes
        inherit_name = no
        trigger = {
            OR = {
                has_valid_civic = civic_fanatic_purifiers
                has_valid_civic = civic_inwards_perfection
                is_hive_empire = yes
                has_valid_civic = civic_barbaric_despoilers
            }
        }
        modifier = { pop_housing_usage_mult = -0.10 }
        weight = { factor = 1 }
    }

    tradition_swap = {
        name = tr_versatility_adopt
        inherit_effects = no
        inherit_icon = yes
        inherit_name = no
        trigger = { is_machine_empire = yes }
        modifier = { planet_pop_assemblers_upkeep_mult = -0.10 }
        weight = { factor = 1 }
    }

    ai_weight = {
        factor = 10
        modifier = { factor = 5 has_federation = yes }
        ...
    }
}

伝統ツリー完成効果

完成効果も伝統ですが、さらにai_weightも不要です。原則としてascension_perks_add = 1の補正を持たせます。

tr_example_finish:0 "Example Tradition Finished"
tr_example_finish_effect:0 "§E$TRADITIONS_FINISH$:§!\nAdopting all $tr_example_adopt$ will do something."

完成効果で得るアセンションパークスロットは、ハードコードされたTRADITIONS_FINISH_APが説明へ追加されるため、ローカライズ内で説明する必要はありません。

外交の完成効果の例です。

tr_diplomacy_finish = {
    modifier = {
        ascension_perks_add = 1
        country_trust_cap_add = 50
        country_trust_growth = 0.33
    }

    tradition_swap = {
        name = tr_adaptability_finish
        inherit_effects = no
        inherit_icon = yes
        inherit_name = yes
        trigger = {
            OR = {
                has_valid_civic = civic_fanatic_purifiers
                has_valid_civic = civic_inwards_perfection
                is_hive_empire = yes
                has_valid_civic = civic_barbaric_despoilers
            }
        }
        modifier = { ascension_perks_add = 1 }
        weight = { factor = 1 }
    }

    tradition_swap = {
        name = tr_versatility_finish
        inherit_effects = no
        inherit_icon = yes
        inherit_name = yes
        trigger = { is_machine_empire = yes }
        modifier = {
            planet_building_refund_mult = 0.5
            ascension_perks_add = 1
        }
        weight = { factor = 1 }
    }
}

アセンションパーク

アセンションパークはcommon/ascension_perks/xxx.txtで定義します。

データ構造

  • potential: 選択メニューへ表示するかを決める条件ブロックです。DLC限定パークを隠すためにも使います。すべてのパークは自身を除外する条件を持たせます(国家スコープ)。
  • possible: 帝国が取得できるかを決める条件ブロックです(国家スコープ)。
  • on_enabled: 取得時に実行する効果ブロックです(国家スコープ)。
  • modifier: 適用する補正ブロックです。
  • ai_weight: 値が高いほどAIが選びやすくなります。

ローカライズキーとアイコン

ap_example:0 "Example"
ap_example_desc:0 "When I shine, the darkness fades."

伝統と同様、新しいGFX定義が必要です。DDSはどこでも構いませんが、gfx/interface/icons/ascension_perks/を推奨します。

spriteTypes = {
    spriteType = {
        name = "GFX_ap_example"
        textureFile = "gfx/interface/icons/ascension_perks/ap_example.dds"
    }
}

アセンションパークの例

「異種族間交配」の例です。

ap_xeno_compatibility = {
    potential = {
        host_has_dlc = "Megacorp"
        NOT = { has_ascension_perk = ap_xeno_compatibility }
        is_regular_empire = yes
    }

    modifier = { planet_immigration_pull_mult = 0.33 }

    possible = {
        custom_tooltip = {
            fail_text = "civic_tooltip_xenophile"
            is_xenophile = yes
        }
        custom_tooltip = {
            fail_text = "requires_xeno_species"
            any_owned_pop = {
                NOR = {
                    is_same_species = root.owner
                    has_trait = trait_mechanical
                    has_trait = trait_machine_unit
                    has_trait = trait_hive_mind
                }
            }
        }
        custom_tooltip = {
            fail_text = "requires_technology_gene_tailoring"
            has_technology = tech_gene_tailoring
        }
    }

    on_enabled = { custom_tooltip = "allow_crossbreeding" }

    ai_weight = {
        factor = 10
        modifier = { factor = 2 has_ethic = ethic_xenophile }
        modifier = { factor = 3 has_ethic = ethic_fanatic_xenophile }
    }
}

has_ascension_perk = <キー>条件で、帝国が指定アセンションパークを持つか確認できます。

ユーザーインターフェース

伝統UIはinterface/topbar_traditions_view.guiです。これは遺産と出土品アクションのUIでも使われます。伝統ツリーとツリー内の伝統を配置する場所、前提関係を示す矢印もここで定義します。このファイルを変更しなければ、新しい伝統ツリーや伝統をUIに表示できません。

アセンションパーク選択メニューのUIはascension_perks_view.guiです。


出典: Stellaris Wiki — Tradition modding(原文更新日: 2025年2月9日、版ID 99869)
翻訳日: 2026年9月18日 / 対応バージョン: 2.6
本ページは原文Wiki(CC BY-SA 3.0)の内容を翻訳した非公式ファン翻訳です。