This page is about how to modify existing and how to create new Factions.
Factions are defined at "common/pop_faction_types/xxx.txt".
Data Structure[edit | edit source]
| Property | Description |
|---|---|
| election_header = <GFX entry key> | Determines the header texture to be attached to the leader entry in democratic election window.
|
| guiding_ethic = <ethic key> | Determines the guiding ethic of this faction.
By default, only pops with of this ethic can join the faction. |
| use_guiding_ethic_as_pop_filter = <yes/no> | If no, pops without the guiding ethic can join the faction. |
| unique = <yes/no> | If yes, only one instance of this faction can exist in an Empire. Vanilla factions always have "yes". |
| support_multiplier = <float> | |
| resources | An Economy Unit to determine the resource production of this faction. The production is mulitplied by faction support rate and faction approval.
Vanilla factions always have economy category |
| is_potential | A block of Conditions to determine should an Empire have this faction.
Vanilla factions always exclude |
| parameters | Pre-defined parameters to be called by Faction Actions.
Vanilla always define it like this, making parameters = {
empire = {
type = country
valid_objects = {
is_same_value = root
}
}
}
|
| can_join_pre_triggers | A block of Pseudo-Conditions to determine can a Pop join this faction. Only the following yes-or-no questions are allowed. Vanilla always have is_enslaved = no and is_being_purged = no. Without the pre-triggers, the whole set of conditions will be evaluated once for each of the thousands of Pops in the galaxy, which can be performance intensive.
|
| can_join_faction | A block of Conditions to determine can a Pop join this faction. (Pop scope) |
| attraction | Determines the attraction to Pops of this faction.
Vanilla factions always have 100 base attraction, x1.25 attraction to Pops with citizenship rights, x1.25 if faction leader is the current ruler, and x0.75 if faction has no leaders. However, a Pop can only meet the requirements of up to one faction at a time while faction leader is chosen randomly and cannot be unassigned and will be randomly chosen again if current leader is fired or diseased, making this field entirely irrelevant. |
| leader | Determines how likely a leader will be randomly chosen as the leader of this faction. Vanilla always have 100 base weight and x0 for event leaders. Supermacist factions will exclude alien leaders as well, or an alien talking about human superiority can be immersion breaking. If no leaders have a weight greater than 0, the faction will still be created but remain leaderless for the rest of the game. |
| demand | An entry of a faction issue. Multiple allowed. |
|
The flavor text part of this issue. The title can change based on if it's fulfilled or not. |
|
The faction approval impact of this issue. |
|
The former block of Conditions determines should this faction have this issue, and if yes, the later block of Conditions determines is this issue fulfilled. (Faction scope, use owner to scope to the Empire)
|
|
A block of Effects to be executed to the faction when this faction is created. Vanilla always have pop_faction_event = { id = factions.1 }, which calls the event to tell the player "a faction named FaFaFaFaction led by a leader LeLeLeLeader is created". (Faction scope)
|
|
A block of Effects to be executed to the Empire when this faction is dissolved. Vanilla always remove the "???ism Ethic Promoted" and "???ism Ethic Supressed" static modifiers for the Empire. (Country scope) |
|
A list of entries to define actions an Empire can take to this faction. |
|
The flavor text part of this faction action. |
|
The cost of this action. |
|
The former block of Conditions determines should this faction have this action listed, and if yes, the later block of Conditions determines can this action be performed. (Faction scope) |
|
A block of Effects to be executed when this action is taken. (Faction scope) |
|
How likely the AI will use this action. |
Faction Example[edit | edit source]
Imperialist Faction[edit | edit source]
imperialist = {
election_header = "GFX_faction_header_yellow"
guiding_ethic = ethic_militarist
unique = yes
support_multiplier = 1
resources = {
category = pop_factions
produces = {
influence = 2
}
}
is_potential = {
years_passed > 10
has_encountered_other_species = yes
NOT = { has_ethic = ethic_gestalt_consciousness }
}
parameters = {
empire = {
type = country
valid_objects = {
is_same_value = root
}
}
}
can_join_pre_triggers = {
is_enslaved = no
is_being_purged = no
}
can_join_faction = {
is_shackled_robot = no
has_culture_shock = no
NOT = { has_trait = trait_nerve_stapled }
OR = {
has_ethic = ethic_militarist
has_ethic = ethic_fanatic_militarist
}
}
attraction = {
base = 100
modifier = {
factor = 1.25
exists = from
from = {
exists = leader
leader = { leader_class = ruler }
}
}
modifier = {
factor = 0.75
exists = from
from = {
NOT = { exists = leader }
}
}
modifier = {
factor = 1.25
has_citizenship_rights = yes
}
}
leader = {
base = 100
modifier = {
factor = 0.0
is_event_leader = yes
}
}
demand = {
title = "FACTION_OUTRAGED_GC"
unfulfilled_title = "FACTION_OUTRAGED_GC"
desc = "FACTION_OUTRAGED_GC_DESC"
fulfilled_effect = -20
unfulfilled_effect = -0.001
potential = {
exists = owner
owner = {
has_country_flag = faction_militarist_outraged_gc
}
}
trigger = {
owner = {
has_country_flag = faction_militarist_outraged_gc
}
}
}
...
on_create = {
pop_faction_event = { id = factions.1 }
}
on_destroy = {
if = {
limit = {
has_modifier = promoted_militarist
}
remove_modifier = promoted_militarist
}
if = {
limit = {
has_modifier = suppressed_militarist
}
remove_modifier = suppressed_militarist
}
}
actions = {
embrace_faction = {
title = "EMBRACE_FACTION"
description = "EMBRACE_FACTION_DESC"
cost = {
influence = 500
}
potential = {
exists = owner
owner = {
OR = {
is_subject = no
NOT = { is_subject_type = dominion }
}
}
}
valid = {
custom_tooltip = {
fail_text = EMBRACE_FACTION_COOLDOWN
parameter:empire = {
NOT = { has_modifier = embraced_faction_timer }
}
}
support > 0.20
parameter:empire = {
NOT = { has_ethic = "ethic_fanatic_militarist" }
}
}
effect = {
add_modifier = { modifier = embraced_faction days = 3600 }
parameter:empire = {
shift_ethic = ethic_militarist
hidden_effect = {
add_modifier = { modifier = embraced_faction_timer days = 3600 }
every_pop_faction = {
limit = { NOT = { is_same_value = root } }
add_modifier = { modifier = embraced_another_faction days = 3600 }
}
}
}
hidden_effect = {
save_event_target_as = TargetFaction
parameter:empire = {
every_relation = {
limit = {
is_ai = no
is_country_type = default
has_communications = prev
}
country_event = { id = factions.2000 }
}
}
}
}
ai_weight = {
base = 1
modifier = {
factor = 0
support < 0.50
owner = {
has_ethic = ethic_militarist
}
}
modifier = {
factor = 0
owner = { has_valid_civic = civic_fanatic_purifiers }
}
modifier = {
factor = 0
NOT = {
owner = {
exists = ruler
ruler = {
leader_of_faction = imperialist
}
}
}
}
modifier = {
factor = 0
owner = {
count_pop_factions = {
count < 4
}
}
}
}
}
promote_faction = {
title = "PROMOTE_FACTION"
description = "PROMOTE_FACTION_DESC"
potential = {
exists = owner
parameter:empire = {
NOR = {
has_modifier = suppressed_militarist
has_modifier = promoted_militarist
}
}
}
effect = {
parameter:empire = {
add_modifier = { modifier = promoted_militarist days = -1 }
}
}
ai_weight = {
base = 0
}
}
cancel_promote_faction = {
title = "CANCEL_PROMOTE_FACTION"
description = "CANCEL_PROMOTE_FACTION_DESC"
potential = {
exists = owner
parameter:empire = { has_modifier = promoted_militarist }
}
effect = {
parameter:empire = {
remove_modifier = promoted_militarist
}
}
ai_weight = {
base = 0
}
}
suppress_faction = {
title = "SUPPRESS_FACTION"
description = "SUPPRESS_FACTION_DESC"
potential = {
exists = owner
parameter:empire = {
NOR = {
has_modifier = suppressed_militarist
has_modifier = promoted_militarist
}
}
}
effect = {
add_modifier = { modifier = suppressed_faction days = -1 }
parameter:empire = {
add_modifier = { modifier = suppressed_militarist days = -1 }
}
}
ai_weight = {
base = 0
}
}
cancel_suppress_faction = {
title = "CANCEL_SUPPRESS_FACTION"
description = "CANCEL_SUPPRESS_FACTION_DESC"
potential = {
exists = owner
parameter:empire = { has_modifier = suppressed_militarist }
}
effect = {
remove_modifier = suppressed_faction
parameter:empire = {
remove_modifier = suppressed_militarist
}
}
ai_weight = {
base = 0
}
}
}
}
The AI will only embrace a faction if current ruler is the faction leader. Also,
| 帝国 | 帝国 • 思潮 • 政府 • 国民理念 • 起源 • 承诺 • 议程 • 传统 • 飞升天赋 • 法令 • 政策 • 遗珍 • 科技 • 自定义帝国 |
| 人口 | 岗位 • 派系 |
| 领袖 | 领袖 • 领袖特质 |
| 物种 | 物种 • 物种特质 |
| 行星 | 行星 • 行星特征 • 轨道矿藏 • 建筑 • 区划 • 行星决议 |
| 星系 | 星系 • 恒星基地 • 巨型结构 • 虫洞 • 星门 • 地图 |
| 舰队 | 舰队 • 舰船 • 部件 |
| 地面战 | 陆军 • 轰炸姿态 |
| 外交 | 外交 • 联邦 • 星海共同体 • 评价修正 • 宣战理由 • 战争目标 |
| 事件 | 事件 • 异常现象 • 特殊项目 • 考古遗址 |
| 游玩 | 游玩 • 定义 • 研究 • 经济 • 游戏开局 |
| 动态修改 | 动态 • 指令效果 • 触发条件 • 作用域 • 修正 • 变量 • AI |
| 媒体/本地化 | Maya 导出器 • 图形 • 肖像 • 旗帜 • 事件图片 • 界面 • 图标 • 音乐 • 本地化 |
| Other | 控制台命令 • 存档编辑 • Steam 创意工坊 • 模组制作教程 |