Overview
This is a fairly simple guide explaining basic modding in Vic 2.I will also cover modding practices when working with the game as well as syntax explanations.
1. Locating the game files
To be able to modify anything within Victoria 2 you need to locate your local game cache. This should be located within your steam directory.
“Program Files (x86) > Steam > steamapps > common > Victoria 2”
Or
“Program Files > Steam > steamapps > common > Victoria 2”
If you don’t have a 64 bit system.
Then:
1. Locate the mod folder within the Victoria 2 Folder.
2. Create a folder within the mod folder with what you want to name your mod.
NOTE: That the folder in which your mod is located, for example if I were to create a mod called “modv” all of the Victoria 2 stuff you would wish to alter would go in here in the exact same fashion as it would in the default Victoria 2 folder.
This image can help explain.
2. Creating the .MOD file.
Now you will want to create a .MOD file. This defines your mod as well as names it, initializes it, and lets you specify what files/folders you want to load/overwrite/modify.
To do this you will want to open notepad or its equivalent such as notepad++.
Then you will define the name of the mod with
name = “Modv”
Its path with the mod folders’ name.
path = “mod/modv”
User_dir will create a different directory for user savegames and map files for your mod.
WARNING IT IS HIGHLY RECOMMENDED THAT YOU DO THIS TO PREVENT CORRUPTION WITH YOUR VANILLA AND OTHER MODDED SAVES.
user_dir = “modv”
replace_path will essentially remove the vanilla files from the game and replace them with whatever you have in your modded file location.
Note: It will not DELETE them from your Vic 2 or any modded folder.
For example this will replace the national foci with ones that I custom created.
replace_path = “common/national_focus”
And issues
replace_path = “common/issues”
The # (number symbol or hashtag) will prevent the code from being read and it will have no effect. This is true when modding the code for decisions/events/pops/etc as well.
#replace_path = “decisions”
#replace_path = “poptypes”
#replace_path = “music”
To create it as a .MOD file (so that it actually works) you must choose “Save as” the go to the “Save as type” drop down menu, choose “All Files” and when you name it put “.MOD” at the end of the file name and then save it. Afterward you can edit it by rightclicking on the file and choosing edit from the drop down menu.
Also worthy to note if you were to add national foci (or any other item) by creating a new text file it will overwrite the the vanilla foci. Such as if you don’t add the defaults into the modded version of the file they may not be in the game or it will probably crash on startup.
3. Example/Explanation of modding and localisation.
I plan to make more guides going more in depth and covering specific parts of modding but I will provide some examples of what can be done with modding the game.
This for example is a decision you can enact if your nation is one of the Boer states such as Transvaal, Natalia, or Oranje, and you have met the proper criterea.
Potential is what allows the decision to be seen within the decisions section of the in game GUI and in this case will only fire if all the critera listed is true such as:
1.The country’s primary culture is boer.
2. It does not have the global flag “boer_landt”
3. And the Union nation “Boerlandt” doesn’t exist.
In the code nations are represented by a TAG. A three letter word that usually consists of the nations initials. There is a list of them within the game files and you must define one for a nation you wish to create but I will go more in depth with this later. In this case Boerlandt, a nation I created TAG is BDT.
Allow, is what allows you to press the check mark of the in game GUI and set the decision into effect. In this case I use AND/OR structures.
AND = {
}
Means that it returns true if all the criterea within the brakets is also true.
OR = {
}
Means that it returns true if ONE of the criterea within the brakets is true.
Otherwise they are both false.
NOT = {
}
Means that it will return true if the criterea is false.
For example NOT = {exists = BDT} will return true if boerlandt does not exist.
You can also make AND/OR structures as well.
OR = {
AND = {
TAG = USA
prestige = 100}
AND = {
TAG = GER
prestige = 125}
}
This will fire IF you are the USA AND have 100 prestige OR Germany AND have 125 prestige.
Get it?
Please look over the code as well, I have made notes within it.
political_decisions = {
form_boerlandt = {
potential = {
primary_culture = boer
NOT = {has_global_flag = boer_landt}
NOT = {exists = BDT}
}
allow = {
#In this allows case it will return true if the target country is NOT at war and its prestige is equal to #100 or its a secondary or great power.
AND = { war = no
OR = { prestige = 100
is_secondary_power = yes
is_greater_power = yes}
}
}
effect = {
#Effect is what will happen if the decision is enacted. In this case the Boer States will lose their #cores and Boerlandt will gain them.
2108 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2110 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2114 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2109 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2107 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2102 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2101 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2103 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2106 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2111 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
2105 = { add_core = BDT
remove_core = ORA
remove_core = NAL
remove_core = TRN}
#The allows case will also set a global flag, change the player to control Boerlandt with #change_tag = BDT, add 15 prestige and remove 2 militancy and conciousness from the #population. It will also send an event to Oranje, Transvaal, and Natalia prompting them to unite #with their Union nation.
set_global_flag = boer_landt
change_tag = BDT
prestige = 15
militancy = -2.00
consciousness = -2.00
add_accepted_culture = dutch
add_accepted_culture = british
any_country = {
country_event = {id=99004 days=0}
limit = {
OR = {
tag = TRN
tag = ORA
tag = NAL
}
}
}
ai_will_do = {factor = 1}
#The ai_will_do factor determines the AIs response to the decision (whether to enact it) in this #case it always will if all the criterea are met.
}
}
4. Localisation
You see that nations are just tags like BDT USA and GER in the code but what makes them actual words like The USA, Boerlandt, and Germany in game?
Localisation!
C:Program Files (x86) > Steam > steamapps > common > Victoria 2 > mod > modv > localisation
Within your mod directory you should create a localisation file for your mod to define strings within it.
A localisation file is a Comma seperated Values file which means it has a very peculiar syntax.
Like this:
STRING_EXAMPLE;This is an example of localisation!;;;;;;;;;;;;x
The string name such as form_boerlandt_title would go before the semicolon and the text you want to appear in its place will go afterward folllowed by ;;;;;;;;;;;;x
To make one use the same steps for the .MOD file but instead put .CSV at the end of the name and follow the proper syntax.
You can put as many words in the document as you see fit. Just follow the syntax.