RimWorld

RimWorld

[JPT] Human Resources
PartyCowboy 20 Jul, 2020 @ 3:43am
Thinking Spot Compatability
I thought I'd stop polluting your comment section with talk about compatability issues, so I created this. Hope you don't mind.

Anyway, I wanted to get my show on the road, so I looked at what I could do to resolve our mods' conflicts. I have currently created a "no bug" research and added that as a starting tech to both of the factions, which seemed to have solved half of the problem. The only issue left now is that the tech tab shows what the pawn knows, but not what it can learn. I'm thinking of setting the "no bug" tech as a prereq for every other tech that doesn't have a prereq, and hope that that works. I'll keep you updated. Thanks for all your work so far!
< >
Showing 1-15 of 20 comments
PartyCowboy 20 Jul, 2020 @ 5:21am 
After some more testing it appears what I have done has solved it. The "to learn" screen is still not functioning, but it is playable
jptrrs  [developer] 20 Jul, 2020 @ 7:57am 
Hi! No, I don't mind!
I'm glad you worked it out, I still haven't had time to chase the bug you mentioned.
But let me give you a heads up: I'm working on a new version that should be easier on other mods, but that could break whatever you did again. I'll keep you posted.
PartyCowboy 20 Jul, 2020 @ 9:00am 
Great! I mainly got to this conclusion by opening some of your C# code and interpreting some stuff, but couldn't really do more than this without actually knowing C#, or identical-ish languages. I'm looking forward to seeing if my stopgap measure will be redundant, or if I get to invent something crazy again =)
PartyCowboy 21 Jul, 2020 @ 8:46am 
So, recently I started playing the game I had planned. I placed down a thinking spot and my pawns got to thinking, eventually researching fire making for themselves. I went to the temperature architect tab, only to find no campfires or anything of the sort. Did some investigating, and I sort of half found out / presumed that to actually get the newly researched building(s) to show up in one's architect menu, one has to write a book about it and place it in a bookshelf, presumably as intended.

So, I, thinking that since I made a mod "how hard could it be to make primitive versions of the study desk and bookshelf", did exactly that. Only, I didn't want to make another sort of "writing spot", and seeing as how I already had to turn the Thinking Spot from a Building_ResearchBench thingClass into a Building_WorkTable, I figured I'd toss the Thinking Spot into the workGiverDefs and recipeDefs "DocumentTech" and "LearnTech" as well, just like I had correctly done for "Research" and "ResearchTech" ones. This is after some red error problems, which I managed to fix, yay!

But now, I've run into a red error I don't have the knowledge to solve: This one[gist.github.com]

I sincerely hope you can help.
I'll upload this half finished one shortly, as Thinking Spot Testing, I think.
jptrrs  [developer] 21 Jul, 2020 @ 9:26am 
Your thinking should theoretically work, but that "case 4" tells me your spot is not being recognized as a Building_WorkTable. It's funny because I left that message on by accident, and you managed to trigger it! With that it actually gave out some meaningful information, after all!
About the red error, that's on the bookstore. You mentioned you made a primitive version of that, right? It's probably missing something. Did you give it storage settings? Is its class Building_BookStore? Can I see its xml?
PartyCowboy 21 Jul, 2020 @ 10:25am 
Sure. This is the original thinking spot, no patches involved:

<ThingDef ParentName="BuildingBase"> <defName>TS_ThinkingSpot</defName> <label>thinking spot</label> <description>A place for thinking of new ideas. Considered archaic, but it works.</description> <thingClass>Building_ResearchBench</thingClass> <size>(1,1)</size> <graphicData> <texPath>Things/Building/Production/CraftingSpot</texPath> <graphicClass>Graphic_Single</graphicClass> <drawSize>(1,1)</drawSize> </graphicData> <altitudeLayer>FloorEmplacement</altitudeLayer> <statBases> <WorkToBuild>0</WorkToBuild> <ResearchSpeedFactor>0.35</ResearchSpeedFactor> </statBases> <scatterableOnMapGen>false</scatterableOnMapGen> <useHitPoints>false</useHitPoints> <designationCategory>Production</designationCategory> <passability>Standable</passability> <hasInteractionCell>True</hasInteractionCell> <interactionCellOffset>(0,0,0)</interactionCellOffset> <surfaceType>Item</surfaceType> <building> <canPlaceOverImpassablePlant>false</canPlaceOverImpassablePlant> </building> <comps> <li> <compClass>CompReportWorkSpeed</compClass> </li> </comps> <placeWorkers> <li>PlaceWorker_ReportWorkSpeedPenalties</li> </placeWorkers> </ThingDef>

