Europa Universalis IV

Europa Universalis IV

Not enough ratings
how to (somewhat) mod or edit certain files for Eu4 ((Currently a Work-in-progress))
By Tzard Nickolas "The Lit" Romanov
In this guide; I'll try and by god, hope to teach you on how to effectively mod certain features of eu4.

for multiple and various times now, i've tried to look them up on how to do so. (as I, myself here; am relatively new to modding eu4. aswell. So I thought i'd make a guide on the topic, for potential new modders). But all the info's been near-0 in the way of helpfulness and the official wiki is so vague; that the info there, might aswell be near-worthless to non-existent.

Also this goes without saying: *please back-up your original files or ones you have successfully modded. dont be a dead-brain and ♥♥♥♥♥ at me because *you, yourself* ♥♥♥♥♥♥ up and didn't make any back-ups.

You can use whatever here to mod these files, as long as it's able to view .txt's and other related files. (like .lua's)

(I personally use either: Notepad++ or Visual Code Studios; https://notepad-plus-plus.org
https://code.visualstudio.com )


i'll write this guide over the course of a few days/or when I have spare time, as the time that i am currently writing this; is drawing near midnight for me. your feedback and contributions, as your patience are also (and will always) be very much appreciated.
   
Award
Favorite
Favorited
Unfavorite
modding 00_isolationalism.txt (where to find it and reference, P.1 of it)
found deep within your base game files in:
(wherever the.exe of your game files is at)/common/incidents. (Yours will standardly be found in: C:/Programfilesx86(or x64, I forget)/steam/steamapps)

((This file is related to the thumbnail of this guide that you've might have seen; This relates to the shinto isolationism events specifically))


incident_neo_confucianism = {

frame = 1
variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
OR = {
has_idea_group = state_affairs_idea_groups_expanded
has_idea_group = national_propaganda_idea_groups_expanded
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { is_incident_active = yes }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.19 }
set_country_flag = active_incident_flag
}
}[/b][/u][/i]

incident_nanban = {

frame = 2

variable_initial = 4

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
OR = {
has_idea_group = trade_ideas
has_idea_group = exploration_ideas
has_idea_group = humanist_ideas
}
num_of_ports = 1
if = {
limit = {
normal_or_historical_nations = yes
is_playing_custom_nation = no
}
custom_trigger_tooltip = {
tooltip = japan_has_encountered_the_west_tooltip
has_global_flag = japan_has_encountered_the_west
}
}
if = {
limit = {
OR = {
normal_or_historical_nations = no
is_playing_custom_nation = yes
}
}
custom_trigger_tooltip = {
tooltip = encountered_other_continent_tooltip
any_known_country = {
NOT = { same_continent = ROOT }
}
}
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
modifier = {
factor = 0.7
num_of_ports = 5
}
}

immediate_effect = {
country_event = { id = shinto_events.25 }
set_country_flag = active_incident_flag
}
}

incident_firearms = {

frame = 3

variable_initial = 1

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
mil_tech = 9
OR = {
has_idea_group = standing_army_idea_groups_expanded
army_professionalism = 0.4
}
is_incident_happened = incident_nanban
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
is_incident_active = no
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.32 }
set_country_flag = active_incident_flag
}
}

incident_spread_of_christianity = {

frame = 4

variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
if = {
limit = {
normal_or_historical_nations = yes
}
custom_trigger_tooltip = {
tooltip = japan_has_encountered_the_west_tooltip
has_global_flag = japan_has_encountered_the_west
}
}
custom_trigger_tooltip = {
tooltip = encountered_christian_tooltip
any_known_country = {
religion_group = christian
}
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.38 }
set_country_flag = active_incident_flag
}
}

incident_shogunate_authority = {
#Stance on central authority - Sankin Kotai, etc

frame = 5

variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
OR = {
current_age = age_of_discovery
current_age = age_of_reformation
current_age = age_of_absolutism
current_age = age_of_revolutions
has_reform = shogunate
has_reform = reformed_shogunate
has_reform = daimyo
}
OR = {
overlord = {
legitimacy = 90
}
overlord = {
is_revolutionary = no
absolutism = 50
}
AND = {
is_revolutionary = no
absolutism = 50
}
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.50 }
set_country_flag = active_incident_flag
}
}

incident_ikko_shu = {

frame = 6

variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
OR = {
current_age = age_of_discovery
current_age = age_of_reformation
current_age = age_of_absolutism
current_age = age_of_revolutions
has_idea_group = humanist_ideas
has_idea_group = religious_ideas
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.13 }
set_country_flag = active_incident_flag
}
}

incident_wokou = {

frame = 7

variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
num_of_ports = 1
any_known_country = {
num_of_ports = 1
NOT = { religion = shinto }
}
any_neighbor_country = {
exists = yes
}
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.1 }
set_country_flag = active_incident_flag
}
}

