Resolved Scene Editor Map Pathfinding Error - SandBox.MapScene.GetNavigationMeshCenterPosition(PathFaceRecord face)

Users who are viewing this thread

Version number
1.2.9
Branch
Main
Modded/unmodded
Modded
Hello everyone.
I am in the process of developing a mod, which requires its own world map. For this I copy the map from the Vanilla version, take it to another module and start working with it. I keep the same name so that my map overwrites the base game map.
I also copy the distance_cache_bin from the vanilla game and take it to the ModuleData of my module.
Everything is fine with the terrain modification and everything else, however I get errors when I try to modify the pathfinding.
If I delete just one of the vertices of the pathfinding, the game throws an error. I can modify the pathfinding already set, but what I really want is to delete that pathfinding and generate a new one from scratch.


Exception information
Type: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source: SandBox
CallStack:

  1. at Vec2 SandBox.MapScene.GetNavigationMeshCenterPosition(PathFaceRecord face)
  2. at Settlement TaleWorlds.CampaignSystem.GameComponents.DefaultMapDistanceModel.GetClosestSettlementForNavigationMesh(PathFaceRecord face)
  3. at bool TaleWorlds.CampaignSystem.GameComponents.DefaultMapDistanceModel.GetDistance(IMapPoint fromMapPoint, Settlement toSettlement, float maximumDistance, out float distance)
  4. at Settlement Helpers.SettlementHelper.FindNearestSettlement(Func condition, IMapPoint toMapPoint)
  5. at void TaleWorlds.CampaignSystem.CampaignBehaviors.VillageTradeBoundCampaignBehavior.TryToAssignTradeBoundForVillage(Village village)
  6. at void TaleWorlds.CampaignSystem.CampaignBehaviors.VillageTradeBoundCampaignBehavior.UpdateTradeBounds()
  7. at void TaleWorlds.CampaignSystem.MbEvent.InvokeList(EventHandlerRec list, T t)
  8. at void TaleWorlds.CampaignSystem.CampaignEvents.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
  9. at void TaleWorlds.CampaignSystem.CampaignEventDispatcher.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
  10. at void TaleWorlds.CampaignSystem.Campaign.OnNewGameCreated(CampaignGameStarter gameStarter)
  11. at void TaleWorlds.CampaignSystem.Campaign.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, out GameTypeLoadingStates nextState)
  12. at void StoryMode.CampaignStoryMode.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, out GameTypeLoadingStates nextState)
  13. at bool TaleWorlds.Core.GameType.DoLoadingForGameType()
  14. at void SandBox.SandBoxGameManager.DoLoadingForGameManager(GameManagerLoadingSteps gameManagerLoadingStep, out GameManagerLoadingSteps nextStep)
  15. at bool TaleWorlds.Core.GameManagerBase.DoLoadingForGameManager()
  16. at void TaleWorlds.MountAndBlade.GameLoadingState.OnTick(float dt)
  17. at void TaleWorlds.Core.GameStateManager.OnTick(float dt)
  18. at void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch2(Module this, float dt)
  19. at void TaleWorlds.DotNet.Managed.ApplicationTick_Patch2(float dt)
I am grateful in advance for any help I can get. Have a nice day.
 
Thank you for your response. It is not exactly when I remove the path, but when I remove a vertex from the pathfinding.
It happens only if I remove a single vertex from the pathfinding, if I remove the face it doesn't seem to care.
I do not remove any of the line paths.
Happens when I try to create a new game.
 
I have found the error. I forgot that when changing a settlement site you have to set the coordinates manually in the settlement.xml.
I resolved the error. How I can mark the thread as solved?
 
I have found the error. I forgot that when changing a settlement site you have to set the coordinates manually in the settlement.xml.
I resolved the error. How I can mark the thread as solved?
BTW you don’t need to set the settlement coordinates in settlement.xml manually. After moving a settlement select the SettlementPosition entity and from the inspector run the save positions option under SettlementPositionScripts - that updates your settlement.xml for you just as running the calculate option will update your settlement distance cache. Don’t run the first option ‘check positions’ as it results in an editor crash unless TW have fixed it since I stopped using it.
 
Yes, I found it after finishing the hard way.. And I confirm that they didn't fix the CheckPositions crash.
Again, thank you very much for taking the time to respond to my posts. It is greatly appreciated.
 
Back
Top Bottom