Module REGION_SCRIPT_INTERFACE
Extensions to the game's region object.
Functions
| GetGrowthPoints () | Accumulated province growth points progressing towards the next population surplus point. |
| GetMemoryAddress () | Memory address of the region object in hexadecimal format. |
| GetPopulationSurplus () | Province development population surplus points (used to unlock new building slots). |
| GetReligionList () | List interface (RELIGION_LIST_SCRIPT_INTERFACE) containing all religious denominations present in this region. |
| GetReligionProportion (religion_key) | Proportion of a specific religion in this region as a normalized float (0.0 to 1.0). |
| SetGrowthPoints (value) | Sets the accumulated province growth points progressing towards the next population surplus point. |
| SetPopulationSurplus (value) | Sets the province development population surplus points (used to unlock new building slots). |
Functions
- GetGrowthPoints ()
-
Accumulated province growth points progressing towards the next population surplus point.
Returns:
-
integer
accumulated growth points
Usage:
local growth = region:GetGrowthPoints()
- GetMemoryAddress ()
-
Memory address of the region object in hexadecimal format.
Returns:
-
string
memory address (e.g. "0x12345678")
Usage:
local addr = region:GetMemoryAddress()
- GetPopulationSurplus ()
-
Province development population surplus points (used to unlock new building slots).
Returns:
-
integer
population surplus points
Usage:
local surplus = region:GetPopulationSurplus() if surplus >= 4 then -- Province has enough surplus points to expand settlement slots end
- GetReligionList ()
-
List interface (RELIGION_LIST_SCRIPT_INTERFACE) containing all religious denominations present in this region.
Use
num_items()and zero-baseditem_at(index)to iterate through the breakdown.Returns:
-
RELIGION_LIST_SCRIPT_INTERFACE
list interface containing all religions present in this region
Usage:
local rel_list = region:GetReligionList() for i = 0, rel_list:num_items() - 1 do local rel = rel_list:item_at(i) local key = rel:GetKey() local pct = rel:GetProportion() * 100 -- e.g. key = "att_rel_chr_catholic", pct = 75.0 end
- GetReligionProportion (religion_key)
-
Proportion of a specific religion in this region as a normalized float (0.0 to 1.0).
Parameters:
- religion_key
string
database key from
religions_tables(e.g."att_rel_chr_catholic","att_rel_pagan_germanic")
Returns:
-
number
religion proportion (0.0 to 1.0), or 0.0 if not present
Usage:
local pagan_pct = region:GetReligionProportion("att_rel_pagan_germanic") * 100 if pagan_pct > 50.0 then -- Paganism is the dominant majority religion in this region end
- religion_key
string
database key from
- SetGrowthPoints (value)
-
Sets the accumulated province growth points progressing towards the next population surplus point.
Parameters:
- value integer new growth points value
Usage:
region:SetGrowthPoints(500)
- SetPopulationSurplus (value)
-
Sets the province development population surplus points (used to unlock new building slots).
Persisted in savegames and immediately reflected in province development UI.
Parameters:
- value integer new population surplus value (>= 0)
Usage:
-- Grant 5 population surplus points for fast slot expansion: region:SetPopulationSurplus(5)