Stellaris

Stellaris

Modify the Galaxy
Modify your Stellaris experience by checking out the many mods created and shared by the community, including tweaks to almost any aspect of the game.
Learn More
Someone help me on coding? District issues
E.g. my purpose is to keep rural districts from district quantity cost on certain kinds of planets. Then I added an on_built coding here:

district_generator = {
expansion_planner = yes

base_buildtime = 240

min_for_deposits_on_planet = 3
max_for_deposits_on_planet = 15

zone_slots = {
slot_energy
}

show_on_uncolonized = {
uses_district_set = standard
exists = from
from = { is_wilderness_empire = no }
NOT = { has_modifier = resort_colony }
}

potential = {
uses_district_set = standard
OR = {
NOT = { exists = owner }
AND = {
exists = owner
owner = { is_wilderness_empire = no }
}
}
NOT = { has_modifier = resort_colony }
}

conversion_ratio = 1
convert_to = {
district_generator_uncapped
district_photosynthesis_fields
district_photosynthesis_fields_uncapped
district_nexus_1
district_hive_1
}

resources = {
category = planet_districts_generator
cost = {
minerals = @base_cost
}
upkeep = {
energy = 1
}
}

inline_script = {
script = jobs/technicians_add
AMOUNT = @base_rural_district_jobs
}

planet_modifier = {
planet_housing_add = 200
}

triggered_planet_modifier = {
potential = {
exists = owner
owner = {
has_valid_civic = civic_agrarian_idyll
}
}
modifier = {
planet_housing_add = 300
}
}

triggered_planet_modifier = {
potential = {
exists = owner
owner = { is_gestalt = yes }
}
modifier = {
planet_housing_add = 100
}
}

on_built = {
if = {
limit = {
climate = "dry"
}
add_modifier = {
modifier = planet_max_districts_add
add = 1
days = -1
}
}
}

inline_script = {
script = districts/district_triggered_name_generator
}

inline_script = {
script = districts/district_triggered_flavor_desc_generator
}

prerequisites = {
tech_power_plant_1
}

ai_weight_coefficient = 0.8
}

But it and only it doesn't work. All of my other simply modified codes works well. So if someone could help me on it? Thx in advance!!!