How do I make a recipe be prioritized as smithing instead of crafting?

Started by Dreimal, December 20, 2017, 02:27:01 PM

Previous topic - Next topic

Dreimal

So my mod uses a lot of crafting recipes and I need to take some weight off of the crafting priority so I wanted to shift some of them to smithing and tailoring, but I can't seem to figure out what makes a recipe be defined as smithing, tailoring, etc.

CannibarRechter

CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

BrokenValkyrie

To add to CannibarRechter look into WorkGiverDefs.xml in core/defs/WorkGiverDefs.

WorkGiverDef can define the task as Smithing, Tailoring, Crafting.
One thing to note, is that you can only apply workgiverdef to one building. If you have custom production building you have two ways of going about it. Use xpath patching to place your own building to current definition or create your own workgiver def. I recommend creating your own worgiverdefs so that you have better control over it.

Here is code from trainingconsole as an example, it uses its own worktype. If using this code as template you'll need to replace worktype with appropriate one; Crafting, Tailoring, Smithing

<WorkGiverDef>
<defName>DoBillsTrain</defName>
<label>training console</label>
<giverClass>WorkGiver_DoBill</giverClass>
<workType>Training</workType>
<priorityInType>3</priorityInType>
<fixedBillGiverDefs>
<li>TrainingConsole</li>
</fixedBillGiverDefs>
<verb>work</verb>
<gerund>working at</gerund>
<requiredCapacities>
<li>Manipulation</li>
<li>Sight</li>
</requiredCapacities>
<prioritizeSustains>true</prioritizeSustains>
</WorkGiverDef>


WorkGiverDef has its own priority field but I haven't done testing to see how they impact pawns priority.

If you added your recipe to vanilla production table, there no need to assign priority. Otherwise the only way to shift recipe priority it to move recipe to different production table.