コンテンツにスキップ
Stellaris v3.0<br> 対応 翻訳

艦船のMOD制作

旧版向け資料

原文はゲームバージョン3.0向けです。現在のファイル構造、属性、艦種・コンポーネント仕様とは異なる可能性があります。

このページでは、艦船、セクションとコンポーネントのMOD制作を扱います。

基礎

艦船は3つの基本要素からなります。

  1. ship_size — 艦種
  2. section_template — 艦船セクション
  3. component_template — コンポーネント

これらをship_designが組み合わせ、完全な艦船を構成します。

ship_sizeは、セクションを取り付けられるスロットの一覧を持ちます。各スロットには名前があり、画像上でセクションを取り付けるロケータを指定します。

section_slots = {
    "north" = { locator = "part1" }
    "west"  = { locator = "part2" }
    "east"  = { locator = "part3" }
    "south" = { locator = "part4" }
}

section_template側では、対応するship_sizeと取り付け先スロットを指定します。

ship_size = name_of_a_shipsize
ship_size = name_of_another_shipsize
fits_on_slot = "north"
fits_on_slot = "a_slot_in_some_other_shipsize"

セクションはコンポーネント用スロットも指定します。

component_slot = {
    name = "LARGE_GUN_01"
    slot_size = large
    slot_type = weapon
    locatorname = "large_gun_01"
}
small_utility_slots  = 1
medium_utility_slots = 2
large_utility_slots  = 3

ship_designは寸法が一致するようにコンポーネントを配置し、兵器コンポーネントはslot_type = weaponへ、それ以外は対応する種別へ置きます。

グラフィック

画像上の艦船も同じ構造です。gfx_cultureとship_sizeから中核エンティティを選び、その名前は<gfx_culture>_<ship_size>_entityとします。たとえばmammalian_01_corvette_entityです。

画像文化を使わないなら、エンティティ名からその部分を省けます。現在の画像文化とフォールバックの接頭辞を持つエンティティが見つからなければ、corvette_entityが使われます。

複数セクションを持つ艦船では、通常この中核エンティティ自体は不可視ですが(軍事ステーションは例外)、スケルトンを保持します。アニメーションも通常は中核エンティティで行います。中核エンティティにはship_sizeのスロットが参照するpart1、part2などのロケータが必要です。

各section_templateはcommon/section_templates/内で自身のエンティティ名を直接指定します。実際のエンティティを探すとき、ゲームはその名前へgfx_cultureを前置します。

section_template = {
    ...
    entity = "some_entity"
}

現在のgfx_cultureがmammalian_01なら、ゲームはmammalian_01_some_entityを探します。セクションエンティティはスロットで指定した中核エンティティのロケータ(part1など)へ取り付けられます。

兵器エンティティも同様ですが、section_templateとcomponent_slotで指定したロケータへ取り付けます。名前は<gfx_culture>_<component_templateで指定したentity>_entityです。兵器コンポーネントのエンティティにはturret_muzzle_01ロケータも必要です。これはdefines.luaのNGraphics::SHIP_TURRET_PROJECTILE_SPAWN_LOCATORで指定されています。

艦種

ゲームは艦種で全艦船とステーションを分類します。定義場所はcommon/ship_sizes/xyz.txtです。

データ構造

