Army modding

From Stellaris Wiki
Jump to navigation Jump to search

Version

Outliner top.png
Please help with verifying or updating older sections of this article. At least some were last verified for version 2.6.

This article is for the PC version of Stellaris only.

This page is about modding Armies.

Data Structure[edit]

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 benifit from army enhancing species traits like Strong.png Strong.
  • pop_limited = <yes/no> - If yes, this army is not counted towards any clauses even if it has has_species = yes. Used for Army clone.png 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 Job soldier.png 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[edit]

Example: Assault Army[edit]

# 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[edit]

# 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[edit]

# 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[edit]

# 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
	}
}
Empire EmpireEthicsGovernments • Civics • OriginsMandatesAgendasTraditions • Ascension PerksEdictsPoliciesRelicsTechnologiesCustom Empires
Pops JobsFactions
Leaders LeadersLeader Traits
Species SpeciesSpecies Traits
Planets PlanetsPlanetary Feature • Orbital DepositBuildings • DistrictsPlanetary Decisions
Systems SystemsStarbasesMegastructuresBypassesMap
Fleets FleetsShips • Components
Land Warfare ArmiesBombardment Stance
Diplomacy Diplomacy • Federations • Galactic CommunityOpinion ModifiersCasus Belli • War Goals
Events EventsAnomaliesSpecial projectsArchaeological Sites
Gameplay GameplayDefinesResources • Economy
Dynamic modding Dynamic moddingEffectsConditionsScopesModifiersVariablesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop