Army modding

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


This page is about modding Armies.

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

Armies are defined at "common/armies/xxx.txt".

  • icon_frame = <int> - The icon index this army uses in the shared icon file of all armies (gfx\interface\planetview\army_icon.dds).
  • damage = <float> - Multiplies the damage. Final damage is: 1.5-3.0 * damage
  • health = <float> - Multiplies the health. Final health is: 200 * health
  • morale = <float> - Multiplies the morale. Final morale is: 200 * morale
  • morale_damage = <float> - Multiplies the morale damage. Final morale damage is: 1.5-3.0 * damage * morale_damage.
  • has_morale = <yes/no> - If no, this army has no morale as well as they are not affected by morale damage. They can still deal morale damage.
  • collateral_damage = <float> - During a ground combat, the higher the collateral damage is, the more planetary devastation and the higher the chance of pop kills the army will inflict.
  • war_exhaustion = <float> - Multiplies the war exhaustion gained due to having this army killed. Vanilla defense armies always have 0.
  • time = <int> - Days it takes to build this army.
  • resources - An Economy Unit that determines the cost and upkeep of this army.
  • has_species = <yes/no> - Determines do this army have a species. If yes, this army is counted towards the assault army clause: an empire can't build more assault armies than the number of pops of that species that empire has. If no, this army is never counted towards any clauses, but it will also not benefit from army enhancing species traits like 强壮 Strong 强壮Strong.
  • pop_limited = <yes/no> - If yes, this army is not counted towards any clauses even if it has has_species = yes. Used for 克隆人部队 Clone Army 克隆人部队Clone Army.
  • defensive = <yes/no> - If yes, this army can't be transported.
  • is_pop_spawned = <yes/no> - If yes, this army can't be built, instead it's used for defense army spawning jobs such as 士兵 Soldier 士兵Soldier.
  • occupation = <yes/no> - If yes, this army can't be built, instead it's spawned on each captured planet.
  • potential & allow - Blocks of Conditions to determine if this army is listed / can be built on a planet. If is_pop_spawned = yes or occupation = yes, instead these blocks are determined should a pop spawn this kind of army. (Planet scope; FROM = species if army has species)
  • on_queued & on_unqueued - Blocks of Effects to be executed under the planet scope when this army is added to / removed from the planetary construction queue. (Planet scope)
  • rebel = <yes/no> - Marks this army a rebel army.
  • prerequisites = { tech_xxx } - A list of technology keys to determine the technological prerequisites of this army.
  • show_tech_unlock_if - A block of Conditions. If evaluated false, this army is hidden from the tooltips of the prerequisite techs. (Country scope)

Examples[编辑 | 编辑源代码]

Example: Assault Army[编辑 | 编辑源代码]

# Assault Armies
assault_army = {
	damage = 1.00
	health = 1.00
	morale = 1.00
	morale_damage = 1.00
	collateral_damage = 1.00
	war_exhaustion = 1.00
	time = 90
	icon_frame = 2
	prerequisites = { "tech_assault_armies" }
	resources = {
		category = armies
		cost = {
			minerals = 100
		}

		upkeep = {
			energy = 1
		}
	}

	show_tech_unlock_if = { 
		OR = {
			NOT = { has_authority = auth_machine_intelligence }
			has_valid_civic = civic_machine_assimilator
		}
	}
	potential = {
		from = {
			NOR = {
				has_trait = "trait_mechanical"
				has_trait = "trait_machine_unit"
				is_sapient = no
			}
		}
		owner = {
			OR = {
				NOT = { has_authority = auth_machine_intelligence }
				has_valid_civic = civic_machine_assimilator
			}
		}
	}
}

Example: Job Spawned Defense Army[编辑 | 编辑源代码]

# Defense Armies
defense_army = {
	defensive = yes
	is_pop_spawned = yes
	health = 1.25
	damage = 1.50
	morale = 1.25
	collateral_damage = 0.0
	war_exhaustion = 0.0 # No WE from defense armies
	icon_frame = 1
		
	potential = {
		from = {
			NOR = {
				has_trait = "trait_mechanical"
				has_trait = "trait_machine_unit"
				is_sapient = no
			}
		}
		owner = {
			is_primitive = no
			OR = {
				NOT = { has_authority = auth_machine_intelligence }
				has_valid_civic = civic_machine_assimilator
			}
		}
	}
}

Example: Count-Limited Event Army[编辑 | 编辑源代码]

# Titanic life troops
# Can build on planets with titanic life if you get event + special project there
# Should be very strong and quite expensive, but cannot get attachments and can be built only in limited numbers
# Currently limited to 3. Ideally it would be X * Num of planets you have done the project one, but that is too complex for scripts
titanic_assault_army = {
	damage = 3.0
	health = 5.0
	morale = 3.0
	morale_damage = 2.0
	collateral_damage = 3.0
	war_exhaustion = 2.0
	time = 90
	icon_frame = 8
	has_species = no

	resources = {
		category = armies
		cost = {
			minerals = 300
		}

		upkeep = {
			energy = 1
		}
	}

	potential = {
		custom_tooltip = {
			text = titanic_troop_limit_tooltip
			planet = { has_planet_flag = titanic_life_can_build }
			owner = {
				has_country_flag = titanic_life_soldiers
			}
		}
	}
	
	allow = {
		custom_tooltip = {
			text = titanic_troop_limit_tooltip
			planet = { has_planet_flag = titanic_life_can_build }
			owner = {
				has_country_flag = titanic_life_soldiers
				NOT = { 
					 check_variable = {
						which = "titanic_life_soldier_count" 
						value = 3
					}
				}
			}
		}
	}
	
	on_queued = {
		owner = {
			change_variable = {
				which = "titanic_life_soldier_count" 
				value = 1
			}
		}
	}
	
	on_unqueued = {
		owner = {
			change_variable = {
				which = "titanic_life_soldier_count" 
				value = -1
			}
		}
	}
}

Example: NPC Only Army[编辑 | 编辑源代码]

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