Next is all the patches to make the thinking spot function like the simple research bench after your patches, blatantly copied of course XD. It also adds the document and learn recipes.

<Patch> <!--The patches to make the thinking spot function like the research bench from Human Resources--> <Operation Class="PatchOperationFindMod"> <mods> <li>[JPT] Human Resources</li> </mods> <match Class="PatchOperationSequence"> <operations> <li Class="PatchOperationReplace"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]/thingClass</xpath> <value> <thingClass>Building_WorkTable</thingClass> </value> </li> <li Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]</xpath> <value> <inspectorTabs> <li>ITab_Bills</li> </inspectorTabs> </value> </li> <!--Thinking Spot is not only the primitive's place to research, but also document and learn--> <li Class="PatchOperationAdd"> <xpath>/Defs/WorkGiverDef[defName = "Research" or defName = "DocumentTech" or defName = "LearnTech"]/fixedBillGiverDefs</xpath> <value> <li>TS_ThinkingSpot</li> </value> </li> <li Class="PatchOperationAdd"> <xpath>/Defs/RecipeDef[defName = "ResearchTech" or defName = "LearnTech" or defName = "DocumentTech"]/recipeUsers</xpath> <value> <li>TS_ThinkingSpot</li> </value> </li> <!--Decision tree for linking the TS to the booksheld and pillar of knowledge--> <li Class="PatchOperationConditional"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]/comps</xpath> <match Class="PatchOperationConditional"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]/comps/li/linkableFacilities</xpath> <nomatch Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]/comps</xpath> <value> <li Class="CompProperties_AffectedByFacilities"> <linkableFacilities /> </li> </value> </nomatch> </match> <nomatch Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]</xpath> <value> <comps> <li Class="CompProperties_AffectedByFacilities"> <linkableFacilities /> </li> </comps> </value> </nomatch> </li> <li Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[defName = "TS_ThinkingSpot"]/comps/li/linkableFacilities</xpath> <value> <li>BookShelf</li> <li>TS_HR_PillarOfKnowledge</li> </value> </li> <!--Trying to make it identical to the study desk--> </operations> </match> </Operation>

And lastly is the Pillar of Knowledge, or the primitive's bookcase :)

