Pops modding

本页面所适用的版本可能已经过时,最后更新于1.0


Location

Pop types are located in game/common/pop_types.

Structure

Each pop type is defined in its own top-level block. The name of the type determines the pop's key.

game/common/pop_types/pop.txt

[pop] = {
	[fields]
}

Required fields

Key Value type Description Example
demotes_to pop What pop this pop demotes to. Can be the same pop type to prevent actual demotion. demotes_to = tribesmen
conquest_demote_chance int[0..100] UNCONFIRMED The chance for this pop to be demoted when the city is conquered. conquest_demote_chance = 50
base_happyness decimal[0.0..1.0] The base happiness of the pop. base_happyness = 0.2
color color The colour used for this pop in the pie chart for pops composition. color = hsv { 0.65 0.7 0.8 }

Optional fields

Key Value type Default Description Example
province modifier decimal N/A Applies the modifier to the province, multiplied by the pop's current happiness. tax_income = 0.015
can_promote_to pop none What pop type can this pop promote to via manual promotion in the UI. can_promote_to = citizen
score bool no If yes, this pop counts for scoring. score = yes
block_colonization bool no If yes, this pop can't be used to colonise provinces. block_colonization = yes
ai_max_percentage int[0..100] unknown UNCONFIRMED How many pops max of this type the AI will aim for in a given province. ai_max_percentage = 30

Dynamic script elements

Prices

Key Description Example
[pop]_promotion The cost of promoting to the given pop. Only used for pops that can be promoted to. citizen_promotion = { oratory = 10 }
[pop]_move The cost of forcibly moving the given pop. slaves_move = { civic = 5 }

Modifiers

Key Scope Description Example
local_[pop]_happyness province Applied to the happiness of all pops of this type in the province. local_freemen_happyness = 0.25
global_[pop]_happyness country Applied to the happiness of all pops of this type in the country. global_freemen_happyness = 0.10
local_[pop]_output province Applied to the output of all pops of this type in the province, after happiness. local_tribesmen_output = 0.05
global_[pop]_output country Applied to the output of all pops of this type in the country, after happiness. global_citizen_output = 0.1

Triggers

Key Value Scope Description Example
[pop]_happiness decimal[0.0..1.0] province Compares with the (average?) happiness for the pops of this type in the province. slaves_happiness <= 0.40
num_of_[pop] int[0..inf] province Compares with the amount of pops of this type in the province. num_of_citizen >= 4

Related

Effects

  • create_pop
  • create_state_pop
  • define_pop
  • kill_pop
  • move_pop
  • set_pop_culture
  • set_pop_culture_same_as
  • set_pop_religion
  • set_pop_religion_same_as
  • set_pop_type

Triggers

  • pop_culture
  • pop_culture_group
  • pop_religion
  • pop_type
  • pop_hapiness
  • country_population
  • total_population

Lists

  • pops_in_province

Localisation

Key Description Example
[pop] The localisation key for the pop. Should be singular. freemen:0 "Freeman"
[pop]_header UNKNOWN, but probably when saying stuff like "2 Citizens". citizen_header:0 "#t Citizens#!"

Example

citizen = {                             # Defines a new pop type with the "citizen" key.
	research_points = 0.25          # This pop type produces 0.25 research points per pop at 100% happiness and +0% output...
	commerce_value = 0.01           # ...and adds 0.01 commerce value to the province.
	demotes_to = freemen            # When the pop is demoted, usually through conquest, it demotes to a pop of the freemen type.
	
	conquest_demote_chance = 50     # On conquest, each citizen pop has a 50% chance to be demoted. UNCONFIRMED, LOOKS A BIT HIGH, TEST OUT
	
	base_happyness = 0.2            # The base happiness of pops of this type is 20%.
	
	score = yes                     # This pop is used for scoring.
	
	color = hsv { 0.65  0.7  0.8 }  # This pop's colour in pop pie charts is blue.
	
	ai_max_percentage = 30          # UNKNOWN
}

Adding a pop type

The game automatically adds a row for new pop types in the file game/common/province_setup.csv, and an entry is then needed on each row for the game to be able to interpret the file correctly. The new row is added alphabetically within the four existing pop type rows. If the new pop-type starts with "M", its new row will be inserted between "Freedmen" and "Slaves". Thus, taking Roma as an example, starting with 1 pop-type "M":

1,roman,roman_pantheon,cloth,21,15,1,4,3,40,0,Roma,Latium

Note the "1," inserted between the freedmen amount 15 and slave amount 4. Again, this has to be done on each row.