[A16] Psychology (2017-5-14)

Started by System.Linq, August 19, 2016, 07:16:38 AM

Previous topic - Next topic

Madman666

Hey, can you consider adding counseling job for addicts to cheer them up a bit? Until I added psychology, I was using simple tactic for addicts - construct a decent bedroom with a table, heater, cooler etc. Stockpile lots of pemmican and seal people in, till they snap out of it, because they kept going bonkers and overdosing or berserking and dying, when they attacked other people. Worked wonders, unless they suddenly caught some disease. Now they actually can trash the place!) Which is fun to watch and less fun to rebuild) We really do need to have a way of some addiction treatment.

Kyna Tiona

...Human interaction, a source of joy and distraction, humane living conditions, care and respect? It honestly works better than you think, I think, vanilla or Psychology...

System.Linq

I'm planning a big content update for when the mod reaches 10,000 subscribers on Steam Workshop. It'll include treatment for pawns with chemical interest/fascination, and a new drug to help addicted pawns (bonus points if you can guess what it is).

In the meantime, updated to 2017-1-16. This update fixes the Individuality toggle, objects dropped by thieves being invisible, and colonists getting stuck on thieves, and adds a couple new alerts to help the player keep track of Psychology incident-related problems.

Kyna Tiona

Quote from: Psychology on January 16, 2017, 08:49:36 PM
mod reaches 10,000 subscribers on Steam

What.

Quote from: Steam
9,787    Current Subscribers

Whaaaaaat. I had no idea this mod had anywhere near this degree of popularity. Good job~

System.Linq

Quote from: Caraise Link on January 16, 2017, 08:56:36 PM
Quote from: Psychology on January 16, 2017, 08:49:36 PM
mod reaches 10,000 subscribers on Steam

What.

Quote from: Steam
9,787    Current Subscribers

Whaaaaaat. I had no idea this mod had anywhere near this degree of popularity. Good job~

Not even one of the more popular mods on the Workshop. Hospitality has 57k subscribers.

XeoNovaDan

Or Prepare Carefully.. 162,026 subscribers (which is pure insanity)

Madman666

Well, isn't that awesome? Cool. Can't wait for new stuff. Treatments especially. With drugs addictiveness raised in A16, they dropped from being a useful mood control tools back to just potentially dangerous trade goods. I kinda want to see what else you can come up with in terms of incidents like the thieves idea =) Quite interesting.

minakurafto

my pawn is insomniac and chemical fascination, so he likes to exhaust himself and break down drugs binge, but since he already exhausted (rest 0%) he go straight to bed and didnt use drug whatsoever , is it intended or miscalculation?

System.Linq

Insomniac pawns are supposed to go to bed when they are exhausted. However, they won't do that if they're already busy doing something else. My guess is that the drug binge cancels the job he was already doing, and he immediately goes to sleep because he's exhausted.

System.Linq

Updated to 2017-1-17. Fixed homesickness thoughts stacking and clarified the alert for cliques. Insomniacs will no longer prioritize sleep as highly when exhausted, but may prioritize it more when they're not.

just-a-bird

Hi, I keep getting a bug every so often where I start a new game and my pawns never spawn. I can't be sure, but I believe it's caused by a conflict between Psychology and Prepare Carefully, only because those are the only two mods that should have any interaction with the process, but I could be wrong. I'm a C# programmer, so I'd like to help find the bug in any way I can, but I don't have any experience with RimWorld's codebase specifically.

Here are the log entries I think are relevant:
Initializing new game with mods Core, HugsLib, Better Pathfinding, MineItAll, EdB Prepare Carefully, Allow Tool, Hand Me That Brick, Cooks Can Refuel, Refactored Work Priorities, Spoons Hair Mod, Hospitality A16, Numbers, Blueprints, Shift-Click, Roof Support A16, JTReplaceWalls, Day/Night Switch, Psychology, and Mod List Backup
Verse.Log:Message(String)
Verse.Game:InitNewGame()
Verse.Root_Play:<Start>m__737()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__733()