<ThingDef ParentName="FurnitureBase"> <defName>TS_HR_PillarOfKnowledge</defName> <label>Pillar of Knowledge</label> <thingClass>HumanResources.Building_BookStore</thingClass> <description>A pillar to inscribe all of your tribe's knowledge upon.</description> <graphicData> <graphicClass>Graphic_Random</graphicClass> <texPath>Things/Building/Furniture/SteleLarge</texPath> <drawSize>(4,4)</drawSize> <drawOffset>(0,0,0.05)</drawOffset> <shadowData> <volume>(1.5, 0.6, 1.5)</volume> <offset>(0, 0, -0.15)</offset> </shadowData> <damageData> <rect>(0.1,0.1,1.9,1.9)</rect> </damageData> </graphicData> <uiIconOffset>(0, 0.04)</uiIconOffset> <uiIconScale>0.8</uiIconScale> <altitudeLayer>BuildingOnTop</altitudeLayer> <rotatable>true</rotatable> <socialPropernessMatters>true</socialPropernessMatters> <statBases> <MaxHitPoints>100</MaxHitPoints> <WorkToBuild>8000</WorkToBuild> <Mass>15</Mass> <Flammability>1.0</Flammability> </statBases> <size>(2,2)</size> <costStuffCount>125</costStuffCount> <stuffCategories> <li>Metallic</li> <li>Woody</li> <li>Stony</li> </stuffCategories> <pathCost>70</pathCost> <passability>PassThroughOnly</passability> <designationCategory>Production</designationCategory> <comps> <li Class="CompProperties_Facility"> <!--<statOffsets> <ResearchSpeedFactor>0.025</ResearchSpeedFactor> </statOffsets>--> <maxSimultaneous>6</maxSimultaneous> <maxDistance>7.0</maxDistance> </li> </comps> <placeWorkers> <li>PlaceWorker_ShowFacilitiesConnections</li> </placeWorkers> <building> <preventDeteriorationInside>true</preventDeteriorationInside> <haulToContainerDuration>120</haulToContainerDuration> <fixedStorageSettings> <priority>Critical</priority> <filter> <categories> <li>Knowledge</li> </categories> </filter> </fixedStorageSettings> <defaultStorageSettings> <priority>Critical</priority> <filter> <categories> <li>Knowledge</li> </categories> </filter> </defaultStorageSettings> </building> <inspectorTabs> <li>ITab_Storage</li> <li>HumanResources.ITab_Inventory</li> </inspectorTabs> </ThingDef>
Last edited by PartyCowboy; 21 Jul, 2020 @ 10:46am
PartyCowboy 21 Jul, 2020 @ 10:34am 
I also just uploaded a testing version of Thinking Spot (basically the same mod, but only with the patches for Human Resources) here.
jptrrs  [developer] 21 Jul, 2020 @ 12:05pm 
That was helpful! You know, that's why Github is for. I'm thankful to Mr. Zhivago for getting me to set it up for my first mod, so if you ever decide to put it up there, give me a shout and I'll help.
I checked it up and the issue is the Pillar of Knowledge is missing the CompProperties_StorageGraphic comp. Check the one on the BookShelf: countFullCapacity is what defines how many books can be stored. That's the missing reference.
A suggestion: wouldn't it be simpler to unlock the Bookshelf itself? I mean, if this pillar of knowledge is just the same thing...
About the recipes on the thinking spot, it seems its working, despite that "case 4" issue.
PartyCowboy 21 Jul, 2020 @ 1:14pm 
Thanks for your offer! Now I'm interested in setting it up as well.
I didn't think that was functional, since it looked related to graphics, so I tossed it out. I'll put it back in tomorrow and see if it works. But since you're the dev, I think it will.
As for just unlocking the bookshelf, I mainly did this for thematic reasons. In the cavemen age they had rock paintings and carvings, so I made it a Pillar of Knowledge. I first wanted it to be a rock, but couldn't find any vanilla graphic of a rock that'd look good, so I just used the graphic of the large stele and called it a day. Perhaps when I'm invested enough to actually learn to draw or to commission something, I'll update it, but for now I'll stick to the graphic.
jptrrs  [developer] 21 Jul, 2020 @ 2:14pm 
Yeah, I never thought somenone would need to make a version of it without the graphic comp. :-) I also tested to see if we could have the capacity information without the graphic tweaks, but not right now. It still works, but the vanilla graphics are replaced anyway, rendering the object invisible. It would need a re-write.
PartyCowboy 22 Jul, 2020 @ 3:22am 
Hurray! It works! Thank you sooo much!
I'm looking forward to the new compatability update
PartyCowboy 22 Jul, 2020 @ 7:40am 
Okay, so uhhhh... I may have been a tad early with the joyous shouting. Because it seems that my researcher keeps on getting stuck, and I know it's got something to do with the Thinking Spot and the jobs on it, just don't know what exactly.
This is the log[gist.github.com], and the dodgy stuff starts at line 3593.
jptrrs  [developer] 1 Aug, 2020 @ 3:22pm 
Heads up, PartyCowboy, the next update that will break your patch is almost ready. You can check it out here: https://github.com/jptrrs/HumanResources/releases/tag/v0.16a
I haven't tested it with Thinking Spot yet, but switching the class for the thinking spot won't be necessary anymore.
PartyCowboy 2 Aug, 2020 @ 6:36am 
That's great to hear! I'll take a peak in your xml patches once they're out, and change mine accordingly, since I don't really understand C#... :)
jptrrs  [developer] 2 Aug, 2020 @ 7:33am 
That link will download the whole mod, patches included.
< >
Showing 1-15 of 20 comments
Per page: 1530 50