Victoria II

Victoria II

60 ratings
Basic Modding Guide for Victoria 2
By Cider
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.
   
Award
Favorite
Favorited
Unfavorite
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.

45 Comments
Cider  [author] Aug 5, 2021 @ 2:09pm 
You can't change a province's culture. You need to change a POP's culture.
Convict 9653 For President Jul 27, 2021 @ 1:22pm 
how would i change a province's culture?
Cider  [author] Jun 30, 2021 @ 8:01am 
Flags need to be a .tga file with a 93 X 64 resolution. Did you find Nepal's TAG in the files and name is appropriately? For flags the government type is also important.
John Man Jun 30, 2021 @ 3:21am 
I tried changing the flag of a country, but it didnt do anything this is my .mod file

name = "Nepal Flag"
path = "mod/nepalflag"
user_dir = "nepalflag"
replace_path = "gfx/flags"
/AUSTRIA\Bomberman Nov 22, 2020 @ 11:19am 
if your mod wont show up in the launcher: dont write .mod big ;)
TheArizonaRacoon May 24, 2020 @ 6:45pm 
ive pretty much copy sand pated you picture in the beginning of the guide and it still wont show in the launcher, any help?
HEX: FLORIDA MAN Mar 30, 2020 @ 3:43pm 
Hi there,
First of THANK YOU!!!!!!!!! I have been trying for quite awhile to make a country unification decision but have not been able to make it work until this one so thank you. I do have one question though and its regarding adding cores to provences that I own that are not apart of the core nation like for example if I conquer Tunisia and I take the decision how do I make that I can get the cores for that region but not to remove the cores. I made this unification for the byzantine empire I know that there already is that but i tweaked it to fit the mod I created. I am just confused on a blanket add cores on provinces that I control but are not apart of the "core" empire.
Thanks again!
Ksana Nov 30, 2018 @ 3:19am 
Hi, this is a great guide however, there is a problem that has been troubling me forever when I try to mod my game.
In game all Chinese, Japanese and Korean culture are placed in the same east_asian culture group, when I take out for example Japanese and Ainu and make a seperate japanese culture group for them and put union = JAP or if I take out korean culture and make a seperate korean culture group and put union = KOR the game would always crash immediately on loading database.
I suspect it has something to do with the "# Do not change tags in here without changing every other reference to them, # If adding new groups or cultures, make sure they are unique." But I can't find any other refrences. Thank you very much if you just take some time to look at this. I can't find any threads online discussing this particular modding aspect either.
Cider  [author] May 16, 2018 @ 6:28am 
@Ethanolic Its under \common\national_focus.txt in the game directory. You would need to name the focus and follow the proper syntax like the others listed in the file.
Ethanolic May 13, 2018 @ 10:10am 
Greetings.This is a very detailed guide you got here,and I appreciate that you had the time to make it,however I still have a question:

How would one go about creating a national focus?I'm trying to make an HFM national focus submod and I have a very good idea of what to do and how to do it,what conditions to write etc as I already found a similar one suiting my needs that I would only need to edit a little bit.I just don't know where to find the file,where to edit it,if that makes sense.I'm a real noob when it comes to modding although I have succeeded in modding HOI4 once thus far,though that was long ago.