Is there a tutorial on how to make a new worktable in RimWorld? I used to be able to do it... but that was 6 months ago. Before when i did it I had to replace the butchery table with my new table. That was because the only way my new table would work was if I had the same def name as the butchery table.
<ThingDef ParentName="BuildingBase">
<DefName>BoneShrine</DefName>
<EType>Building_WorkTable</EType>
<label>bone shrine</label>
<ThingClass>Building_WorkTable</ThingClass>
<Description>Deliever those who dare go against the will of the Bone gods and you shall receive BONES! </Description>
<graphicPathSingle>Things/Building/Production/TableButcher</graphicPathSingle>
<CostList>
<Metal>60</Metal>
</CostList>
<constructEffect>ConstructWood</constructEffect>
<AltitudeLayer>Waist</AltitudeLayer>
<UseStandardHealth>True</UseStandardHealth>
<statBases>
<WorkToBuild>1000</WorkToBuild>
<MaxHealth>180</MaxHealth>
<Flammability>1.0</Flammability>
</statBases>
<Size>(3,1)</Size>
<Overdraw>False</Overdraw>
<DesignationCategory>Production</DesignationCategory>
<Passability>Impassable</Passability>
<hasInteractionSquare>True</hasInteractionSquare>
<interactionSquareOffset>(0,0,-1)</interactionSquareOffset>
<itemSurface>True</itemSurface>
<recipes>
<li>BoneTake</li>
</recipes>
<inspectorTabs>
<li>ITab_Bills</li>
</inspectorTabs>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
</building>
</ThingDef>
This is my code before I set it to the same def name as Butcher table. Am I doing something wrong?
Look at this: http://ludeon.com/forums/index.php?topic=5857.msg62545#msg62545 (http://ludeon.com/forums/index.php?topic=5857.msg62545#msg62545)
Same problem I think. ;)
I honestly have no clue how to get this to work. Is there a full tutorial on this from start to finish? Without documentation this is very hard.
There was one tutorial here (http://rimworldwiki.com/Modding_Tutorials/Smelter) but it is outdatted. :(
I learned the different needed elements (recipe, workgiver, workbench, resource) by looking at a simple mod like glassworks.
Just adapt the new XML parameters structure from the core and it should work.
The best way however is to grab a working mod and play with it by modifying 1 parameter at a time and look at its effect in-game.
The forum is well active and you should get an answer if you ask with enough details/screenshots/output_log. ;)
It did get kinda more complicated..., from one side i was impressed by the additional stuff and on the other side i wanted to send death threats to tynan X_X
Did get to it eventually so here how it looks.
So you will need to make folders and xmls in them like:
RecipeDefs
StatDefs(new SkillNeedDefs)
ThingDefs
WorkGiverDefs
Wont write you whats do what since im to pretty much lost in all this, but it works.
RecipeDef.xml
<?xml version="1.0" encoding="utf-8" ?>
<RecipeDefs>
<RecipeDef>
<defName>MakeSleepPills</defName>
<label>Make Sleeping Pills</label>
<description>Haplo Labs patent 109-41920-2877761 Code Name: Sleeping Pills</description>
<jobString>Cooking.</jobString>
<workAmount>500</workAmount>
<workSpeedStat>MedCookTime</workSpeedStat>
<efficiencyStat>MedCookEfficiency</efficiencyStat>
<workEffect>ButcherMechanoid</workEffect>
<sustainerSoundDef>Recipe_ButcherCorpseMechanoid</sustainerSoundDef>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Squirrel_Corpse</li>
</thingDefs>
</filter>
<count>1</count>
</li>
<li>
<filter>
<thingDefs>
<li>Silver</li>
</thingDefs>
</filter>
<count>5</count>
</li>
</ingredients>
<products>
<SleepPills>1</SleepPills>
</products>
<fixedIngredientFilter>
<thingDefs>
<li>Squirrel_Corpse</li>
<li>Silver</li>
</thingDefs>
</fixedIngredientFilter>
<skillRequirements>
<li>
<skill>Medicine</skill>
<minLevel>6</minLevel>
</li>
</skillRequirements>
<skillGains>
<li>
<skill>Medicine</skill>
<xp>500</xp>
</li>
</skillGains>
</RecipeDef>
</RecipeDefs>
StatDefs.xml
<?xml version="1.0" encoding="utf-8" ?>
<SkillNeeds>
<StatDef>
<defName>MedCookTime</defName>
<label>Meds mixing speed</label>
<description>Speed at witch person press max speed button on the mixer.</description>
<category>PawnWork</category>
<defaultBaseValue>1</defaultBaseValue>
<toStringStyle>PercentZero</toStringStyle>
<statFactors>
<li>WorkSpeedGlobal</li>
</statFactors>
<skillNeedFactors>
<li Class="SkillNeed_BaseBonus">
<skill>Cooking</skill>
<baseFactor>2.25</baseFactor>
<bonusFactor>0.05</bonusFactor>
</li>
</skillNeedFactors>
<activityFactors>
<li>
<activity>Consciousness</activity>
<weight>1</weight>
</li>
<li>
<activity>Sight</activity>
<weight>0.2</weight>
</li>
<li>
<activity>Manipulation</activity>
<weight>0.9</weight>
</li>
</activityFactors>
</StatDef>
<StatDef>
<defName>MedCookEfficiency</defName>
<label>Mixing processing efficiency</label>
<description>Ability up to how much pawn can cout before dropping all materials in mixer.</description>
<category>PawnWork</category>
<defaultBaseValue>1</defaultBaseValue>
<toStringStyle>PercentZero</toStringStyle>
<statFactors>
<li>WorkSpeedGlobal</li>
</statFactors>
<skillNeedFactors>
<li Class="SkillNeed_BaseBonus">
<skill>Cooking</skill>
<baseFactor>0.7</baseFactor>
<bonusFactor>0.065</bonusFactor>
</li>
</skillNeedFactors>
<activityFactors>
<li>
<activity>Consciousness</activity>
<weight>1</weight>
</li>
<li>
<activity>Sight</activity>
<weight>0.5</weight>
</li>
<li>
<activity>Manipulation</activity>
<weight>0.9</weight>
</li>
</activityFactors>
</StatDef>
</SkillNeeds>
ThingDef.xml
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefinitions>
<ThingDef>
<defName>SleepPills</defName>
<eType>Item</eType>
<label>Sleeping Pills</label>
<thingClass>ThingWithComponents</thingClass>
<category>Item</category>
<graphicPathSingle>Clutter/Various/SeepingPills</graphicPathSingle>
<altitudeLayer>Waist</altitudeLayer>
<useStandardHealth>true</useStandardHealth>
<shaderType>Transparent</shaderType>
<statBases>
<MaxHealth>150</MaxHealth>
<Flammability>1.0</Flammability>
</statBases>
<stackLimit>75</stackLimit>
<alwaysHaulable>true</alwaysHaulable>
<storeCategories>
<li>Manufactured</li>
</storeCategories>
<tickerType>Normal</tickerType>
<tradersCarry>false</tradersCarry>
<destroyOnDrop>false</destroyOnDrop>
<menuHidden>false</menuHidden>
<comps>
<li>
<compClass>CompForbiddable</compClass>
</li>
</comps>
<selectable>true</selectable>
<description>Sleeping pills, miracle of modern science and almost safe to use</description>
</ThingDef>
</ThingDefinitions>
WorkGiverDefs.xml
<?xml version="1.0" encoding="utf-8" ?>
<WorkGivers>
<WorkGiverDef>
<defName>DoBillsCookMed</defName>
<giverClass>WorkGiver_DoBill</giverClass>
<workType>Cooking</workType>
<priorityInType>95</priorityInType>
<billGiverDef>ClutterMedicMixerA</billGiverDef>
<verb>mix</verb>
<gerund>mixing</gerund>
<requiredActivities>
<li>Manipulation</li>
</requiredActivities>
</WorkGiverDef>
</WorkGivers>
QuoteSpeed at witch person press max speed button on the mixer.
Ability up to how much pawn can cout before dropping all materials in mixer.
I love those easter eggs ;D
Here I'm just going to post my codes because I think Im missing something so painfully obvious like I always do.
Bone recipe
<?xml version="1.0" encoding="utf-8" ?>
<RecipeDefs>
<RecipeDef>
<defName>BoneTake</defName>
<label>Gather bones</label>
<description>Take the body of those who defile the bone gods and turn them into something useful.</description>
<jobString>Making bones.</jobString>
<workAmount>450</workAmount>
<workEffect>ButcherFlesh</workEffect>
<workSpeedStat>ButcheryFleshSpeed</workSpeedStat>
<efficiencyStat>ButcheryFleshEfficiency</efficiencyStat>
<sustainerSoundDef>Recipe_ButcherCorpseFlesh</sustainerSoundDef>
<ingredients>
<li>
<filter>
<categories>
<li>Corpses</li>
</categories>
</filter>
<count>1</count>
</li>
</ingredients>
<products>
<Bone>206</Bone>
</products>
<fixedIngredientFilter>
<categories>
<li>Corpses</li>
</categories>
<exceptedCategories>
<li>CorpsesMechanoid</li>
</exceptedCategories>
<specialFiltersToDisallow>
<li>AllowRotten</li>
</specialFiltersToDisallow>
</fixedIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Human_Corpse</li>
</thingDefs>
<specialFiltersToAllow>
<li>AllowCorpsesColonist</li>
<li>AllowCorpsesStranger</li>
</specialFiltersToAllow>
</defaultIngredientFilter>
</RecipeDef>
</RecipeDefs>
workgiver_bones
<?xml version="1.0" encoding="utf-8" ?>
<WorkGivers>
<WorkGiverDef>
<defName>DoBillsMakeBones</defName>
<giverClass>WorkGiver_DoBill</giverClass>
<workType>Cooking</workType>
<priorityInType>10</priorityInType>
<workTableDef>BoneShrine</workTableDef>
<verb>produce bone</verb>
<gerund>producing bone</gerund>
</WorkGiverDef>
</WorkGivers>
Buildings_Bones
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>
<ThingDef Name="BuildingBase" Abstract="True">
<category>Building</category>
<soundImpactDefault>BulletImpactMetal</soundImpactDefault>
<selectable>true</selectable>
<drawerType>MapMeshAndRealTime</drawerType>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<repairEffect>Repair</repairEffect>
</ThingDef>
<ThingDef ParentName="BuildingBase">
<DefName>BoneShrine</DefName>
<EType>Building_WorkTable</EType>
<label>boneshrine</label>
<ThingClass>Building_WorkTable</ThingClass>
<Description>Deliver those who dare go against the will of the Bone gods and you shall receive BONES! </Description>
<graphicPathSingle>Things/Building/Production/TableButcher</graphicPathSingle>
<CostList>
<Metal>60</Metal>
</CostList>
<constructEffect>ConstructWood</constructEffect>
<AltitudeLayer>Waist</AltitudeLayer>
<UseStandardHealth>True</UseStandardHealth>
<statBases>
<WorkToBuild>1000</WorkToBuild>
<MaxHealth>180</MaxHealth>
<Flammability>1.0</Flammability>
</statBases>
<Size>(3,1)</Size>
<Overdraw>False</Overdraw>
<DesignationCategory>Production</DesignationCategory>
<Passability>Impassable</Passability>
<hasInteractionSquare>True</hasInteractionSquare>
<interactionSquareOffset>(0,0,-1)</interactionSquareOffset>
<itemSurface>True</itemSurface>
<recipes>
<li>BoneTake</li>
</recipes>
<inspectorTabs>
<li>ITab_Bills</li>
</inspectorTabs>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
</building>
</ThingDef>
</ThingDefs>
If one of you guys see something wrong it would help me a bunch. I tried everything you both said and I still cant see what Im doing wrong ;-; I bet it's something stupid :/
I cannot test it right now, so could please give us more details about what does not work ?
Do you see your building ?
Can you build it ?
Is it about the bill not handled by colonists ?
Is one of your colonist able to cook (and is it enabled in the overview tab) ?
Appart from that, I need to test with the game.
Could you also post your output_log.txt file ?
You might be missing stat defs
I think he uses vanilla stats so that he doesn't need to make his own for it:
<workSpeedStat>ButcheryFleshSpeed</workSpeedStat>
<efficiencyStat>ButcheryFleshEfficiency</efficiencyStat>
also just as an aside, start a new game if youve been tweaking code and reloading a saved game, sometimes it kicks things into gear, I think removing and readding the bill can also have this effect, but worth doing it from scratch tbh.
The colonists ignore the bill that I put on there. I can build it, and make the recipe.
your work giver is all wrong. you need billgiverdef in there, where did you get worktabledef from?
your first workgiver above that last one is right...
Yep, just tested it and it works.
You need to replace workTableDef by billGiverDef.
Check the console next time (press ² or ~ key next to 1/&), it was written in it.
Quote from: Rikiki on October 07, 2014, 11:38:40 AM
Yep, just tested it and it works.
You need to replace workTableDef by billGiverDef.
Check the console next time (press � or ~ key next to 1/&), it was written in it.
Weird I checked the console and had no bugs.
Ah I see now. I needed to start a new colony. Thanks all, sorry for being so oblivious x.x
Everything is working now!
Yeah start doing that out of habit now when modding itll save your brain lots of "WTF!" moments. :)
Um you shouldnt need to.
If you still got your old colony, try to build new workbench there, since the ones already build had saved recipes and stuff
as I said it might be the bill, remove the bill and redo it. I just found for sanity sake restarting is simpler.
It's all fixed now :) I did need to start a new colony. Idk why but that fixed it :)