• 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.

MoralMonster

Second Lieutenant
9 Badges
Apr 2, 2011
173
340
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV
  • Victoria 2
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
Hi everyone. After the last update, the game stopped to see modifiers added by my mod (previously they worked properly). I looked through the Victoria 3 root folder and noticed that instead of common/modifiers folder there is some modifier_type_definition folder which is a collection of some hard-coded modifier. So, my question is: how can I recreate my own custom modifiers after this update? Thanks in advance
 
I'm fairly sure you can define new modifier types in that folder (though the exact formula might take some trial and error). Or have you tried that and it didn't work?
 
I'm fairly sure you can define new modifier types in that folder (though the exact formula might take some trial and error). Or have you tried that and it didn't work?
No, I didn't mean creating new modifier types. I meant creating custom modifiers, for example a modifier that gives +2% prestige bonus until it expires. I searched the game folder and noticed that vanilla modifiers were all moved into common/static_modifiers folder. Probably simple renaming of the "modifiers" folder of my mod will help in such case.

Btw, where can I find the actual documentation for the vic 3 modding? This wiki https://vic3.paradoxwikis.com/Modifier_types looks mostly outdated.
 
Ah, yeah new custom modifiers should go in a file in the static modifiers folder. That's where all of the event applied modifiers live now. I think they just renamed the folder for whatever reason (because the modifiers can't change values once applied maybe?)

Modding documentation on the wiki is sparse. I'm sure there are bits and bobs here and there (YouTube, reddit, this or that Discord), as well as what can be gleaned from the game files, but there is no publicly available comprehensive documentation that I'm aware of. If you feel so inclined, adding or updating the wiki pages on modding as you figure things out is much appreciated.
 
  • 1Like
Reactions:
Ah, yeah new custom modifiers should go in a file in the static modifiers folder. That's where all of the event applied modifiers live now. I think they just renamed the folder for whatever reason (because the modifiers can't change values once applied maybe?)
I've tried adding another text file with new modifiers there. It does not work.
 
I've tried adding another text file with new modifiers there. It does not work.
It works in my mod. Point me to your github or attach your code here and I can check it. My code is not in a repo yet, it's too early for v0.1 :)
 
It works in my mod. Point me to your github or attach your code here and I can check it. My code is not in a repo yet, it's too early for v0.1 :)
Sure here are two that don't work:

sca_population_boom = {
icon = gfx/interface/icons/timed_modifier_icons/modifier_flag_positive.dds
state_birth_rate_mult = 0.25
}
sca_won_lottery = {
icon = gfx/interface/icons/timed_modifier_icons/modifier_flag_positive.dds
country_tax_income_add = 6000
}
 
And this is in a file in "common\static_modifiers\" ?
 
Works for me:

1719782393257.png


Your file can be named anything, ideally shouldn't be the same as vanilla game file, with "UTF-8 with BOM" encoding, placed in "common\static_modifiers\"
 
  • 1
Reactions:
Yup. It's installed where it sould be. Here's the file:
Do you see errors in the error log related to these modifiers, when you start the game with the "debug_mode" switch?

When I downloaded your .txt file it had "UTF-8" encoding. I don't know if it has the same on your end. This is usually not a problem, but maybe try with "UTF-8 with BOM". The error log should mention the encoding if it's not "UTF-8 with BOM".
 
  • 1
  • 1Like
Reactions:
Do you see errors in the error log related to these modifiers, when you start the game with the "debug_mode" switch?

When I downloaded your .txt file it had "UTF-8" encoding. I don't know if it has the same on your end. This is usually not a problem, but maybe try with "UTF-8 with BOM". The error log should mention the encoding if it's not "UTF-8 with BOM".
How do I change/upgrade to UTF-8 with BOM?
 
How do I change/upgrade to UTF-8 with BOM?
1719783552020.png


In VSC, click here in the lower right corner of the window:
1719783612965.png



Choose "Save with encoding" from the list in the actions bar, then from the list choose the encoding:
1719783680878.png
 
  • 2
Reactions:
Here's the relevant part in the error file:
[23:41:30][lexer.cpp:363]: File 'common/static_modifiers/modded_modifiers.txt' should be in utf8-bom encoding (will try to use it anyways)
[23:42:06][modifier_type_definition_database.cpp:67]: Modifier definition power_bloc_invite_acceptance_add is missing from database
[23:42:06][pdx_assert.cpp:633]: Assertion failed: Modifier definition power_bloc_invite_acceptance_add is missing from database
[23:42:27][lexer.cpp:363]: File 'events/mod_events/scandinavian_population_boom.txt' should be in utf8-bom encoding (will try to use it anyways)
[23:42:27][jomini_dynamicdescription.cpp:66]: Unrecognized loc key scandinavian_population_boom.1.t. file: events/mod_events/scandinavian_population_boom.txt line: 7
[23:42:27][jomini_dynamicdescription.cpp:66]: Unrecognized loc key scandinavian_population_boom.1.d. file: events/mod_events/scandinavian_population_boom.txt line: 8
[23:42:27][jomini_dynamicdescription.cpp:66]: Unrecognized loc key scandinavian_population_boom.1.f. file: events/mod_events/scandinavian_population_boom.txt line: 9
[23:42:27][jomini_effect.cpp:604]: Unknown effect any_scope_state at file: events/mod_events/scandinavian_population_boom.txt line: 33
[23:42:27][jomini_dynamicdescription.cpp:66]: Unrecognized loc key scandinavian_population_boom.1.a. file: CEventOptionDesc line: 133
[23:42:27][lexer.cpp:363]: File 'events/mod_events/norwegian_republic.txt' should be in utf8-bom encoding (will try to use it anyways)
[23:42:27][character_templates_utils.cpp:1459]: Missing localization key for character last name Fleischer, reverting to random name
[23:42:57][modifier_type_definition_database.cpp:43]: Modifier type definition country_leverage_resistance_per_population_add is not a valid static or dynamic modifier type.
[23:42:57][character_templates_utils.cpp:30]: Invalid Interest Group ig_ig_trade_unions in file: common/history/characters/nor - norway.txt line: 138
[23:42:57][jomini_effect.cpp:132]: PostValidate of effect 'create_character' returned false at file: common/history/characters/nor - norway.txt line: 138
[23:42:57][character_templates_utils.cpp:30]: Invalid Character trait provided celebrity_naval_commander in file: common/history/military_formations/00_military_formations_europe.txt line: 2228
[23:42:57][jomini_effect.cpp:132]: PostValidate of effect 'create_character' returned false at file: common/history/military_formations/00_military_formations_europe.txt line: 2228
[23:42:57][jomini_effect.cpp:348]: Event target 'pop_boom_state' is used but is never set. Setting it in an unused scripted trigger or effect does not count
[23:42:57][jomini_eventmanager.cpp:370]: Event scandinavian_population_boom.1 is orphaned
 
Ok, try changing the encoding and see if the modifiers start showing in the tooltips.

If you can show the error log, then I guess you know how to start the game in debug mode. You can trigger some test event by typing "event my_event_name.1" in the console.

Fix the encoding, add the modifier to some option of an event, and trigger the event from the console, and let's see if it works.
 
  • 1Like
Reactions:
Ok, try changing the encoding and see if the modifiers start showing in the tooltips.

If you can show the error log, then I guess you know how to start the game in debug mode. You can trigger some test event by typing "event my_event_name.1" in the console.

Fix the encoding, add the modifier to some option of an event, and trigger the event from the console, and let's see if it works.
Finaly worked. Thank you!
 
  • 2Like
Reactions: