-
Notifications
You must be signed in to change notification settings - Fork 1
2) Defs
Mehni edited this page Feb 25, 2018
·
2 revisions
We referred to our Defs in the previous chapters, so let's implement them. They are three types of XML entries: two Defs and one JobGiver. The JobGiver is simply <li Class="CatsAreJerks.JobGiver_PetCats" />
, inserted in the right part of the ThinkTree via xpath or other methods. The WorkGiverDef and JobDef are used to link the various parts of the jobsystem together.
Note that you'd normally not mix two completely different mods in the same file.
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<WorkGiverDef>
<defName>HaulToInventory</defName>
<!-- What gets shown when hovering over the WorkGiver in the Work tab -->
<label>stuff things in inventory and haul</label>
<!-- The associated WorkGiver -->
<giverClass>PickUpThatCan.WorkGiver_HaulToInventory</giverClass>
<!-- Under what category it falls in the Work Tab -->
<workType>Hauling</workType>
<!-- Shown when prioritising via the right-click menu (e.g. consume rice, haul bricks) -->
<verb>haul</verb>
<!-- Shown when the pawn is doing the job -->
<gerund>hauling</gerund>
<!-- WorkTypes can contain multiple Jobs, this determines where in the Worktype it comes-->
<priorityInType>18</priorityInType>
<requiredCapacities>
<li>Manipulation</li>
</requiredCapacities>
</WorkGiverDef>
<JobDef>
<defName>PetTheCat</defName>
<!-- Link to the JobDriver -->
<driverClass>CatsAreJerks.JobDriver_PetTheCat</driverClass>
<!-- Shown when the pawn is doing the job. TargetA gets translated. See next chapter. -->
<reportString>petting TargetA.</reportString>
<!-- Whether or not colony animals can interact with the pawn while they are doing this job. Defaults to true. -->
<casualInterruptible>false</casualInterruptible>
<!-- Whether or not the Job can be "paused" without having to start over again. -->
<!-- Mostly used for hunting, hauling, refueling. Defaults to true.-->
<suspendable>false</suspendable>
</JobDef>
</Defs>