War modding

From Stellaris Wiki
Jump to navigation Jump to search

Version

Outliner top.png
This article has been verified for the current PC version (2.7) of the game.

This page is about modding Casus Belli and War Goal.

Casus Belli[edit]

Casus Belli are defined at "common/casus_belli/xxx.txt".

Data Structure[edit]

  • show_in_diplomacy = <yes/no> - Determines should this casus belli be shown in diplomacy view.
  • show_notification = <yes/no> - Determines should this casus belli generate a notification message on granted.
  • potential - A block of Conditions to determine is this casus belli valid. If false, this casus belli can't be added by any mean. (Country scope, THIS = casus belli owner, FROM = casus belli target)
  • is_valid - A block of Conditions to be checked everyday. If true, this casus belli is automatically enabled, otherwise its automatically disabled. This property is irrelevant if this casus belli is added by script.
  • destroy_if - A block of Conditions to be checked everyday. If true, this casus belli is automatically disabled. Affects only script added casus belli.

CB Example[edit]

This is the Subjugation casus belli.

cb_subjugation = {
	show_in_diplomacy = yes
	show_notification = yes
	potential = {
		OR = {
			is_country_type = default
			is_country_type = awakened_fallen_empire
		}
		NOT = { is_in_federation_with = from }
		is_subject = no
	}
	is_valid = {
		NOT = { is_overlord_to = FROM }
		is_country_type = awakened_fallen_empire
		NOT = { has_authority = auth_machine_intelligence }
	}
}

Only Awakened Fallen Empires can have this casus belli automatically granted. Regular empires must have it granted via script.

An localisation must be defined with key "casus_belli_xxx:".

War Goal[edit]

War Goals are defined at "common/war_goals/xxx.txt".

Data Structure[edit]

  • casus_belli = <casus belli key> - Required. Determines the CB to use this War Goal against the target.
  • hide_if_no_cb = <yes/no> - If yes, this war goal is hidden if the required casus belli isn't present.
  • set_defender_wargoal = <war goal key> - Optional. The defender will be forced to use the specified War Goal.
  • defender_default = <yes/no> - If the defender hasn't picked a War Goal in time, it will have the defender default war goal (vanilla is wg_humiliation). If multiple war goals are set to be defender default, the first one scripted in the file is chosen.
  • threat_multiplier = <float> - Threat generated by conquering systems and planets is multiplied by this value during a war of this war goal.
  • cede_claims = <yes/occupied_only/no> - Determines should the attacker cede claimed systems from the defenders.
    • If yes, users of this war goal will cede all claims from the other side if won the war, and will only cede fully occupied claims if the war ended in a status quo.
    • if occupied_only, users of this war goal will only cede fully occupied claims only if they didn't lose this war.
    • If no, users of this war goal will never cede claims.
  • release_occupied_systems_on_status_quo = <yes/no> - If yes, after a status quo, systems occupied will be released as an independent empire if any colony with at least one non-robot sapiant pop present on that planet.
    • Users of this war goal will always cede fully occupied claims first. If all capable colonies were ceded this way, the occupied systems won't be released.
  • surrender_acceptance = <int> - Determines AI surrender acceptance.
  • war_exhaustion = <float> - War Exhaustion generated during this war is multiplied by this value.
  • show_claims_in_description = <yes/no> - Determines should claims be displayed in description.
  • potential & possible - Blocks of Conditions to check if this war goal listed / usable against target empire. (Country scope, THIS = war goal user, FROM = war goal target)
  • on_accept & on_status_quo - Blocks of Effects to be executed when this war goal is accepted (because the opponent surrendered) or when the war is ended in a status quo. (Country scope, THIS = war goal user, FROM = war goal target)
    • Use the following conditions to check if any empire was released this way.
exists = last_created_country
last_created_country = { has_country_flag = released_empire }
  • total_war = <yes/no> - Determines is this war goal a total war war goal.
    • Systems occupied by this side will be immediately ceded, making cede_claims and release_occupied_systems_on_status_quo fields irrelevant.
    • If the other side surrenders, all of their systems will be ceded. AI will never surrender to a total war war goal even if they are allowed to.
    • Since claims make no sense during a total war, vanilla game rules will prevent claims from being made if an empire can only use total war war goals on another empire, such as the case of Civic fanatic purifiers.png Fanatic Purifiers.
  • allowed_peace_offers = { ... } - Determines what kind of peace offer is allowed when using this War Goal. Can consist of any number of the following: status_quo, surrender, demand_surrender. Vanilla Total War War Goals use this to prevent surrenders during Total Wars, making them can only end in a status quo or the total destruction of either side.

In addition, an icon (at /interface with "GFX_xxx") and a localisation should be defined (with keys "war_goal_xxx:", "war_goal_xxx_desc:").

WG Example[edit]

This is the Subjugation war goal.

wg_subjugation = {
	casus_belli = cb_subjugation

	hide_if_no_cb = no
	release_occupied_systems_on_status_quo = yes

	allowed_peace_offers = {
		status_quo
		surrender
		demand_surrender
	}

	surrender_acceptance = -100


	potential = {
		NOR = {
			has_valid_civic = civic_inwards_perfection
			has_authority = auth_corporate
		}
		has_total_war_cb = no
	}
	possible = {
		custom_tooltip = {
			fail_text = has_claimed_all_systems
			from = {
				is_country_type = default
				any_owned_planet = {
					is_colony = yes
					root = {
						NOT = { has_claim = prev.solar_system }
					}
				}
			}
		}
	}
	on_accept = {
		hidden_effect = {
			from = {
				add_threat = {
					who = root
					amount = 0.5
				}
			}
		}
		from = {
			set_subject_of = {
				who = root
				subject_type = vassal
			}
		}
	}

	on_status_quo = {
		if = {
			limit = {
				last_created_country = {
					has_country_flag = released_empire
				}
			}

			last_created_country = {
				set_subject_of = {
					who = root
					subject_type = vassal
				}
			}
		}
	}

	ai_weight = {
		weight = 10
		modifier = {
			factor = 0
			has_ai_personality_behaviour = wants_tribute
		}
	}
}

On victory, the winners will cede all claims and the primary loser will become a vassal of the primary winner.

  • If winners would cede all colonies of the primary loser, making them nonexistent, this war goal can't be used at the first place. However the attacker can add further claims after they declared the war.

On status quo, Empires of this side will cede all fully occupied claims, then an independant empire is created from all remaining fully occupied enemy systems and it becomes a vassal of the primary winner.

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