Faction Rimville has null relation with Rimville. Returning dummy relation.
Verse.Log:Error(String)
RimWorld.Faction:RelationWith(Faction, Boolean)
RimWorld.FactionUtility:HostileTo(Faction, Faction)
RimWorld.GenHostility:HostileTo(Thing, Faction)
Hospitality.GuestUtility:IsGuest(Pawn)
Hospitality.Detouring.Pawn_NeedsTracker:ShouldHaveNeed(Pawn_NeedsTracker, NeedDef)
RimWorld.Pawn_NeedsTracker:AddOrRemoveNeedsAsAppropriate()
RimWorld.PawnComponentsUtility:AddAndRemoveDynamicComponents(Pawn, Boolean)
EdB.PrepareCarefully.GenStep_ScenParts:ReplaceColonists()
EdB.PrepareCarefully.GenStep_ScenParts:Generate(Map)
Verse.MapGenerator:GenerateContentsIntoMap(MapGeneratorDef, Map)
Verse.MapGenerator:GenerateMap(IntVec3, Int32, MapParent, Action`1, MapGeneratorDef)
Verse.Game:InitNewGame()
Verse.Root_Play:<Start>m__737()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__733()


System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[Verse.ThingDef,System.Collections.Generic.List`1[Verse.Thing]].get_Item (Verse.ThingDef key) [0x00000] in <filename unknown>:0
  at Verse.ListerThings.Remove (Verse.Thing t) [0x00000] in <filename unknown>:0
  at Verse.Thing.DeSpawn () [0x00000] in <filename unknown>:0
  at Verse.ThingWithComps.DeSpawn () [0x00000] in <filename unknown>:0
  at Verse.Pawn.DeSpawn () [0x00000] in <filename unknown>:0
  at Verse.ThingContainer.TryAdd (Verse.Thing item, Boolean canMergeWithExistingStacks) [0x00000] in <filename unknown>:0
  at RimWorld.DropPodUtility.DropThingGroupsNear (IntVec3 dropCenter, Verse.Map map, System.Collections.Generic.List`1 thingsGroups, Int32 openDelay, Boolean instaDrop, Boolean leaveSlag, Boolean canRoofPunch) [0x00000] in <filename unknown>:0
  at EdB.PrepareCarefully.GenStep_ScenParts.SpawnColonistsWithEquipment (Verse.Map map, RimWorld.ScenPart_PlayerPawnsArriveMethod arriveMethodPart) [0x00000] in <filename unknown>:0
  at EdB.PrepareCarefully.GenStep_ScenParts.Generate (Verse.Map map) [0x00000] in <filename unknown>:0
  at Verse.MapGenerator.GenerateContentsIntoMap (Verse.MapGeneratorDef def, Verse.Map map) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.MapGenerator:GenerateContentsIntoMap(MapGeneratorDef, Map)
Verse.MapGenerator:GenerateMap(IntVec3, Int32, MapParent, Action`1, MapGeneratorDef)
Verse.Game:InitNewGame()
Verse.Root_Play:<Start>m__737()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__733()


Here's the full gist: https://gist.github.com/1f532151736aaf1e39d75c521e7ebdbe
Here's my save: https://dl.dropboxusercontent.com/u/12713582/Craterton2%20%28Permadeath%29.rws

By the way, I absolutely love your mod; I doubt I could play without it. Just the Kinsey scale alone makes the game a lot better for me, and there's so much more on top of that. Thank you for all the attention to detail!

System.Linq

Psychology doesn't touch pawn spawning, it just injects the Kinsey system into their needs when they're generated and gives them a Kinsey value when their traits are generated. The problem appears to be that when your colonists are added to the contents of the drop pod, it attempts to despawn them, but despawning them attempts to remove them from the map's list of things, and when it attempts to remove them from the map's list of things, it attempts to remove them from a dictionary of every Def keyed to the list of things on the map with that Def. However, the Def of the pawns it's trying to spawn are not keys in the dictionary of every Def, so it can't remove them, so it can't despawn them, so it can't add them to the drop pod.

This is definitely not a Psychology error because Psychology contains no Defs for pawns. I would assume that it's most likely a Prepare Carefully error because Prepare Carefully is the most likely to change a pawn's Def, but you're not using any mod that I would point to as being a likely culprit. It's not a problem that can be easily debugged without creating a mod that detours the relevant code and inserts some debug messages so you can see what ThingDef it's trying to access from the list. In short, unless you learn how to mod yourself, I doubt anyone will be able to tell you exactly what the problem is here, but the Prepare Carefully modder might have more insight than I do.

just-a-bird

Makes sense, thanks for the information! I'll direct my issue to Prepare Carefully, then.

sidfu

haveing to drop from useing this as its overwriting raid stuff for hardcore_sk pack.
this is one of the errors. gonan do some testing when i get a chance later today and see if error gone or not when psycololgy is not enabled.

Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.InvalidCastException: Cannot cast from source type to destination type.
at Combat_Realism.RightTools.EquipRigthTool (Verse.Pawn pawn, RimWorld.StatDef def) [0x00000] in :0
at Combat_Realism.Detours_ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in :0
at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in :0
Verse.Log:Error(String)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn)
RimWorld.ThinkNode_Conditional:TryIssueJobPackage(Pawn)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn)
Verse.AI.Pawn_JobTracker:DetermineNextJob(ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
Psychology.Detour._Pawn_JobTracker:_EndCurrentJob(Pawn_JobTracker, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()


ill post after some testing. btw that error seems to happen when a animal trainer goes to train he will pick up growing grass to use.

not sure but before didnt have this error. it didnt start till after u put the theif mechanics in if i remember right.

ill post after some testing.

hwfanatic

Ran into some exceptions during the saboteur event. They stopped after arresting him. I'll attach the savegame and log just in case you want to take a look.

https://drive.google.com/file/d/0B0ypbq1IHgPQeVlPRnNYYUpJTkE/view?usp=sharing
http://pastebin.com/iyAN3g6b