Bombardment Stance modding

本页面部分全部内容上次核对于3.3版本


This page is about modding the Bombardment Stances.

Data Structure[编辑 | 编辑源代码]

Bombardment stances are defiend at "common/bombardment_stances/xxx.txt".

  • trigger – A block of Conditions to determine can a fleet have this bombardment stance. (Fleet scope)
  • icon_frame = <int> – Replaced, see #Icons.
  • default = <yes/no> – If yes, newly created fleets will have this stance.
  • stop_when_armies_dead = <yes/no> – Default no. If yes, this bombardment stance will do nothing on planets without any armies.
  • abduct_pops = <yes/no> – Default no. If yes, pops killed by this bombardment stance are abducted instead. This will trigger the on_pop_abducted on-action.
  • planet_damage = <float> – Default 1. This value scales the planetary devastation inflicted by this bombardment stance.
  • army_damage = <float> – Default 1. This value scales the damage dealt to planetary armies by this bombardment stance.
  • kill_pop_chance – An instance that determines the chance of this bombardment stance to kill pops.
    • base = <float> – This value scales the default chance to kill a pop.
    • modifier – An instance that modifies the chance. It consist of a factor = <float> instance and a set of Conditions. Vanilla use this to prevent the Pox bombardment stance from killing 机械体 Mechanical 机械体Mechanical Pops. (Pop scope)
  • min_pops_to_kill_pop = <int> – Default 0. If number of pops is smaller than this, this bombardment stance won't kill pops any further.
  • ai_weight – AI will use the bombardment stance of highest weight. (ROOT = bombarding fleet, FROM = planet under bombardment)

Icons[编辑 | 编辑源代码]

Since version 3.1.* the icon_frame parameter (index in the shared bombardment stance icon file) is replaced by a more moddable friendlier method. Each stance required a (planet modifier named) "GFX_planet_modifier_ground_support_NAME" and a (button entry named) "GFX_fleet_order_button_ground_support_NAME" defined.

pox icon example (at planet_view.gfx):

spriteType = {
		name = "GFX_planet_modifier_ground_support_pox"
		sprite_sheet_sprite_type = "GFX_planet_view_bombarded"
		default_frame = 5
	}

pox button example (at fleet_view.gfx):

spriteType = {
		name = "GFX_fleet_order_button_ground_support_pox"
		texturefile = "gfx/interface/fleet_view/fleet_task_ground_support_pox_action.dds"
		effectFile = "gfx/FX/buttonstate.lua"
		noOfFrames = 3
		animation = {
			animationmaskfile = "gfx/interface/fleet_view/fleet_task_button_mask.dds"
			animationtexturefile = "gfx/interface/fleet_view/action_button_texture.dds"
			animationrotation = 180.0
			animationlooping = yes
			animationtime = 12.0
			animationdelay = 0.0
			animationblendmode = "overlay"		# add, multiply, overlay
			animationtype = "scrolling"		# scrolling, rotating, pulsing
			animationrotationoffset = { x = 0.0 y = 0.0 }
			animationtexturescale = { x = 1.0 y = 1.0 }
			animationframes = { 1 2 3 }
		}
	}
	…
	spriteType = {
		name = "GFX_fleet_order_button_ground_support_pox_selected"
		texturefile = "gfx/interface/fleet_view/fleet_task_ground_support_pox_selected.dds"
		effectFile = "gfx/FX/buttonstate.lua"
		noOfFrames = 3
		animation = {
			animationmaskfile = "gfx/interface/fleet_view/fleet_task_button_mask.dds"
			animationtexturefile = "gfx/interface/fleet_view/action_button_texture.dds"
			animationrotation = 180.0
			animationlooping = yes
			animationtime = 12.0
			animationdelay = 0.0
			animationblendmode = "overlay"		# add, multiply, overlay
			animationtype = "scrolling"		# scrolling, rotating, pulsing
			animationrotationoffset = { x = 0.0 y = 0.0 }
			animationtexturescale = { x = 1.0 y = 1.0 }
			animationframes = { 1 2 3 }
		}
	}

Example[编辑 | 编辑源代码]

This is the Pox bombardment stance.

pox = {
 	trigger = {
 		owner = {
 			# --- This modifier is given by the relevant relic --- #
 			has_modifier = javorian_pox
 			OR = {
 				NOT = { is_country_type = default }
 				has_policy_flag = orbital_bombardment_indiscriminate
 				has_policy_flag = orbital_bombardment_armageddon
 			}
 		}
 	}

 	default = no

 	stop_when_armies_dead = no
 	abduct_pops = no

 	planet_damage = 0.2
 	army_damage = 1.5

 	kill_pop_chance = { # Should only target organics
 		base = 1.5
 		modifier = {
 			factor = 0
 			pop_has_trait = trait_mechanical
 		}
 	}
 	min_pops_to_kill_pop = 0

 	# root = fleet
 	# from = planet
 	ai_weight = {
 		weight = 10
 		modifier = {
 			factor = 0.01
 			exists = from
 			from = {
 				owner = { NOT = { is_hostile = root.owner } }
 			}
 		}
 	}
 }

Bombardment Animation[编辑 | 编辑源代码]

There is an entity named "orbital_bombardment_effects" in the file "gfx/models/planets/_planetary_entities.asset". Without modding this file, any custom bombardment stances will have neither animations nor sound effects.

entity = {
 	name = "orbital_bombardment_effects"
 	pdxmesh = "bombardment_frame_mesh"

 	cull_radius = 500.0

 	# --- If multiple states named "bombard_xxx" exist, a random state is used, weighed by the "chance" field --- #
 	# --- Add more state entries for a same bombardment stance to give some randomness to the animations --- #
 	# --- The more the "event" entries, the shorter the "state_time", the more fierce the animation will look like --- #

 	state = { name = "bombard_selective" state_time = 4 looping = no next_state = "bombard_selective" chance = 1
 		event = { time = 0 node = "bombardment_location_1" particle = … } }
 		event = { time = 1 node = "bombardment_location_5" particle = … } }
 		event = { time = 2.5 node = "bombardment_location_12" particle = … } }
 	}
 	state = { name = "bombard_selective" state_time = 4 looping = no next_state = "bombard_selective" chance = 1
 		event = { time = 0 node = "bombardment_location_7" particle = … } }
 		…
 	}
 	state = { name = "bombard_indiscriminate" state_time = 3.0 looping = no next_state = "bombard_indiscriminate" chance = 1
 		event = { time = 0 node = "bombardment_location_3" particle = … } }
 		…
 	}
 	state = { name = "bombard_indiscriminate" state_time = 3.0 looping = no next_state = "bombard_indiscriminate" chance = 1
 		event = { time = 0 node = "bombardment_location_4" particle = … } }
 		…
 	}
 	state = { name = "bombard_armageddon" state_time = 2.5 looping = no next_state = "bombard_armageddon" chance = 1
 		event = { time = 0 node = "bombardment_location_1" particle = … } }
 		…
 	}
 	state = { name = "bombard_armageddon" state_time = 2.5 looping = no next_state = "bombard_armageddon" chance = 1
 		event = { time = 0 node = "bombardment_location_2" particle = … } }
 		…
 	}
 	…

 	# --- By the way, the vanilla Pox bombardment stance do NOT have any animations --- #

 	scale = 1.0
 }

Overwrite this entity and add more states following this format to apply bombardment animations and sound effects to custom bombardment stances.

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