I'm creating a HOI4 mod that adds new land, states, and provinces to the map. The game launches normally, but crashes while loading when I try to start a new game.
I have tried using Nudge! to fix the issue. I opened Nudge!, went to Buildings, selected "Validate All States", and saved. I then replaced my mod's buildings.txt with the generated file. However, the game still crashes. Only buildings.txt was generated, so I'm not sure if that is normal or if I need to generate other files as well.
Regarding the map changes, I have not modified any of the existing land provinces. However, I reclaimed some sea areas, which caused the original sea province 5555 to disappear completely. I reused the ID 5555 for a new land province, because otherwise the game would crash before even reaching the main menu. I also removed ports that were adjacent to the original sea province 5555, as well as ports that were originally located on the land I reclaimed. I believe the new land province 5555 is defined correctly.
I have searched this subreddit and other websites for similar problems and tried all the solutions I could find, but none of them have worked so far.
The following error appears in the game log:
Exception in: , line: 238. Description: Failed allocate data buffer.
There are also several other map-related errors and warnings, including:
MAP_ERROR: The land province 8151 - has no state.
map/buildings.txt port building has invalid sea zone for province 485.
State Error: Trying to set invalid province building "naval_base" to province #9498.
The log also contains many warnings about coastal provinces without ports and disagreements between the province bitmap and definition.
Does anyone know what might be causing this crash, or what else I should check?
This is my first time posting in this subreddit, so please let me know if there is anything I could have done better or if I have accidentally broken any rules. I have read through all the rules and guidelines, but I may have overlooked something.