プロパティ 説明
graphical_culture = { mammalian_01 ... } この艦種で有効な画像文化の一覧。graphical_culture = noなら画像文化を不要にできます。
entity = some_entity 既定のSHIPSIZE_entityまたはGFX_CULTURE_SHIPSIZE_entity検索に代わり、使用する画像エンティティを直接指定します。
max_hitpoints = <int> 基本船体値。
combat_disengage_chance = <float> 軍用艦船・民間艦船の戦闘中の離脱率に乗算します。バニラの星系基地・防衛プラットフォーム・民間ステーションは0または未定義です。
max_speed = <int>
acceleration = <float>
rotation_speed = <float>
基本速度、加速度、旋回速度。星系基地はジャガーノートを除き通常0。防衛プラットフォームは基地から防衛位置へ移動するため必要です。民間ステーションは常に0です。
formation_priority = <int> 艦隊内で高い値の艦船ほど前へ出る傾向があります。軍用艦船用。
collision_radius = <int> ほかの艦船が衝突を避けようとする半径。軍用艦船用。
modifier = { ... } この艦種へ加える修飾子。建造前から艦船設計画面にも作用します。使用可能な識別子は下記一覧に限られます。
ship_modifier = { ... } この艦種へ加える別の修飾子ブロック。ship_fire_rate_multやship_weapon_range_multなどを置きます。
size_multiplier 艦隊戦AIがみなす艦船の大きさと、造船所建造画面内の位置を決めます。軍用艦では艦隊へ加える指揮上限コスト、防衛プラットフォームでは必要な防衛プラットフォーム許容量でもあります。原文によると、バニラの民間艦船・民間ステーションは常に1、星系基地は常に4です。
combat_size_multiplier 艦隊戦AIがみなす大きさを指定し、size_multiplierを上書きします。
fleet_slot_size 艦隊内での表示順。コルベットの1からタイタンの8まで。軍用艦船用です。
num_target_locators 用途不明。
is_civilian = <yes/no> 民間艦船は常にyes。ほかはnoまたは未定義ですが、観測拠点は例外的にyesです。
valid_target_aggressive_stance = <yes/no> 攻撃的姿勢の軍事艦隊から無視するかを決めます。バニラでnoなのは民間艦船と民間ステーションだけです。ただし民間艦が兵器を持って戦闘に入ると無視されません。
build_block_radius = <int> 防衛プラットフォーム用とされますが、軍事ステーション再設計後の用途は不明です。
is_space_station = <yes/no> 防衛プラットフォームと民間ステーションは常にyes。ほかはnoまたは未定義です。
is_space_object = <yes/no> 宇宙空間を移動するときに航跡を持つかを決めます。宇宙生物は通常yesです。
can_be_inspected = <yes/no> プレイヤーがこの艦種の設計を閲覧できるかを決めます。一部の宇宙生物はnoです。
icon_frame = <int> 共有アイコンファイル内で使う艦種アイコンのインデックス。軍用艦船用。
is_designable = <yes/no> 艦船設計画面で設計可能か。バニラでは建造可能な軍用艦、ジャガーノート、建造可能な防衛プラットフォームがyesです。
enable_default_design = <yes/no> 帝国がこの艦種の自動生成設計を持って開始するか。設計可能かどうかにかかわらず、全建造可能艦種でyesにしないとAIが建造できません。
can_have_federation_design = <yes/no> 連邦設計を持てるか。バニラでは建造可能軍用艦とジャガーノートがyesですが、コロッサスは例外です。
components_add_to_cost = <yes/no> 建造費と維持費へコンポーネント・セクションを算入するか。設計不能だが建造可能な艦種だけが通常noです。
auto_upgrade = <yes/no> 最新技術に基づき設計と既存艦を自動アップグレードするか。バニラでは民間艦船・民間ステーションだけが通常yesで、観測拠点は例外です。
can_disable = <yes/no> 耐久度低下時に破壊せず無力化するか。バニラではジャガーノート以外の建造可能な星系基地がyesです。
flip_control_on_disable = <yes/no> 無力化後に鹵獲できるか。バニラではジャガーノート以外の建造可能な星系基地がyesです。
default_behavior = <ship behavior> 自動生成設計が戦闘コンピュータを選ぶとき、優先する既定艦船行動。軍用艦船用です。
section_slots = { <section_slot_name> = { locator = <locator name> } } この艦種に必要なセクションと、艦船エンティティ上の取付ロケータ。原文は詳細資料としてGraphics moddingを参照しています。
base_buildtime = <int> 艦船・ステーションの建造、または当該星系基地段階へのアップグレードに必要な日数。民間ステーションは未定義です。
prerequisites = { tech_xxx } この艦種の設計・建造、または星系基地アップグレードに必要な技術一覧。
class 軍用艦船: shipclass_military、shipclass_military_special(コロッサスとスターイーター)。
民間艦船: shipclass_constructor、shipclass_colonizer、shipclass_science_ship、shipclass_transport。
星系基地: shipclass_starbase。防衛プラットフォーム: shipclass_military_station。
民間ステーション: shipclass_mining_station、shipclass_orbital_station、shipclass_research_station、shipclass_observation_station。
construction_type 軍用・民間艦はstarbase_shipyard。星系基地では通常未定義ですが、ジャガーノートはstarbase_shipyardを使います。防衛プラットフォームはstarbase_defensesです。民間ステーションには適用されません。
potential_construction = { ... } 軍用・民間艦を星系基地または巨大構造物の建造一覧へ表示するかを調べる条件。星系基地/巨大構造物スコープで、種別はis_scope_typeで確認し、FROMは建造帝国です。防衛プラットフォームも同様ですが、バニラでは星系基地だけを許可します。星系基地ではジャガーノートを除き通常未定義で、民間ステーションには適用されません。
possible_construction = { ... } 軍用・民間艦を星系基地または巨大構造物で実際に建造できるかを調べる条件。falseでも選択肢は表示されますが、グレー表示とツールチップになります。星系基地/巨大構造物スコープで、種別はis_scope_typeで確認し、FROMは建造帝国です。防衛プラットフォームも同様ですが、バニラのイオン砲はシタデル級だけが建造できます。星系基地ではジャガーノートを除き通常未定義で、民間ステーションには適用されません。
resources = { ... } 建造費と維持費を決める経済ユニット。components_add_to_cost = noならこれが最終コストです。バニラ未使用ですが資源産出も指定できます。
min_upgrade_cost = { <resource> = <int> } 最低アップグレード費。同額コンポーネント間の交換で無料アップグレードになるのを防ぎます。軍用艦船と防衛プラットフォーム用です。
empire_limit = { base = <int> max = <int> naval_cap_div = <int> } 帝国が同時保有できる最大数。maxとnaval_cap_divは任意項目です。指定時はbase + floor(宇宙軍許容量 / naval_cap_div)で、maxが上限です。現在は00_ship_of_size_limits.txtで定義します。
required_component_set = <component set key> 指定コンポーネントセットの中核コンポーネントを要求します。複数指定でき、艦船設計画面の右側へ表示されます。

modifierで使用できる修飾子は次のとおりです。

  • ship_evasion_(add/mult)
  • ship_speed_mult、ship_base_speed_mult
  • ship_(hull/armor/shield)_(add/mult)、ship_(hull/armor/shield)_regen_add_(static/perc)
  • ship_weapon_damage、<weapon slot size>_weapon_damage_mult
  • ships_upkeep_mult、ships_<resource type>_upkeep_mult
  • ship_piracy_suppression_add

星系基地では、さらに次の修飾子を使用できます。

  • starbase_(module/building/defense_platform/shipyard)_capacity_add
  • starbase_(trade_collection_range/protection_range/protection)_add

例

コルベット

corvette = {
    formation_priority = @corvette_formation_priority
    max_speed = @speed_very_fast
    acceleration = 0.35
    rotation_speed = 0.1
    collision_radius = @corvette_collision_radius
    max_hitpoints = @corvette_hp
    modifier = {
        ship_evasion_add = @corvette_evasion
        ship_piracy_suppression_add = 10
    }
    size_multiplier = 1
    fleet_slot_size = 1
    section_slots = { "mid" = { locator = "part1" } }
    num_target_locators = 2
    is_space_station = no
    icon_frame = 2
    base_buildtime = @corvette_build_time
    can_have_federation_design = yes
    enable_default_design = yes #if yes, countries will have an auto-generated design at start

    default_behavior = swarm

    prerequisites = { "tech_corvettes" }

    combat_disengage_chance = 1.00

    class = shipclass_military
    construction_type = starbase_shipyard
    required_component_set = "power_core"
    required_component_set = "ftl_components"
    required_component_set = "thruster_components"
    required_component_set = "sensor_components"
    required_component_set = "combat_computers"

    resources = {
        category = ships
        upkeep = {
            energy = @corvette_upkeep_energy
            alloys = @corvette_upkeep_alloys
        }
    }

    min_upgrade_cost = {
        alloys = 1
    }
}

