Trade window can't open after prisoner leaves map

Started by FluffyCat, July 01, 2016, 10:51:56 PM

Previous topic - Next topic

FluffyCat

#15
If this was a known bug and was fixed elsewhere that's great. However, usually bugs about known/existing issues are identified as duplicate and resolved. I haven't read all posts on this forum, but the inquiries from developers on this thread suggest this was/is an open issue.

With a quirky bug that took 10+ hours of gameplay to trigger (longer if you average it out including other players who haven't triggered the bug at all), it's probably not safe to conclude the bug is "fixed" in A14 because one player who saw it before hasn't yet seen it again.   This bug will most likely be fixed by a developer isolating the issue and actually pushing a fix.

Related: I've never had a colonist in cryosleep (relating to the prior reply), so that's probably not a reliable trigger for this particular bug.

Tynan

I'm not asking you to do work, I just wondered if you incidentally had some info.

Thanks for your report - I do appreciate it.

All I've got to go on now is this error from the log, so I'll see if this code might still be broken.

JobDriver threw exception in initAction. Pawn=Sam, Job=UseCommsConsole A=Thing_CommsConsole203888, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Pawn_GuestTracker.get_PrisonerIsSecure () [0x00000] in <filename unknown>:0
  at RimWorld.TradeUtility+<>c__Iterator104.MoveNext () [0x00000] in <filename unknown>:0
  at RimWorld.TradeShip+<>c__Iterator102.MoveNext () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.TradeShip.TryOpenComms (Verse.Pawn negotiator) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_UseCommsConsole+<MakeNewToils>c__Iterator34.<>m__94 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0
Tynan Sylvester - @TynanSylvester - Tynan's Blog

FluffyCat

Thanks, Tynan, and thanks for all your hard work making a great game.

Tynan

I tried to load the old A13 code back in to check this one but it was from an old Unity version.

I managed to repro the bug on my A13 saved build. Sadly I don't have the dev build so I can't figure out the troublesome line easily. Still investigating though. It is repeatable, at least.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Tynan

Okay! I almost certainly fixed it. It had to do with trying to trade after your prisoners leave the map. The system tries to add off-map prisoners to the sellable items and it gets all screwed up.

Can you just confirm: Did you have a prisoner escape or be sold at some point?
Tynan Sylvester - @TynanSylvester - Tynan's Blog

LesserJohn

Sorry for the necro post, but I've run into exactly this bug in my current a17 game. Trading was working, now it's not. I did release some prisoners a while back, I'm pretty sure it was after they left that it stopped working. I mean, it was definitely after they left, but I'm not sure if I was able to open a trade window between when they left and now. They were raider prisoners, I mention that because earlier I had released some tribal prisoners and had no issues from that. Guessing since they were raiders and I didn't get any faction bonus for releasing them, it triggered the bug. Is there a work around for this?

MrFinnT

#21
i have run into this bug as well now
but i have two games both started with many mods and on A17 just a few days ago
in one of the saves i have run into this problem but i am sure i never let any prisoner go. i had one in my jail for months and first trader i met was a slaver so i wanted to sell him but the shop window did not pop up
other (older) save i had many prisoners and let many of them go and can still trade with no problem

the biggest difference is one game is played on open field (all good) the other in a mountan area (bugged). maybe that could be a reason
files are to large to attache if you need them i will uploade them somewere else

Edit: the save games are uploaded here
https://www.dropbox.com/s/7dskntgnvq9d3oz/Saves.zip?dl=0

Calahan

Cross-linking to another possible report in a GD thread: https://ludeon.com/forums/index.php?topic=34159.0 (credit to Canute for noticing it is / it might be this bug).

kenmtraveller

I also just encountered this bug with the current A17 build, but I am running the hardcore SK modpack.
Here is the error from the debug log:
JobDriver threw exception in initAction. Pawn=Mal, Job=TradeWithPawn A=Thing_Alien_Orassan321597, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn
Verse.Log:Error(String)
Verse.AI.Pawn_JobTracker:StartErrorRecoverJob(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


ApesAmongUs

So, if it is trying to find things to add to the list and one of the objects (a prisoner) isn't there, then there must be a list of potential objects somewhere.  Does anyone know where that's found in the save?

I'm thinking that if I can find the reference to the prisoner I released and remove it, then I might be able to trade again.

And just as a suggestion, it might make for a better error message to reference the missing object ID.

KuyaManoy

Hi all,

Is there a workaround by editing the save game please? I had a prisoner that tried to escape but was killed. I do not have a prisoner that left offmap. (unless burial is considered offmap?)

Encountered this bug, running on latest A17 on Steam with:
mods Core, HugsLib, Hospitality, Expanded Prosthetics and Organ Engineering 2.0, Misc. Training, [sd] advanced powergeneration, HelpTab, and EdB Prepare Carefully

Relevant output log entry:

JobDriver threw exception in initAction. Pawn=Zinaida, Job=TradeWithPawn A=Thing_Human306522, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

ApesAmongUs

Quote from: KuyaManoy on July 19, 2017, 12:17:32 AM
Hi all,

Is there a workaround by editing the save game please? I had a prisoner that tried to escape but was killed. I do not have a prisoner that left offmap. (unless burial is considered offmap?)

Encountered this bug, running on latest A17 on Steam with:
mods Core, HugsLib, Hospitality, Expanded Prosthetics and Organ Engineering 2.0, Misc. Training, [sd] advanced powergeneration, HelpTab, and EdB Prepare Carefully

Relevant output log entry:

JobDriver threw exception in initAction. Pawn=Zinaida, Job=TradeWithPawn A=Thing_Human306522, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RimWorld.JobDriver_TradeWithPawn+<MakeNewToils>c__Iterator3F.<>m__B6 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RimWorld.JobDriver_TradeWithPawn

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

Deleting the pawns of the old prisoners doesn't work.  I think because references still appear in the history (saying they were captured/released).  So when it tries to load, it's a hard crash.  I also tried changing coordinates to see if I could set them back on the map, but I did not see them anywhere.  I was looking at setting them to dead, but wasn't sure about everywhere that needed to be done.

eldiabs

Seems this is still a relevant bug. Just happened to me as well a couple of years into a campaign. A volcanic winter just started...so maybe that has something to do with it? Tried removing some pawns from cryosleep with no effect so that didn't work for me.

My colony is self sustaining at this point, so not exactly game breaking. Annoying though...

QuoteJobDriver threw exception in initAction. Pawn=Mod, Job=TradeWithPawn A=Thing_Human627553, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.TransferableUtility.TransferAsOne (Verse.Thing a, Verse.Thing b) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUtility.TransferableMatching[Tradeable] (Verse.Thing thing, System.Collections.Generic.List`1 transferables) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddToTradeables (Verse.Thing t, Transactor trans) [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.AddAllTradeables () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal.Reset () [0x00000] in <filename unknown>:0
  at RimWorld.TradeDeal..ctor () [0x00000] in <filename unknown>:0
  at RimWorld.TradeSession.SetupWith (ITrader newTrader, Verse.Pawn newPlayerNegotiator) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade..ctor (Verse.Pawn playerNegotiator, ITrader trader) [0x00000] in <filename unknown>:0
  at RWAutoSell.ASJobDriver_TradeWithPawn+<>c__DisplayClass2_0.<MakeNewToils>b__1 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=TradeWithPawn, curDriver=RWAutoSell.ASJobDriver_TradeWithPawn
Verse.Log:Error(String)
Verse.AI.Pawn_JobTracker:StartErrorRecoverJob(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

ivusaur

I got this error as well. I think I both had prisoners die and the end of a volcanic winter. It's hard to say if that's relevant though.

ison

Could anyone please upload an unmodded savefile where this happens?