5. Dharper's study, despite being masterly conducted, left its readers in the deepest sorrow: nobody could tell the formula nor have any influence over it. Fortunately some subversive modders stood against this injustice and decided to fight back. In Magna Mundi, ubik designed a generic idea picker which proved very powerful and easily moddable; let me show you the principle:
First, set an AI-only requirement, for every idea
Code:
grand_army = {
trigger = {
NOT = { has_country_modifier = ni_changed }
OR = {
NOT = { ai = yes }
has_country_flag = grand_army_enabled
}
}
land_forcelimit_modifier = 0.5
land_tech_cost_modifier = -0.03
global_manpower_modifier = 0.10
infantry_cost = -0.10
war_exhaustion = -0.01
max_war_exhaustion = -1
}
military_drill = {
trigger = {
NOT = { has_country_modifier = ni_changed }
OR = {
NOT = { ai = yes }
has_country_flag = military_drill_enabled
}
}
global_manpower_modifier = 0.10
land_morale = 0.80
discipline = 0.05
war_exhaustion = -0.01
max_war_exhaustion = -1
}
### etc.
Next, an event fires whenever an AI has a free idea slot (remember it can't choose any right now because it doesn't meet the requirement we've set previously). The event will help the AI decide which type of idea it needs, naval, land, exploration, state or culture. Here's a glimpse:
Code:
country_event = {
id = 623052
trigger = {
free_ideas = 1
ai = yes
NOT = { has_country_flag = navy_ni_enabler }
NOT = { has_country_flag = army_ni_enabler }
NOT = { has_country_flag = exploration_ni_enabler }
NOT = { has_country_flag = state_ni_enabler }
NOT = { has_country_flag = culture_ni_enabler }
NOT = { has_country_flag = grand_navy_enabled }
NOT = { has_country_flag = sea_hawks_enabled }
NOT = { has_country_flag = superior_seamanship_enabled }
NOT = { has_country_flag = excellent_shipwrights_enabled }
NOT = { has_country_flag = naval_fighting_instruction_enabled }
NOT = { has_country_flag = naval_provisioning_enabled }
NOT = { has_country_flag = grand_army_enabled }
NOT = { has_country_flag = military_drill_enabled }
NOT = { has_country_flag = engineer_corps_enabled }
NOT = { has_country_flag = battlefield_commisions_enabled }
NOT = { has_country_flag = national_conscripts_enabled }
NOT = { has_country_flag = regimental_system_enabled }
NOT = { has_country_flag = merchant_adventures_enabled }
NOT = { has_country_flag = colonial_ventures_enabled }
NOT = { has_country_flag = shrewd_commerce_practise_enabled }
NOT = { has_country_flag = vice_roys_enabled }
NOT = { has_country_flag = smithian_economics_enabled }
NOT = { has_country_flag = improved_foraging_enabled }
NOT = { has_country_flag = bureaucracy_enabled }
NOT = { has_country_flag = vetting_enabled }
NOT = { has_country_flag = national_trade_policy_enabled }
NOT = { has_country_flag = espionage_enabled }
NOT = { has_country_flag = cabinet_enabled }
NOT = { has_country_flag = bill_of_rights_enabled }
NOT = { has_country_flag = church_attendance_duty_enabled }
NOT = { has_country_flag = divine_supremacy_enabled }
NOT = { has_country_flag = patron_of_art_enabled }
NOT = { has_country_flag = humanist_tolerance_enabled }
}
mean_time_to_happen = {
days = 8
}
title = "EVTNAME623052"
desc = "EVTDESC623052"
option = {
name = "EVTOPTA623052"
ai_chance = {
factor = 19
days = 1
modifier = { ### put here any modifier you want, to refine the AI's choices
factor = 0 #exclusion
NOT = { num_of_ports = 1 }
}
modifier = {
factor = 2
num_of_ports = 10
}
modifier = {
factor = 0.5
NOT = { num_of_ports = 2 }
}
modifier = {
factor = 2
land_naval = 1
}
modifier = {
factor = 0.5
NOT = { land_naval = 0 }
}
modifier = {
factor = 0
AND = {
idea = grand_navy
idea = sea_hawks
idea = superior_seamanship
idea = excellent_shipwrights
idea = naval_fighting_instruction
idea = naval_provisioning
}
}
}
set_country_flag = navy_ni_enabler
}
### There are 4 more options not listed here, for land, exploration, state, and culture ideas
}
Now the AI knows which type will fit best, and only has to pick among its family. Let's say it chose the naval type, the same principle applies here:
Code:
country_event = {
id = 623053
trigger = {
has_country_flag = navy_ni_enabler
}
mean_time_to_happen = {
days = 8
}
title = "EVTNAME623053"
desc = "EVTDESC623053"
option = {
name = "EVTOPTA623053"
ai_chance = {
factor = 18
days = 1
modifier = {
factor = 0
idea = grand_navy
}
modifier = {
factor = 1.25
navy_size_percentage = 1.1
}
modifier = {
factor = 1.25
navy_size_percentage = 1.25
}
modifier = {
factor = 1.5
navy_size_percentage = 1.4
}
modifier = {
factor = 1.5
navy_size_percentage = 1.6
}
modifier = {
factor = 2
navy_size_percentage = 1.8
}
}
set_country_flag = grand_navy_enabled ### here's the needed requirement! hurray!
clr_country_flag = navy_ni_enabler
}
### Same, 5 more options not listed here, for the other choosable naval ideas (Naval Glory being an exception)
}
Clever hey? Now it takes a little patience to find a good balance with these modifiers, but once you have it you won't see the difference between a human and an AI anymore!