コロッサス

colossus = {
    formation_priority = @colossus_formation_priority
    max_speed = @speed_very_slow
    acceleration = 0.2
    rotation_speed = 0.15
    collision_radius = @colossus_collision_radius
    max_hitpoints = @colossus_hp
    modifier = {
        ship_evasion_add = @colossus_evasion
    }
    size_multiplier = 32
    fleet_slot_size = 32
    section_slots = { "ship" = { locator = "frame_ship" } }
    num_target_locators = 4
    is_space_station = no
    icon_frame = 7
    base_buildtime = @colossus_build_time
    can_have_federation_design = no
    enable_default_design = yes #if yes, countries will have an auto-generated design at start

    prerequisites = { "tech_colossus" }

    class = shipclass_military_special
    construction_type = starbase_shipyard
    required_component_set = "power_core"
    required_component_set = "ftl_components"
    required_component_set = "thruster_components"
    required_component_set = "combat_computers"

    potential_construction = {
        OR = {
            is_scope_type = starbase
            AND = {
                is_scope_type = megastructure
                OR = {
                    is_megastructure_type = mega_shipyard_3
                    is_megastructure_type = mega_shipyard_restored
                }
            }
        }
    }

    possible_construction = {
        custom_tooltip = {
            fail_text = starbase_citadel_trigger
            OR = {
                AND = {
                    is_scope_type = megastructure
                    OR = {
                        is_megastructure_type = mega_shipyard_3
                        is_megastructure_type = mega_shipyard_restored
                    }
                }
                AND = {
                    is_scope_type = starbase
                    has_starbase_size >= starbase_citadel
                }
            }
        }
        custom_tooltip = {
            fail_text = starbase_colossal_yards_trigger
            OR = {
                AND = {
                    is_scope_type = megastructure
                    OR = {
                        is_megastructure_type = mega_shipyard_3
                        is_megastructure_type = mega_shipyard_restored
                    }
                }
                AND = {
                    is_scope_type = starbase
                    has_starbase_building = colossus_yards
                }
            }
        }
    }

    empire_limit = {
        base = 1
    }

    resources = {
        category = ships
        cost = {
            alloys = 10000
        }
        upkeep = {
            energy = @colossus_upkeep_energy
            alloys = @colossus_upkeep_alloys
        }
    }

    min_upgrade_cost = {
        alloys = 10
    }
}

ジャガーノート

juggernaut = {
    formation_priority = @juggernaut_formation_priority
    max_speed = @speed_very_slow
    acceleration = 0.2
    rotation_speed = 0.15
    collision_radius = @juggernaut_collision_radius
    max_hitpoints = @juggernaut_hp
    modifier = {
        ship_evasion_add = @juggernaut_evasion
        starbase_shipyard_capacity_add = 2
    }

    base_buildtime = @juggernaut_build_time
    resources = {
        category = ships
        upkeep = {
            energy = @juggernaut_upkeep_energy
            alloys = @juggernaut_upkeep_alloys
        }
    }

    combat_size_multiplier = 5
    size_multiplier = 32
    fleet_slot_size = 32
    section_slots = {
        "core" = { locator = "part1" }
    }

    potential_construction = {
        OR = {
            AND = {
                is_scope_type = starbase
                NOT = { has_starbase_size = juggernaut }
            }
            AND = {
                is_scope_type = megastructure
                OR = {
                    is_megastructure_type = mega_shipyard_3
                    is_megastructure_type = mega_shipyard_restored
                }
            }
        }
    }

    possible_construction = {
        custom_tooltip = {
            fail_text = starbase_citadel_trigger
            OR = {
                AND = {
                    is_scope_type = megastructure
                    OR = {
                        is_megastructure_type = mega_shipyard_3
                        is_megastructure_type = mega_shipyard_restored
                    }
                }
                AND = {
                    is_scope_type = starbase
                    has_starbase_size >= starbase_citadel
                }
            }
        }
        custom_tooltip = {
            fail_text = starbase_colossal_yards_trigger
            OR = {
                AND = {
                    is_scope_type = megastructure
                    OR = {
                        is_megastructure_type = mega_shipyard_3
                        is_megastructure_type = mega_shipyard_restored
                    }
                }
                AND = {
                    is_scope_type = starbase
                    has_starbase_building = colossus_yards
                }
            }
        }
    }

    empire_limit = {
        base = 1
    }

    num_target_locators = 0
    can_have_federation_design = yes
    enable_default_design = yes #if yes, countries will have an auto-generated design at start
    can_disable = no
    icon_frame = 7
    ship_class_icon_frame = 35

    default_behavior = carrier

    prerequisites = { "tech_juggernaut" }
    class = shipclass_starbase
    construction_type = starbase_shipyard

    required_component_set = "power_core"
    required_component_set = "sensor_components"
    required_component_set = "combat_computers"
    required_component_set = "ftl_components"
    required_component_set = "thruster_components"
    required_component_set = "ship_aura_components"

    min_upgrade_cost = {
        alloys = 50
    }
}

艦船セクション

艦船はセクションから構成されます。定義場所はcommon/section_templates/xyz.txtです。

データ構造

