How do you move settlements without crashing the game?

Users who are viewing this thread

Lonewarrior

Sergeant
I’ve been trying to find the source of my mod crashing and I’ve narrowed it down to when I moved settlements in game.
It doesn’t matter where I put them, if I move a settlement anywhere at all, the game will crash when I load into the campaign, sometimes it does it immediately and sometimes it takes a few game days.

I’ve tried setting out a nice clean flat area with nice easy navmesh there but it still happens, it also happens on the games original navmesh as well. I’ve set it to anything from 1-4 as some of the higher navmeshes that are impassable cause the game to crash on startup of campaign if you have a settlement on it.

I’ve just tested it throughly and the backup before I moved any settlement works fine, but as soon as I reposition a settlement the crashes start.
I don’t have a clue what could possibily be causing, what am I missing?

EDIT: might have found it to be a bug in the editor. Saving one settlement at a time, closing the editor and restarting it seems so far to work, if I say move 5 settlements it seems to maybe not save properly, needs more testing.
 
Last edited:
I’ve been trying to find the source of my mod crashing and I’ve narrowed it down to when I moved settlements in game.
It doesn’t matter where I put them, if I move a settlement anywhere at all, the game will crash when I load into the campaign, sometimes it does it immediately and sometimes it takes a few game days.

I’ve tried setting out a nice clean flat area with nice easy navmesh there but it still happens, it also happens on the games original navmesh as well. I’ve set it to anything from 1-4 as some of the higher navmeshes that are impassable cause the game to crash on startup of campaign if you have a settlement on it.

I’ve just tested it throughly and the backup before I moved any settlement works fine, but as soon as I reposition a settlement the crashes start.
I don’t have a clue what could possibily be causing, what am I missing?

EDIT: might have found it to be a bug in the editor. Saving one settlement at a time, closing the editor and restarting it seems so far to work, if I say move 5 settlements it seems to maybe not save properly, needs more testing.

Main_map contains two settlements_scripts entities outside either corner of the map. These contain a SettlementPositionScript with buttons to CheckPositions, SavePositions and ComputeAndSaveSettlementDistanceCache.
I had understood that these manual buttons were a legacy feature as the script was run when the world-map scene was saved. Maybe, this is incorrect. Maybe, the script can only accommodate/update one change at a time, which would require you to run the scripts manually, after each settlement was moved for every settlement apart from the last one.
If you test this out, I'd appreciate feedback on your findings.
 
Upvote 0
Main_map contains two settlements_scripts entities outside either corner of the map. These contain a SettlementPositionScript with buttons to CheckPositions, SavePositions and ComputeAndSaveSettlementDistanceCache.
I had understood that these manual buttons were a legacy feature as the script was run when the world-map scene was saved. Maybe, this is incorrect. Maybe, the script can only accommodate/update one change at a time, which would require you to run the scripts manually, after each settlement was moved for every settlement apart from the last one.
If you test this out, I'd appreciate feedback on your findings.

Ok so I think I know what happened, probably something that I should have noticed and might be common knowledge.
There is a folder called SceneEditData in modules/sandbox, for whatever reason the time stamp wasn’t updating on my Windows folder (I usually include all files that are updated when I save my mod based on the time stamp).
However when investigating further I noticed a file inside that folder that had been update (two folders called Main_Map and backup).
For some reason you can edit any part of the map in the editor and you don’t need to include this file, except when moving settlements it seems, even though there is only one file in there called terrain_ed.bin.
I don’t know what actually happened but including that file seems to fix the crashes, I can’t see how they are related exactly.
You’ll need to backup those folders every time you save and discover a bug (as loading an older main_map and not replacing the SceneEditData when you do that corrupts the saved scene (I think).

As I’m terrible at explaining things:
If editing settlements:
Include “Main_map” and “backup” from modules/sandbox/SceneEditData in your mod

And make sure to back this file up every time you save your game in the editor if moving settlements to be safe as it overwrites itself, this is fine until you discover a bug and find you have lost an older version to fall back on.

As what I was doing was probably leaving this file as I didn’t notice it, and when trying to bug fix I was saving the older working version of my map but with a newer version of the file above meaning the data didn’t match and was probably conflicting.
 
Upvote 0
That solution seems to contradict the Taleworlds Modding documentation:
  • SceneEditData: Contains the terrain edit data for every scene. This folder may be filtered out before publishing the mod.
Unless we need to do something to filter it out, which optimises and transfers its contents elsewhere. I had assumed it just didn't need to be copied into the published mod.
 
Upvote 0
That solution seems to contradict the Taleworlds Modding documentation:
  • SceneEditData: Contains the terrain edit data for every scene. This folder may be filtered out before publishing the mod.

Huh that’s weird, all I know right now is that I’ve had no crashes Since if I include this data In the folders.
The map will be replacing the Main_Map file so there hasn’t been a need to publish the mod folders as it will directly overwrite the base game map.
 
Upvote 0
Back
Top Bottom