incident_urbanization = {

frame = 8

variable_initial = 0

potential = {
has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = {
OR = {
has_idea_group = imperial_idea_groups_expanded
has_idea_group = engineer_idea_groups_expanded
province_has_center_of_trade_of_level = 3
}
num_of_cities = 2
custom_trigger_tooltip = {
tooltip = shinto_incident_recent_tooltip
NOT = { has_country_flag = active_incident_flag }
OR = {
had_country_flag = { flag = shinto_incident_recent days = 120 }
}
}
}

mean_time_to_happen = {
months = 2
}

immediate_effect = {
country_event = { id = shinto_events.7 }
set_country_flag = active_incident_flag
}
}
breaking-down the important fundamental 00_isolationalism parts and the P.2 of it
we'll use the first incident in 00_isolationalism as an example (that being the Neo-confucian, I shall also break it down bit by bit):

incident_neo_confucianism = {

frame = 1
variable_initial = 0

potential = { -This whole section; is related to dlc use and religion-group specific and
country related

has_dlc = "Mandate of Heaven"
religion = shinto
}

trigger = { -This is the trigger conditions for the isolation incidents
OR = { This means ""One of the following must be true, if it has something above it. that means it is mandatory thing that you *must* do to unlock said thing""
has_idea_group = state_affairs_idea_groups_expanded
has_idea_group = national_propaganda_idea_groups_expanded
-these two; are idea groups requirements that you must meet, im specifically using idea groups expanded

}




So, we broke-down the important bits. but there are still some more effects we can place in the "OR" section or above it here to add a ""Non-Obvious"" condition: ((Also please follow the formatting in the .txt))

army_professionalism = 0.4 (this adds a army-professionalism requirement; that you must reach, you must also use 0.1-0.9 for 10%, 20% and etc here, I believe that "1.0" is a 100%)

mil_tech = 9 (is a tech requirement that must be reached; you can use dip and adm instead of mil. and the number can range from 4-32)

current_age = age_of_discovery (This is the age requirement that must be reached, before said thing happens; You can replace the discovery with the other age's names here)

has_reform = daimyo (This is the government reform you must have in order for it to fire or happen, you can use whatever reform found in game here. Gov'-reforms can be found in: common/governmentreforms)

province_has_center_of_trade_of_level = 3 (This is a center of trade requirement that must be reached; the number goes to 1-3. 1 being the lowest and 3 being the highest)

is_institution_enabled = new_world_i (this means *if the institution has globally spawned yet requirement for the event/thing to happen*, the "new_world_i" means the "colonisation" institution.
I believe if you replace the "*has*" with "*is*". it makes it, so that it's country-only/specific or related here)

Modding 00_buildings.txt (Where to find it, the basic info of it and info expanded)
" #Do not change tags in here without changing every other reference to them.
# If adding new buildings, make sure they are uniquely named.

# cost = x #==> cost in $ to build (subject to other modifiers)
# time = x #==> number of months to build.
# modifier = m # a modifier on the province that the building gives
# trigger = t # an and trigger that needs to be fullfilled to build and keep the building
# one_per_country = yes/no # if yes, only one of these can exist in a country
# manufactory = { trade_good trade_good } # list of trade goods that get a production bonus
# onmap = yes/no # show as a sprite on the map

# FROM = owner
# ROOT = province

# Building AI is now mainly hard-coded. The AI will estimate how much it gains yearly from each building,
# convert the value to ducats, and take the building with biggest yearly return as a percentage of the build cost.
# If lower than 1%, the AI will not consider the yearly return worth it.
# It will also require higher yearly return if the economy in not in prime shape.
# Forts' value also get converted to a yearly return based on terrain and strategic position, as well as available budget for fort maintenance.

# AI can still be modded though; it will multiply the yearly return with the value of ai_will_do.
# If you don't want the AI to build a building at all, make ai_will_do become 0.
# AI will consider each building to be worth 0.01 ducats per year as a base, so making ai_will_do above cost will have them build it at some point.
# It will still check whether it can afford a building before doing so though, but may save up to it."


-Directly copied from the 00_buildings.txt (saves me from writing more, it's found in "common"/buildings


some effects that aren't going to be so easily found anywhere online:

local_prosperity_growth = 0.2 (A regular amount without the "-" is positive in-game, be warned though; that some modifiers work vice versa in some few cases, this brings prosperity growth to a singular province)

province_prosperity_growth = 0.2 (A regular amount without the "-" is positive in-game, be warned though; that some modifiers work vice versa in some few cases again, this variant is for *all* provinces in a state)

global_prosperity_growth = 0.2 (same as the two up above here but *globally* for your nation)

province_unrest = -0.2 (The amount with the "-" represents a negative number in-game. again watch out for vice versa modifiers/ones you could easily mistake for a "0.2" here, this is for *all provinces in a state* once more)

local_unrest = -0.2 (The amount with the "-" represents a negative number in-game. again watch out for vice versa modifiers/ones you could easily mistake for a "0.2" again here, this is for only *a singular province* again)

global_unrest = -0.2 (is the same like the two up above but *globally* for your nation

reform_progress_growth = 0.2 (ticking Reform progress for the government reforms)

add_army_professionalism = 0.4 (add's army professionalism)

ship_recruit_speed = -0.4 (This is for the recruit speed for ships; For some reason this ones unique as it's only for local but does not contain "local" in it.)

local_ship_cost = -0.4 (Ship cost built in a singular province)

local_ship_repair = 0.4 (ship repair time in a singular province)

drill_gain_modifier = 0.12 (army drill gains)

drill_decay_modifier = -0.13 (the rate at army drilling decays)

local_institution_spread = 0.035 (how much a institution spreads in a singular province)

"allow_in_gold_provinces = no" (You'll see this line under the production buildings; "no" -means your not allowed to place it, in gold producing provinces. "yes" -means that you are allowed to and they'll act like regular buildings)

also a friendly reminder: Some of these values, need to be cut *even further in half*; (in 0.02) instead of 0.2 like army professionalism.

(Will post a couple here that make sense and aren't completely broken for said buildings: for the production buildings; local_production_efficiency = 0.400 would be 40.0% for the workshop.
for then the counting house would be 0.800, so in game that would be then 80.0% in-game, same goes with/for tax.
reform_progress_growth = 0.05 for a +5.0% rate,
for institution spread it would be 0.035 for +3.5% and finally for the manufactories "local_production_efficiency" it would be: 1.0000 for a 100% increase)