プロパティ 説明
key = <localisation key> セクションの識別キー。
ship_size = <ship size key> 対応する艦種。複数指定できます。
fits_on_slot = <section_slot_name> 対応するセクションスロット名。複数指定できます。
should_draw_components = <yes/no> 2.3.3以降は機能しません。以前はnoで、このセクション上の全兵器エンティティ(見える砲塔)を無効化しました。
entity = <entity key> セクションのエンティティ。
icon = <GFX entry> 多くのバニラセクションはGFX_ship_part_core_midを指定しますが、表示される場所はありません。
component_slot = { ... } 兵器スロット。複数指定でき、定義順に艦船設計画面へ並びます。
└ name = <something> 兵器スロットの識別名。重複不可。
└ template = <component slot template> コンポーネントスロットテンプレート。兵器種別(通常兵器/艦載機)、兵器寸法(小型/中型/大型)、砲塔エンティティを決めます。
└ locatorname = <locator name> セクションエンティティ上で砲塔を置く位置を示すロケータ。原文の参照先はGraphics moddingです。
small_utility_slots = <int>
medium_utility_slots = <int>
large_utility_slots = <int>
aux_utility_slots = <int>
寸法ごとの汎用スロット数。複数指定でき、定義とは逆順に設計画面へ並びます。
resources = { ... } セクションの建造費と維持費を決める経済ユニット。
ai_weight = { ... } AIと自動設計がこのセクションを選ぶ可能性。国家スコープ。
prerequisites = { tech_xxx } 必要技術一覧。ほかのゲームオブジェクトと異なり、セクションはいずれか1つだけを要求します。

既定ロケータ名

プレイ可能な画像文化は各セクションで同じロケータ名を共有します。原文掲載のバニラ一覧です。

# CORVETTE
"CORVETTE_MID_M1S1" locator "small_gun_01"
"CORVETTE_MID_M1S1" locator "medium_gun_01"
"CORVETTE_MID_S3" locator "small_gun_01"
"CORVETTE_MID_S3" locator "small_gun_02"
"CORVETTE_MID_S3" locator "small_gun_03"
"CORVETTE_MID_S2PD1" locator "small_gun_01"
"CORVETTE_MID_S2PD1" locator "small_gun_02"
"CORVETTE_MID_S2PD1" locator "small_gun_03"

# DESTROYER
"DESTROYER_BOW_M1S2" locator "medium_gun_01"
"DESTROYER_BOW_M1S2" locator "small_gun_01"
"DESTROYER_BOW_M1S2" locator "small_gun_02"
"DESTROYER_BOW_S3" locator "small_gun_01"
"DESTROYER_BOW_S3" locator "small_gun_02"
"DESTROYER_BOW_S3" locator "small_gun_03"
"DESTROYER_BOW_L1" locator "large_gun_01"

# CRUISER
"CRUISER_BOW_L1" locator "large_gun_01"
"CRUISER_BOW_M1S2" locator "medium_gun_01"
"CRUISER_BOW_M1S2" locator "small_gun_01"
"CRUISER_BOW_M1S2" locator "small_gun_02"
"CRUISER_BOW_M2" locator "medium_gun_01"
"CRUISER_BOW_M2" locator "medium_gun_02"
"CRUISER_MID_S2HB" locator "small_gun_01"
"CRUISER_MID_S2HB" locator "small_gun_02"
"CRUISER_MID_L1M1" locator "large_gun_01"
"CRUISER_MID_L1M1" locator "medium_gun_01"
"CRUISER_MID_M3" locator "medium_gun_01"
"CRUISER_MID_M3" locator "medium_gun_02"
"CRUISER_MID_M3" locator "medium_gun_03"
"CRUISER_MID_M2S2" locator "medium_gun_01"
"CRUISER_MID_M2S2" locator "medium_gun_02"
"CRUISER_MID_M2S2" locator "small_gun_01"
"CRUISER_MID_M2S2" locator "small_gun_02"
"CRUISER_STERN_M1" locator "medium_gun_01"
"CRUISER_STERN_S2" locator "small_gun_01"
"CRUISER_STERN_S2" locator "small_gun_02"

# BATTLESHIP
"BATTLESHIP_BOW_L1M1S2" locator "large_gun_01"
"BATTLESHIP_BOW_L1M1S2" locator "medium_gun_01"
"BATTLESHIP_BOW_L1M1S2" locator "small_gun_01"
"BATTLESHIP_BOW_L1M1S2" locator "small_gun_02"
"BATTLESHIP_BOW_L2" locator "large_gun_01"
"BATTLESHIP_BOW_L2" locator "large_gun_02"
"BATTLESHIP_BOW_M1S2SHB" locator "medium_gun_01"
"BATTLESHIP_BOW_M1S2SHB" locator "small_gun_01"
"BATTLESHIP_BOW_M1S2SHB" locator "small_gun_02"
"BATTLESHIP_MID_L2M2" locator "large_gun_01"
"BATTLESHIP_MID_L2M2" locator "large_gun_02"
"BATTLESHIP_MID_L2M2" locator "medium_gun_01"
"BATTLESHIP_MID_L2M2" locator "medium_gun_02"
"BATTLESHIP_MID_L3" locator "large_gun_01"
"BATTLESHIP_MID_L3" locator "large_gun_02"
"BATTLESHIP_MID_L3" locator "large_gun_03"
"BATTLESHIP_MID_M4SHB" locator "medium_gun_01"
"BATTLESHIP_MID_M4SHB" locator "medium_gun_02"
"BATTLESHIP_MID_M4SHB" locator "medium_gun_03"
"BATTLESHIP_MID_M4SHB" locator "medium_gun_04"
"BATTLESHIP_MID_S4LHB" locator "small_gun_01"
"BATTLESHIP_MID_S4LHB" locator "small_gun_02"
"BATTLESHIP_MID_S4LHB" locator "small_gun_03"
"BATTLESHIP_MID_S4LHB" locator "small_gun_04"
"BATTLESHIP_STERN_L1" locator "large_gun_01"
"BATTLESHIP_STERN_M2" locator "medium_gun_01"
"BATTLESHIP_STERN_M2" locator "medium_gun_02"

