Starbase modding

本页面部分全部内容上次核对于3.1版本
自由之民讨论 | 贡献2022年3月8日 (二) 02:07的版本 (文本替换 - 替换“Category:Modding]]”为“Category:模组制作]]”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)


Starbases is a mechanic introduced since Stellaris v2.0, replacing planetary Spaceports. This page is about Starbase modding.

Overview

A Starbase consist of two parts, the Ship part and the Starbase part. They are different Scopes in term of Dynamic modding.

The Ship part of a Starbase also have a Fleet scope consist of the Starbase and all Defense Platforms built around it.

The Ship Part

The Ship part of a starbase is the part visible in the solar system view and capable to engage in battle. It consist of a ship size entry, ship sections and ship components. A Juggernaut is a starbase with construction type "starbase_shipyard". Head to Ship modding for details.

The Starbase Part

The Starbase part of a starbase is the part visible in the GUI and capable to build ships, starbase modules, starbase buildings and defense platforms.

Starbase Levels

Starbase Levels is an abstract concept that classifies Starbases. Its entries are defined at "common/starbase_levels/xxx.txt".

Data Structure

  • ship_size = <ship size key> - Determines a Ship Size this starbase level refer to. A Starbase will have a Ship part of this Ship Size at this level.
  • next_level = <starbase level key> - Determines what's the next level for this level to be upgraded into.
  • show_in_outliner = <yes/no> - Default yes. Determines if Starbases of this level should be displayed in the outliner. If this Starbase has any shipyard capacity, it's grouped under "Shipyards", or it's grouped under "Starbases".
  • display_empire_shield = <yes/no> - Default no. By default, a system will display an "empire shield" in the galaxy view only if there is a colony in this system. If this field is set to yes, a system containing a Starbase of this level will display the "empire shield" even if there is no colonies in this system.
  • display_map_icon = <yes/no> - Default yes. If yes, Starbases of this level will have an icon displayed on this system in the galaxy view. By clicking that icon in the galaxy view, the player can select this Starbase without looking into this system.
  • level_weight = <int> - Determines the level of this Starbase. Used to calculate claim costs and Conditions to check the starbase level.
  • ai_weight - Determines how important the AI think this level of Starbases is. Vanilla entries always have AI weight equal to the level_weight.
  • potential_home_base = <yes/no> - Default no. If yes, Starbases of this level can be set as a homebase of military fleets.

Starbase Level Example

These examples are the outpost, the level 1 Starbase, and the Juggernaut.

starbase_level_outpost = {
	ship_size = starbase_outpost
	next_level = starbase_level_starport
	show_in_outliner = no
	display_map_icon = no
	level_weight = 0	
	ai_weight = { weight = 1 }	
}

starbase_level_starport = {
	ship_size = starbase_starport
	next_level = starbase_level_starhold
	level_weight = 1
	ai_weight = { weight = 2 }
	potential_home_base = yes
}

starbase_level_juggernaut = {
	ship_size = juggernaut
	potential_home_base = yes
	show_in_outliner = no
}

Starbase Modules

Starbase Modules can be built on a Starbase to extend its functions. They are defined at "common/starbase_modules/xxx.txt".

Data Structure

  • icon = <GFX key> - A reference to a GFX instance that indicates the icon of this module.
  • section = <ship section key> - A reference to a ship section key. For as long as the starbase has this module, a ship section of this key is attached to the Ship part of the starbase, visible in the solar system view. The section might also have component slots and the Starbase will attempt to add weapons and utilities to fill the slots. Head to Ship Sections modding for details.
  • construction_days = <int> - Days until this starbase module is built.
  • potential - A block of Conditions that determines should this starbase module appear in the module construction menu. (Starbase scope)
  • possible - A block of Conditions that determines can this starbase module be built onto the starbase. (Starbase scope)
  • initial = <yes/no> - Default no. If yes, the very first Starbase present at the start of the game of each empire will have an instance of this module.
  • resources - An Economy Unit that indicates the module build cost, upkeep and resource production.
  • station_modifier - A block of Modifiers to be applied to the Ship part of this Starbase. Modifiers that affect hull, armor, shield, shipyard capacity, trade protection and trade protection range go here.
  • triggered_station_modifier - Similarly, except it has a condition. Multiple allowed.
    • potential - A block of Conditions that determines should this triggered modifier block apply.
  • country_modifier - A block of Modifiers to be applied to the owner of this Starbase. Modifiers that affect naval capacity and empire resource capacity go here.
  • triggered_country_modifier - Similarly, except it has a condition. Multiple allowed.
    • potential - A block of Conditions that determines should this triggered modifier block apply.
  • ship_modifier - A block of Modifiers to be applied to Ships built from this Starbase. Modifiers that affect ship starting experience go here.
  • orbit_modifier - A block of Modifiers to be applied to Ships docking at this Starbase. Modifiers that affect docked ship upkeep go here.
  • system_modifier - A block of Modifiers to be applied to the Planets that's owned by the Starbase owner in the same solar system.
    • Only Planets take the effect. If you want to affect Ships, use equipped_component to make this Starbase equip an aura and affect Ships.
  • ai_build_at_chokepoint = <yes/no> - If no, AI will avoid building this module at a chokepoint.
  • ai_build_outside_chokepoint = <yes/no> - If no, AI will avoid building this module outside a chokepoint.
  • ai_weight - Determines how likely the AI will build this starbase module.
  • custom_tooltip - A localisation key that appears as part of the effect description in the tooltip in addition to the generated tooltip of modifiers.
  • show_in_tech = <technology key> - That technology will display "Unlock Starbase Module: XXX" in its description.
  • show_tech_unlock_if - A block of Conditions that determines should this starbase be displayed in the tech description of the "show_in_tech".
  • equipped_component = <utility component key> - A reference to a component. If specified, this Starbase Module will add that component as a core component to the Ship part of this Starbase. Vanilla Starbase Buildings use this to implement aura equipping Starbase Buildings.
  • component_set = <component set key> - A reference to a component set. If specified, all components added to the section are only drawn from this component set. If multiple components of same component type (weapon/utility) and same slot type (small/medium/...) present in the component set, only the first of them will be used. Vanilla unused.

