RimWorld

RimWorld

Rim War
PanicOregon281 26. sep. 2023 kl. 5:42
Fixing PowerTracker Error / Removing Factions.
So this took me 4 days to figure out, and there's a set of steps such as deleting all faction bases etc.

But if you get this error after removing a faction mid-save and want to restore the save to working order follow these instructions.

So the error in question
System.NullReferenceException: Object reference not set to an instance of an object at RimWar.Planet.WorldUtility.GetFactionTechLevelMultiplier (RimWorld.Faction faction) [0x00006] in <373fb9d3c19f43b795a4cdab9b36a408>:0 at RimWar.Planet.WorldComponent_PowerTracker.IncrementSettlementGrowth () [0x001c1] in <373fb9d3c19f43b795a4cdab9b36a408>:0 at RimWar.Planet.WorldComponent_PowerTracker.UpdateFactions () [0x00000] in <373fb9d3c19f43b795a4cdab9b36a408>:0 at RimWar.Planet.WorldComponent_PowerTracker.WorldComponentTick () [0x000ee] in <373fb9d3c19f43b795a4cdab9b36a408>:0 at RimWorld.Planet.WorldComponentUtility.WorldComponentTick (RimWorld.Planet.World world) [0x00013] in <95de19971c5d40878d8742747904cdcd>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string) RimWorld.Planet.WorldComponentUtility:WorldComponentTick (RimWorld.Planet.World) RimWorld.Planet.World:WorldTick () (wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch6 (Verse.TickManager) Verse.TickManager:TickManagerUpdate () (wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch7 (Verse.Game) (wrapper dynamic-method) Verse.Root_Play:Verse.Root_Play.Update_Patch0 (Verse.Root_Play)

This can be fixed by using a TextEditor to actually modify the save, this error is a result of RimWar caching data, which isn't bad. but when removing the faction from your save you will get this error as the game is automatically changing the cache for the said faction to 'null' which from a lack of foresight results in this error.
Simply this block of XML code in the save
<li> <settlerChance>0.2142857</settlerChance> <warbandChance>0.4285714</warbandChance> <warbandLaunchChance>0.7142857</warbandLaunchChance> <scoutChance>0.6428571</scoutChance> <diplomatChance>0.7142857</diplomatChance> <caravanChance>1</caravanChance> <createsSettlements>True</createsSettlements> <hatesPlayer>True</hatesPlayer> <rimwarFaction>null</rimwarFaction> <warFactions /> <allianceFactions /> <movementAttribute>1.149136</movementAttribute> <combatAttribute>0.9637203</combatAttribute> <growthAttribute>1.229576</growthAttribute> </li>

Now pay close attention when ♥♥♥♥♥♥♥ with this data, we're looking for
<rimwarFaction>null</rimwarFaction> to be present, if this contains something like Faction_1 this is not the block of data you're looking for.

Once you identify all of your blocks of data with <rimwarFaction>null</rimwarFaction>
Delete these entries, they're un-useful and causing the error. this is the cache data for the Factions you've deleted from your save mid-game.
Sidst redigeret af PanicOregon281; 1. nov. 2023 kl. 15:05