例

戦艦XL艦首

ship_section_template = {
    key = "BATTLESHIP_BOW_M2S4"
    ship_size = battleship
    fits_on_slot = bow
    should_draw_components = yes
    entity = "battleship_bow_XL1_entity"
    icon = "GFX_ship_part_core_bow"

    prerequisites = { tech_energy_lance_1 tech_energy_lance_2 tech_arc_emitter_1 tech_arc_emitter_2 tech_mass_accelerator_1 tech_mass_accelerator_2 }

    ai_weight = {
        modifier = {
            factor = 10.0
            NOT = { is_preferred_weapons = weapon_type_explosive }
        }
        modifier = {
            factor = 0.1
            is_preferred_weapons = weapon_type_explosive
        }
    }

    component_slot = {
        name = "EXTRA_LARGE_01"
        template = "invisible_extra_large_fixed"
        locatorname = "xl_gun_01"
    }

    large_utility_slots = 3

    resources = {
        category = ship_sections
        cost = {
            alloys = @section_cost
        }
    }
}

星系基地ミサイル防衛モジュール

ship_section_template = {
    key = "MISSILE_STARBASE_SECTION"
    entity = "starbase_turret_section_entity"
    icon = "GFX_ship_part_core_mid"

    ship_size = starbase_outpost
    ship_size = starbase_starport
    ship_size = starbase_starhold
    ship_size = starbase_starfortress
    ship_size = starbase_citadel

    fits_on_slot = "1"
    fits_on_slot = "2"
    fits_on_slot = "3"
    fits_on_slot = "4"
    fits_on_slot = "5"
    fits_on_slot = "6"

    should_draw_components = yes

    component_slot = {
        name = "TORPEDO_01"
        template = "medium_missile_turret"
        locatorname = "medium_gun_01"
    }

    component_slot = {
        name = "TORPEDO_02"
        template = "medium_missile_turret"
        locatorname = "medium_gun_02"
    }
}

コンポーネントスロットテンプレート

セクションテンプレートへ取り付ける実際の兵器コンポーネント、いわば「砲塔」のコンテナです。定義場所はcommon/component_slot_templates/xyz.txtです。

データ構造

プロパティ 兵器コンポーネントスロット 艦載機スロット
component 1つだけ。component = weapon 1つだけ。component = strike_craft
size 対空 size = point_defence
小型 size = small
中型 size = medium
大型 size = large
誘導 size = torpedo
特大型 size = extra_large
タイタン size = titanic
惑星破壊 size = planet_killer
のいずれか。
現在使われるのはlargeだけですが、common/component_slot_templates/でsmallとmediumも追加できます。
格納庫 size = small
格納庫 size = medium
格納庫 size = large
entities = { ... } コンポーネントタグとエンティティの組で砲塔エンティティを決めます。 使用不可。
is_fixed = <yes/no> 既定値no。yesなら砲塔は旋回せず、艦船全体が目標へ向きます。 使用不可。

例

対空砲塔

point_defence_turret = {
    size = point_defence
    component = weapon
    entities = {
        weapon_type_kinetic = "small_kinetic_gun_entity"
        weapon_type_energy = "turret_point_defence_entity"
    }
}

不可視の特大固定「砲塔」

invisible_extra_large_fixed = {
    size = extra_large
    component = weapon
    is_fixed = yes
}

コンポーネントセット

コンポーネントのグループで、common/component_sets/xyz.txtに定義します。2種類あります。

  • 艦船設計で使う、同じ技術からアンロックされる同系統・異なる寸法の兵器/汎用コンポーネントをまとめるセット。
  • 異なる技術からアンロックされる、同じ中核中核コンポーネントスロットを埋める全コンポーネントをまとめるセット。

中核コンポーネントには兵器や艦載機も使えますが、その兵器は発射できず砲塔エンティティも持ちません。惑星破壊兵器なら使用自体はできますが、画像は出ません。

データ構造

プロパティ 設計用セット 中核コンポーネントセット
key = <localisation key> 識別キー。 識別キー。
required_component_set = <yes/no> noまたは未定義。 必ずyes。艦種が使用可能なテンプレートを最低1つ持たないと建造不能になり、自動設計も壊れます。
icon = <GFX entry> コンポーネントスロットのアイコン。 バニラでも定義しますが、個々の中核コンポーネントに常に上書きされます。
icon_frame = <int> バニラは常に1。実用途は不明。 バニラでも定義しますが、個々の中核コンポーネントに常に上書きされます。

例

中核コンポーネントセット「戦闘コンピュータ」

component_set = {
    key = "combat_computers"

    required_component_set = yes
    icon = "GFX_ship_part_computer"
    icon_frame = 1
}

設計用コンポーネントセット「赤色レーザー」

component_set = {
    key = "RED_LASER"

    icon = "GFX_ship_part_laser_1"
    icon_frame = 1
}

コンポーネント

コンポーネントは、兵器または機能拡張として艦船へ取り付ける部品です。定義場所はcommon/component_templates/xyz.txtです。

データ構造

