Resolved Scene Editor Settlement Position Scripts

Users who are viewing this thread

Version number
e1.6.0.
Branch
Beta
Modded/unmodded
Modded
I am working in a custom worldmap. Since updating to e.1.6.0 the game crashes on load without a valid SettlementsDistance cache. While the settlements_scripts entity in my worldmap automatically runs the settlement scripts on saving the worldmap in the scene editor, they fail. Accordingly, they need to be run manually within the scene editor.
Running the CheckPositions and SavePositions scripts updates mymod/ModuleData/Settlements.xml for its correct worldmap coordinates and saves it as Sandbox/ModuleData/Settlements.xml.
Running the ComputeAndSaveSettlementsDistanceCache saves the correct cache for my worldmap in Sandbox/ModuleData.
Currently, the xml and cache are saved in Sandbox/ModuleData, which is where the game needs them to avoid crashing on loading, but they are overwritten by any game update or when verifying local steam files as they are not Native Sandbox files.
For modders this halfway house is confusing and error prone. I hope a correction is already scheduled in Taleworlds Development lists, but note it here to ensure it isn't missed and to emphasis its priority.
For modded Worldmaps the game needs to load settlements.xml and distance cache from that mod's ModuleData.
The settlements_scripts need to save files to the relevant worldmap's ModuleData.
The bug that disables the automatic running and saving of settlements scripts on saving a modded worldmap also needs to be fixed to allow modders to build new worldmaps without having to understand any of this - as was clearly Taleworlds original design intention.
 
Correction.I'm not sure why I had problems with the auto-running of settlement scripts on saving worldmaps from the editor, but that appears to be working fine now. Accordingly, my remaining concern is saving the distance cache and settlements.xml in Native locations where they are overwritten by updates etc and can't be published in a self-contained mod.
 
Setting up a settlements.xslt file in accordance with TW official documentation ensures the game uses the settlements.xml replacements in a mod's ModuleData folder. However, the settlement position scripts still check positions from and save positions to Sandbox/ModuleData, creating a useless hybrid with Calradian names and a mod's coordinates. Equally, the distance cache bin is always saved by the scripts into Sandbox/ModuleData and read from there by the game unless recoded. This remains the case on e.1.7.0.
 
Back
Top Bottom