Stop AI from Towning RGOs

If you liked this item, please rate it up on Steam Workshop page.

Author: Knightbasher

Last revision: 16 Dec, 2025 at 07:57 UTC

File size: 67.97 KB

On Steam Workshop

Description:

Adds a foreign building that stops AI from towning that location. Hopefully.

Building name is: "Don’t build towns over me"

It should only be able to be built in your subject’s territories.

This is my first time making a mod for this game. Don’t expect support because I have no idea what I am doing. Suggestions and advice is appreciated.

I don’t know how to stop the AI from using it, please let me know if you have any suggestions on that

This is the code for the entire mod:

Enclosed_farmland = {
is_foreign = yes
max_levels = 1
pop_type = burghers

category = colonial_category

employment_size = foreign_trade_employment

pop_size_created = foreign_trade_employment

rural_settlement = yes

country_potential = {
is_ai = no
}

location_potential = {
owner ?= { is_colonial_subject = yes }
}

allow = {
}

build_time = rural_build_time

expensive = yes

allow_wrong_startup = yes

unique_production_methods = {
Enclosed_farmland_maintenance = {
weaponry = 0.1
category = building_maintenance
}
}

construction_demand = simple_colony_construction

modifier = {
cannot_upgrade_location = yes
}
}