プロパティ 兵器コンポーネント 艦載機コンポーネント 汎用コンポーネント
key = <localisation key> 識別キー。 同左。 同左。
icon = <GFX entry> セット側を上書きするアイコン。 同左。 同左。
icon_frame = <int> スプライトシート用。バニラは常に1。 同左。 同左。
size 対空 size = point_defence
小型 size = small
中型 size = medium
大型 size = large
誘導 size = torpedo
特大型 size = extra_large
タイタン size = titanic
惑星破壊 size = planet_killer
Apocalypse Apocalypseなしではタイタン・惑星破壊兵器を持つ設計を保存できず、自動設計も選びません。
格納庫 size = largeだけ。 小型 size = small
中型 size = medium
大型 size = large
補助 size = aux
のいずれか。
type instant、point_defence、missile、planet_killer。実体弾・エネルギーは見た目に飛翔時間があってもダメージは即時に発生します。対空はミサイルと艦載機も狙える上位型です。ミサイルには飛翔速度・再照準範囲・耐久値・回避などの追加属性があります。惑星破壊兵器は艦隊戦では使わず、コロッサスから惑星へ使用してイベントを起こします。Apocalypse Apocalypse DLCがなければ、惑星破壊兵器を使用する艦隊命令も実行できません。 使用不可。 使用不可。
weapon_type 使用不可。 instantまたはpoint_defence。 使用不可。
entity = <entity key> 使用不可。 艦載機の外観。 使用不可。
projectile_gfx = <key> 投射物の画像。 同左。 使用不可。
prio_projectile = <yes/no> yesなら、表示数上限で一部画像を省く場合もこの投射物を優先します。 使用不可。 使用不可。
planet_destruction_gfx = <GFX entry> 惑星破壊兵器専用の投射物画像。 使用不可。 使用不可。
tags = { component_tags ... } コンポーネントタグ一覧。どの修飾子が作用するかを決めます。実体弾とエネルギーの両タグがあれば、両方の反復技術が作用します。 同左。 使用不可。
ai_tags = { component_tags ... } AIがこの兵器を何の役割とみなすか。 使用不可。 使用不可。
ai_tag_weight = <float> ai_tagsから得るAI重みの倍率。バニラは理由不明ながらミサイルに使用します。 使用不可。 使用不可。
prerequisites = { tech_xxx } 必要技術。 同左。 同左。
power = <int> 正なら発電、負なら消費。 同左。 同左。
resources = { ... } 建造費と維持費の経済ユニット。 同左。 同左。
modifier = { ... } 艦船へ加える修飾子。建造前から設計画面にも作用し、使用可能な識別子は艦種のmodifier一覧と同じです。兵器・艦載機へ付けるとツールチップが乱雑になるため非推奨です。 同左。 同じ修飾子一覧と星系基地向けの追加修飾子を使用できます。建造前から設計画面にも作用します。
ship_modifier = { ... } ship_fire_rate_multやship_weapon_range_multなど。兵器・艦載機ではツールチップが乱雑になるため非推奨です。 同左。 同左。
ship_behavior = <behavior> 使用不可。 艦載機の行動パターン。 艦船の行動パターン。
component_set = <key> 所属コンポーネントセット。 同左。 同左。
upgrades_to = <component key> 直接の上位部品。アンロック後は旧式として艦船設計画面から隠れますが、「旧式を非表示(Hide Obsolete)」を手動で解除すれば表示できます。コンポーネントの自動アップグレードを有効にした既存の全設計では上位部品へ置換されます。auto_upgrade = yesの艦種は既存艦も即時無料更新され、星系基地は自ら再設計して別種兵器を選ぶ場合があります。 同左。 同左。
class_restriction = { shipclass... } 装備可能な艦船クラス。コロッサスはshipclass_military_special、ジャガーノートと星系基地はshipclass_starbaseです。 同左。 同左。
size_restriction = { ship sizes } 装備可能な艦種。 同左。 同左。
slot_restriction = { slot templates } 2.7.1で実装。装備可能なスロットテンプレート。 同左。 使用不可。
hidden = <yes/no> 省略可、既定no。yesなら設計画面・自動生成・AIから隠れ、グローバル艦船設計だけが使用できます。 同左。 同左。
valid_for_country = { ... } 下記例のように定義し、全条件がtrueなら有効。コンポーネントのpotentialブロックとして機能し、真偽値を受け付けます。1.8では人工知能政策が非合法のときにプレイヤーが知性型戦闘コンピュータを使うのを防ぎ、現在はコロッサスの大洪水型惑星破壊兵器に使います。 同左。 同左。
friendly_aura/hostile_aura 使用不可。 使用不可。 オーラ定義(後掲例参照)。system_wide = yesなら同じ星系内の全友軍/敵軍艦船、noまたは未定義なら同艦隊の全友軍艦船/オーラ発生艦と戦闘中の全敵艦船へ作用します。rangeは機能せず、graphicsも機能しないようです。
should_ai_use = <yes/no> noならAIは使用不可。バニラでは空のFTLドライブだけが使用します。 同左。 同左。
ftl = <yes/no> 使用不可。 使用不可。 yesならハイパーレーンとFTLを使用できます。
jumpdrive = <yes/no> 使用不可。 使用不可。 yesならジャンプドライブ命令を使用できます。
ftl_inhibitor = <yes/no> 使用不可。 使用不可。 yesならFTL妨害装置になります。
damage = { min = <float> max = <float> } ダメージ。 同左。 使用不可。
windup = { min = <int> max = <int> } 発射準備に必要なtick数。1日は10tick。 同左。 使用不可。
total_fire_time = <int> 次の発射までの冷却tick数。1日は10tick。 使用不可。 使用不可。
cooldown = <int> 使用不可。 次の発射までの冷却tick数。1日は10tick。 使用不可。
hull_damage = <float>
shield_damage = <float>
shield_penetration = <float>
armor_damage = <float>
armor_penetration = <float>
ダメージ効率と貫通率。 同左。 使用不可。
range = <int>
accuracy = <float>
tracking = <float>
射程、命中、追尾。 同左。 使用不可。
missile_speed = <int>
missile_evasion = <float>
missile_shield = <int>
missile_armor = <int>
missile_health = <int>
missile_retarget_range = <int>
ミサイル能力値。 使用不可。 使用不可。
firing_arc = <float> 発射可能な角度を制限します。 使用不可。 使用不可。
min_range = <float> 最小射程を制限します。 使用不可。 使用不可。
use_ship_kill_target = <yes/no> 用途不明。 使用不可。 使用不可。
count = <int>
regeneration_per_day = <float>
launch_time = <int>
speed = <int>
rotation_speed = <float>
acceleration = <float>
evasion = <float>
shield = <int>
armor = <int>
health = <int>
使用不可。 艦載機の機数、日次再生、発進時間、速度、旋回、加速、回避、シールド、装甲、耐久値。 使用不可。