Starbase Buildings

Similar to Starbase Modules, except a Starbase can only have one Starbase Building of each kind. They do also have no effect on the looking of the Ship part. They are defined at "common/starbase_buildings/xxx.txt".

Data Structure

Starbase Buildings have similar data structure to Starbase Modules, except it doesn't need a section.

Starbase Types

Starbase Types is an abstract concept that classifies Starbases based on the modules they have. To the players, the Starbase Types serve no more than flavor texts. To the AI, the Starbase Types is a Starbase auto build guide. Starbase Type entries are defined at "common/starbase_types/xxx.txt".

Data Structure

  • potential - A block of Conditions that determines can a Starbase be classified into this Type. (Starbase scope)
  • weight_modifier - If a Starbase has met the requirements of multiple Starbase Types, one with the highest weight wins.
    • base = <int> - The base weight.
    • modifier - An entry of weight modifier. Multiple allowed. It consist of Conditions checked under the Starbase scope and a field add = <int> that determines how much weight is added.
  • ai_design - An entry that guides the AI to design and build their Starbases.
    • min - An entry that determines the minimal count of Starbases of this type the AI wants to have.
      • base = <int> - The Starbase Type "Shipyard" has 1.
      • factor = <int> - The Starbase Type "Shipyard" has 1. Actual effect is unclear.
    • ratio - An entry that makes the AI wants a percent of Starbases to be of this type.
      • base = <float> - The base percentage.
      • modifier - An entry of percentage modifier. Multiple allowed. It consist of Conditions checked under the Starbase scope and a field add = <float> that determines how much percentage is added.
    • buildings - A list of <starbase building key> = { base = <float> } entries that guides the AI to pick starbase buildings weighted by the factors provided here.
    • modules - A list of <starbase module key> = { base = <float> } entries that guides the AI to pick starbase modules weighted by the factors provided here.

Starbase Type Example

This is the Starbase Type "Shipyard".

sshipyard = {
	potential = {
		has_starbase_size > starbase_outpost
		count_starbase_modules = {
			type = shipyard
			count > 0
		}
	}

	weight_modifier = {
		base = 100	
		modifier = {
			add = 100
			count_starbase_modules = {
				type = shipyard
				count > 1
			}
		}		
		modifier = {
			add = 100
			count_starbase_modules = {
				type = shipyard
				count > 2
			}
		}
		...
	}

	ai_design = {
		min = {
			base = 1
			factor = 1
		}
		
		ratio = {
			base = 0.25
			modifier = {
				add = 0.10
				exists = owner
				owner = {
					has_ethic = ethic_militarist
				}
			}
			modifier = {
				add = 0.05
				exists = owner
				owner = {
					has_ethic = ethic_fanatic_militarist
				}
			}
		}

		# token followed by priority
		buildings = {
			crew_quarters = {
				base = 1.00
			}
			
			fleet_academy = {
				base = 0.25
			}

			naval_logistics_office = {
				base = 0.05
			}

			titan_yards = {
				base = 0.01
			}

			colossus_yards = {
				base = 0.01
			}
		}
		
		modules = {
			shipyard = {
				base = 1.00
			}

			anchorage = {
				base = 0.50
			}

			hangar_bay = {
				base = 0.45
			}
		}
	}
}

System Types

System Types are flavor texts to describe a system's functions. While not technically a part of Starbase modding, they are heavily affected by starbase modules. System Types are defined at "common/system_types/xxx.txt".

Data Structure

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