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

LeonKenway

Private
1 Badges
Jun 14, 2016
17
2
  • Crusader Kings II
I'm encountering an issue with Victoria 2 after editing the defines.lua file while using the GFM (Greater Flavor Mod). The game crashes whenever I try to load a savegame after making the following changes:

1. I increased MIL_LACK_EVERYDAY_NEED from 0.1 to 0.6.


2. I increased AGGRESSION_BASE (AI aggression) by 5.



After making these changes, I can play for a while but when I save and want to load, the game crashes while loading the save. I double-checked the syntax, and according to Notepad++, the file is encoded in UTF-8. I’m not sure if the encoding might be causing the issue or if the values I changed are simply too extreme for the game to handle.

Has anyone else experienced crashes after modifying the defines.lua? Any suggestions on how to fix this without undoing all my changes?

Thanks in advance!
 
Last edited:
I've never personally experienced any crashing issues related to editing the defines.lua. UTF-8 shouldn't be the issue. Technically there are some value that have to be within a certain range for the game to function but the notes in the file should let you know, and neither of those values says it has to be >(x) or anything. Other than that, unless you accidently inserted a stray space or extra bracket that messed up the formatting it should run as set.

I looked through the defines.lua files of about 10 different mods and found several that alter those parameters you mentioned and afaik they function fine. For example, Supernations seems to ramp up the AGGRESSION_BASE to 9, and lowers the MIL_LACK_EVERYDAY_NEED to 0.05. However, I did notice that none of the dozen mods I looked at increased the MIL_LACK_EVERYDAY_NEED value above 0.1 a few only decreased it. I don't see why a larger value wouldn't work as the MIL_REFORM_IMPACT is 2 but the pattern may indicate something.

Assuming there's no syntax errors, the only reason I can imagine your edits would crash the game is if an extreme value causes a severe imbalance that triggers an infinite decision spam or AI loop or a stack overflow or something. For example, raising that militancy modifier could be making pops militancy constantly shoot through the roof. Some mods have decisions that lower militancy like "enact martial law" that trigger when militancy reaches a certain level and if you overtuned the militancy from no life needs every country might be constantly spamming it or getting militancy events. Similarly, setting the AI agression too high could conceivably cause the AI to malfunction. But honestly this is speculation as with these two values in particular shouldn't cause anything that creates a stack overflow error or something, or exponentially increases the data processed every tick like messing with population growth parameters.

Best advice I can give is, start with a fresh defines LUA, then try your edits again and maybe lower the values slightly, and keep lowering them until the game functions correctly. Also, just for the sake of it, maybe try launching directly from the folder to bypass steam overlay If you aren't already doing so, it can't hurt and always helps it anyways. Also, it looks like the GFM 1830 start date submod has its own defines.lua if you happen to be using that, your edits to the base GFM defines will not show up.
 
Last edited:
  • 1Like
Reactions: