• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

CPTblackadder

Sergeant
117 Badges
May 30, 2011
80
34
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Magicka
  • March of the Eagles
  • Cities: Skylines - Snowfall
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars II
  • Supreme Ruler: Cold War
  • Stellaris
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - After Dark
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Pre-order
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Stellaris - Path to Destruction bundle
  • Europa Universalis III
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Darkest Hour
  • A Game of Dwarves
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
Hi all,

I recently created a mod for something I felt was missing from the game, and something that annoyed me in the play around subject countries. I wanted to write some thoughts down about the process.

First of all the debug_mode of victoria 3 is really good, the main games I've done some modding for before this one are for victoria 2 so I don't know how much has changed from eu4/hoi4/ck3 to vic 3. But the automatic reloading of files is a godsend, I remember the constant reloading of vicky 2 and finding the process very tiring.

Uploading mods to the workshop is very easy. Though it would be nice if the description was persistent and I didn't have to copy and paste the current one when doing minor updates.
Furthermore figuring out the thumbnail took a bit of effort, though looking at the vicky 3 discord eventually paid dividends there. Basic info on how a mod should be structured should be on the wiki though. Other than that though, a lot of the meta data you'd usually be editing text files for goes through GUI now, which hopefully reduces chances of typos and the like and generally felt fairly smooth.

Furthermore the amount of systems that seem comprehensively moddable is fantastic, the idea of modding diplomacy in victoria 2 need never enter your mind beyond adjusting some values (to my memory). While here you can remove alliances if you felt so inclined and just about anything else you could want to do. I remember some mods for vicky 2 would add tons of decisions and province modifiers to allow people to interact with the map more, but it always just felt clunky and cluttered the decision menu. As far as I can tell you can add buttons anywhere and for whatever reason you want in vicky 3, that do whatever is needed. This is such a massive step forward, I really look forward to what people are able to do with all these options.

The system of variables you can save seems to work very well. But it's somewhat opague to me what exactly is getting saved in what scope, it kind of makes me want to be able to step through events and check all the code to ensure the right thing is being saved and values are as I expect them at all points in the execution. Furthermore I used a variable to save the subject country being annexed, and was wondering if it was possible to use this variable in localisation. There seems to be some code that uses save_scope_as and then that is used in localisation, but I couldn't get that to work (and my reluctance to do both because it felt wrong means I sacrificed naming the subject in the localisation).

One inconsistency that irked me was that diplomatic actions have a "scope:target_country" but diplomatic plays have "scope:target". I hit this as for my diplomatic play code I took code from the annex subject diplomatic play, so probably stuff like this doesn't affect many people. It did leave me feeling a bit annoyed spending 10/20 mins or so looking into this error and not figuring out why. Part of the problem is that the error log messages I received were not very useful, see below:
[17:10:09][jomini_script_system.cpp:262]: Script system error!
Error: Event target link 'scope' returned an unset scope
Script location: file: common/diplomatic_actions/cpt_blackadder_annex_subject_actions.txt line: 7
This error exists because I changed scope:target_country -> scope:target, fortunately line number is correct so it's manageable, but other than that the message is a red herring as the "scope" part is perfectly fine. Now the "scope" in the error message with hindsight refers to scope:target and is telling me that that is what is unset. However if you don't know what the set scopes are and aren't familiar with the exact logic of the scope system this is not trivial to comprehend.

I also dabbled in making a mod that removes some very small pops and merges them together. After much searching I found the script_docs command for the debug_mode which outputs a lot of useful information, information which really should be on the wiki or some such. Having found that I realised there is no real way to access the size of a pop, which basically sank my idea for the mod. So clearly there is more data that should be opened up to being accessed and modified by mods.
I found one way to do this, where I had a decision to convert all pops to be primary culture religion (sadly not just merge some small minorities together as I ideally wanted) and did find it sped up the game substantially, though given that more migrations happen immidiately afterwards I'm not sure for how long the improvement would remain. As I wasn't really satisfied with the solution and gave up on it too soon to check the difference over a longer timescale.


TL/DR
My main points:
  • Main big positives to modding vicky 3, I'm a fan overall
  • Lack of documentation is exceptionally frustrating, especially when doing something new that isn't done in the base game yet
  • As an aside, the fact that the "script_docs" command in debug_mode is by far the best source of documentation is a real shame. Can that info not be automatically placed on the wiki?
  • Lack of some effects/triggers that seem obvious (size for a pop for example) is quite limiting
Modding questions:
  • Can I access variables in localisation?
  • When should I use save_scope_as vs set_variable?
  • Is the saved scope saved globally under that name or inside some other scope?
Kind regards,
CPTblackadder
 
  • 4
Reactions:
Lack of some effects/triggers that seem obvious (size for a pop for example) is quite limiting
Hey, I posted this on the suggestions earlier! Another one that is worrying for the future is that you can't get political information about the pop - such as knowing what IG it supports or if it's participating in political movements.