valid_for_countryの定義例:

valid_for_country = {
    conditions...
}

原文では「自動生成設計とAIはこの条件を無視する」という要確認事項が取り消され、potentialブロックとして機能すると訂正されています。

兵器能力値CSV

バニラ兵器コンポーネントの大半の能力値はcommon/component_templates/weapon_components.csvにあり、個別コンポーネント定義より優先されます。

キー 通常兵器 惑星破壊兵器
key 兵器コンポーネントの識別子。 同左。
cost 鉱物 鉱物コスト。経済再設計後は廃止。 同左。
power 電力への影響。 同左。
min_damage/max_damage ダメージ。damage = { min = <float> max = <float> }に相当。 使用不可。
hull_damage/shield_damage/shield_penetration/armor_damage/armor_penetration ダメージ効率と貫通率。 使用不可。
min_windup/max_windup 発射準備tick数(1日=10tick)。windup = { min = <int> max = <int> }相当。 ワールドデストロイヤーはmin 90、max 0。
cooldown 次の発射までの冷却tick数(1日=10tick)。total_fire_time = <int>相当。 ワールドデストロイヤーは30。
range/accuracy/tracking 射程、命中、追尾。 命中1、射程0、追尾0。
missile_speed/missile_evasion/missile_shield/missile_armor/missile_health/missile_retarget_range 飛翔速度、回避、シールド、装甲、耐久値、再照準範囲。 使用不可。

コンポーネントタグ

コンポーネントへタグを与えると、特定修飾子の対象にできます。バニラの多くはハードコードで要求され、common/component_tags/xyz.txtに定義します。

weapon_type_energy
weapon_type_kinetic
weapon_type_explosive
weapon_type_strike_craft
weapon_type_point_defense
weapon_role_anti_armor
weapon_role_anti_shield
weapon_role_artillery
weapon_role_anti_hull
weapon_role_point_defense

例

小型赤色レーザー

weapon_component_template = {
    key = "SMALL_RED_LASER"
    size = small
    type = instant
    icon = "GFX_ship_part_laser_1"
    icon_frame = 1
    prerequisites = { "tech_lasers_1" }
    component_set = "RED_LASER"
    projectile_gfx = "infrared_laser_s"
    tags = { weapon_type_energy }
    upgrades_to = "SMALL_BLUE_LASER"
    ai_tags = { weapon_role_anti_armor }    #tags must be pre-registered in common/weapon_tags
    resources = {
        category = ship_components
        cost = {
            alloys = @s_t1_cost
        }
        upkeep = {
            energy = @s_t1_upkeep_energy
            alloys = @s_t1_upkeep_alloys
        }
    }
}

ティア3艦載機

strike_craft_component_template = {
    key = "STRIKE_CRAFT_HANGAR_3"
    size = LARGE
    entity = "bomber_entity"

    weapon_type = point_defence
    projectile_gfx = "strike_craft_laser_3"

    power = @power4
    resources = {
        category = ship_components
        cost = {
            alloys = @l_t5_cost
        }
        upkeep = {
            energy = @l_t5_upkeep_energy
            alloys = @l_t5_upkeep_alloys
        }
    }

    count = @count
    regeneration_per_day = @regen
    launch_time = @launch_time

    damage = { min = 6 max = 17 }
    cooldown = 2.3
    range = @attack_range
    engagement_range = @engagement_range
    accuracy = 1.00
    tracking = 1.00

    health = 45
    armor = 0
    shield = 30
    evasion = 0.80

    speed = @speed4
    rotation_speed = 0.8
    acceleration = 1

    shield_penetration = 1.0
    armor_damage = 1.5

    ship_behavior = "fighters_behavior"

    icon = "GFX_ship_part_strike_craft_fighter_3"
    icon_frame = 1
    component_set = "STRIKE_CRAFT_HANGAR_3"
    prerequisites = { "tech_strike_craft_3" }

    tags = { weapon_type_strike_craft }
    ai_tags = { weapon_role_point_defense }
}

小型ティア3シールド

utility_component_template = {
    key = "SMALL_SHIELD_3"
    size = small
    icon = "GFX_ship_part_shield_3"
    icon_frame = 1
    power = @power_S3
    resources = {
        category = ship_components
        cost = {
            alloys = @shield_s_t3_cost
        }
        upkeep = {
            energy = @shield_s_t3_upkeep_energy
            alloys = @shield_s_t3_upkeep_alloys
        }
    }
    modifier = {
        ship_shield_add = @shield_S3
        ship_shield_regen_add_static = @regen_S3 #Regeneration per day
    }
    prerequisites = { "tech_shields_3" }
    component_set = "SHIELD_3"
    upgrades_to = "SMALL_SHIELD_4"
}

対空無力化ジャガーノートオーラ

utility_component_template = {
    key = "SHIP_AURA_PD_PENETRATION"
    size = medium
    icon = "GFX_ship_part_aura_pd_penetration"
    icon_frame = 1
    power = 0

    size_restriction = { juggernaut }
    component_set = "ship_aura_components"

    hostile_aura = {
        name = "aura_pd_penetration"
        system_wide = yes

        stack_info = {          #A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
            id = hostile_pd_penetration
            priority = 1
        }

        modifier = {
            weapon_type_point_defense_weapon_damage_mult = -0.3
            weapon_type_point_defense_weapon_fire_rate_mult = -0.3
        }

        graphics = {
            area_effect = {
                entity = "circle_area_entity"
                dynamic_scale = yes
            }
            ship_effect = {
                entity = "ship_aura_negative_entity"
                dynamic_scale = no
            }
        }
    }

    ai_weight = {
        weight = 10
        modifier = {
            factor = 2
            is_ai = yes
            is_preferred_weapons = weapon_type_energy
        }
    }
}

爆撃ジャガーノートオーラ

utility_component_template = {
    key = "SHIP_AURA_BOMBARDMENT"
    size = medium
    icon = "GFX_ship_part_aura_bombardment"
    icon_frame = 1
    power = 0

    size_restriction = { juggernaut }
    component_set = "ship_aura_components"

    friendly_aura = {
        name = "aura_bombardment"
        system_wide = yes

        stack_info = {          #A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
            id = friendly_bombardment
            priority = 1
        }

        modifier = {
            ship_orbital_bombardment_mult = 0.3
        }

        graphics = {
            area_effect = {
                entity = "circle_area_entity"
                dynamic_scale = yes
            }
            ship_effect = {
                entity = "ship_aura_negative_entity"
                dynamic_scale = no
            }
        }
    }

    ai_weight = {
        weight = 10
        modifier = {
            factor = 2
            is_ai = yes
            is_preferred_weapons = weapon_type_energy
        }
    }
}

コロッサス兵器の仕組み

コロッサス兵器はコロッサスの艦隊命令から使用します。発射前にcan_destroy_planet_with_<component key>スクリプトトリガーを確認します。詳細はcommon/scripted_triggers/01_scripted_triggers_planet_killers.txtと動的MOD制作を参照してください。

発射時にはon_destroy_planet_with_<component key>オンアクションが発火します。詳細はcommon/on_actions/01_planet_destruction.txtとイベントのMOD制作を参照してください。

コンポーネント名と説明以外にも次のローカライズキーが必要です。

FLEETORDER_DESTROY_PLANET_WITH_<component key>:0 "$PLANET|Y$の破壊準備中"
MESSAGE_DESC_FOR_<component key>:0 "によって完全に破壊された"
<component key>_ACTION:0 "惑星を破砕"

艦船行動

戦闘中に艦船が従う行動パターンで、戦闘コンピュータと艦載機コンポーネントから呼びます。定義場所はcommon/ship_behaviors/xyz.txtです。

データ構造

プロパティ 説明
name = <localisation key> 艦船行動の識別キー。
preferred_attack_range = <min/median/max/int> attack_movement_pattern中に目標から保とうとする距離。
formation_distance = <min/median/max/int> 目標との距離がこの値より内側になると攻撃移動へ切り替え、受動移動中もこの距離を保とうとします。
return_to_formation_distance = <min/median/max/int> 目標との距離がこの値より外側になると受動移動へ切り替えます。
attack_move_pattern/passive_move_pattern charge、orbit、stay_at_range、flee、follow、stationary、noneのいずれか。
ignore_combat_movement = <yes/no> yesなら自動移動パターンを完全に無視します。艦隊旗艦ならほかの艦が各パターンに従う間も任意地点へ操作でき、この艦がハイパーレーンへ入ると艦隊全体が離脱します。

グローバル艦船設計

create_shipなどのエフェクトを持つイベントが使う、事前スクリプト済み設計です。定義場所はcommon/global_ship_designs/xyz.txtです。

データ構造

プロパティ 説明
name = <localisation key> 設計の識別キー。
ship_size = <ship size key> 艦種。
is_event_design = <yes/no> 艦隊管理画面から除外すべきイベント設計にする。
hide_size = <yes/no> 艦種名を隠し、「アメーバ級アメーバ」のような表示を防ぐ。
section = { ... }
└ template = <ship section key>
└ slot = <section_slot_name>
セクション。複数指定でき、それぞれにコンポーネントも指定できます。
└ component = { ... }
 └ slot = <component slot name>
 └ template = <component key>
コンポーネント。複数指定可能。兵器スロット名はセクション定義の名前を使います。汎用スロット名は下記の形式で、番号は1からです。

汎用コンポーネントスロット名: (SMALL|MEDIUM|LARGE|AUX)_UTILITY_<int>。

特殊イベント艦の作成

プレイヤーが設計できず、全画像文化へ対応する必要もない宇宙雲のような艦船を作る手順です。

  1. common/ship_sizes/から適切なship_sizeを探すか、新しく作ります。

    is_designable = yes/no       # 設計画面で選択可能か
    is_space_object = yes/no     # 宇宙オブジェクトはエンジン航跡を残さない
    gfx_culture = { "pirate_01" } # この艦種で有効な画像文化を上書き
    graphical_culture = no       # 特定画像文化の必要性をなくす
    

    既定ではすべての画像文化で有効なので、文化ごとにエンティティが1つずつ必要です。所有者の画像文化に関係なく同じエンティティを使うなら、mammalian_01_my_ship_size_entityではなくmy_ship_size_entityのように文化部分を省きます。原文のgraphical_culture /noは、上の例では同じ原文の艦種表に従いgraphical_culture = noへ補正しています。

  2. common/section_templates/へセクションテンプレートを追加します。同じエンティティを共用する場合は、ここでも文化部分を省きます。

  3. 独自兵器が必要ならcommon/component_templates/へ兵器コンポーネントテンプレートを追加します。
  4. common/global_ship_designs/で艦船設計を作ります。

ship_sizeとsection_templateの両方にエンティティが必要ですが、見える必要があるのは片方だけです。単一セクション艦は、セクション側を可視部分にするとship_sizeを再利用できるため推奨されます。兵器を持つ場合は各weapon_component_templateにもエンティティが必要で、そのエンティティにはturret_muzzle_01ロケータが必要です。


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