Help with CompProperties_Art

Started by ilikegoodfood, March 08, 2018, 10:45:42 AM

Previous topic - Next topic

ilikegoodfood

I have created a new animal for my Monster Mash mod that, upon butchering, provides its shell as a statue.

Copying over the various required parts from the core statues and other buildings, I created what I hoped would be a working piece of art, and it sort of is.
The problem is that I need it to enjoyable as art, using the following code, but it shouldn't have a random name and description.

<comps>
<li Class="CompProperties_Art">
<canBeEnjoyedAsArt>true</canBeEnjoyedAsArt>
</li>
</comps>


Using this code creates several errors.

These include the following:
Upon first selecting the minified shell:
Inspect string for MinifiedSculpture14104 contains empty lines.

And upon trying to butcher the creature:
JobDriver threw exception in initAction. Pawn=Blue, Job=DoBill (Job_241) A=Thing_TableButcher14118 B=Thing_CarrionCrawler_Corpse14117 C=(75, 0, 73), Exception: System.NullReferenceException: Object reference not set to an instance of an object

Now, I think this is because the CompProperties_Art requires a nameMaker and descriptionMaker, which I don't want, but even when I do add them, it not only fails to generate them, but produces other errors. Furthermore, both with a without the name and description makers, the inspect tab for art fails to show up, even though I am calling it. I think this may be because it's empty, but I'm not sure.

Please help.

Here is the complete code for the item, in case it's of use:
<?xml version="1.0" encoding="utf-8" ?>

<Defs>

<ThingDef ParentName="BuildingBase">
<defName>MM_CarrionCrawlerShell</defName>
<label>carrion crawler shell</label>
<description>The calcium carbonate shell of a carrion crawler. The spiral pattern and earthy colors are quite beautiful.</description>
<thingClass>Building_Art</thingClass>
<graphicData>
<graphicClass>Graphic_Single</graphicClass>
<texPath>Things/Building/Art/CarrionCrawlerShell</texPath>
<drawRotated>false</drawRotated>
<allowFlip>false</allowFlip>
</graphicData>
<minifiedDef>MinifiedSculpture</minifiedDef>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<pathCost>70</pathCost>
<useHitPoints>true</useHitPoints>
<fillPercent>0.5</fillPercent>
<rotatable>false</rotatable>
<size>(1,1)</size>
<canOverlapZones>false</canOverlapZones>
<drawDamagedOverlay>false</drawDamagedOverlay>
<statBases>
<MaxHitPoints>200</MaxHitPoints>
<WorkToBuild>20000</WorkToBuild>
<Flammability>0</Flammability>
<Beauty>340</Beauty>
<Mass>100</Mass>
<SellPriceFactor>1.10</SellPriceFactor>
</statBases>
<comps>
<li Class="CompProperties_Art">
<canBeEnjoyedAsArt>true</canBeEnjoyedAsArt>
</li>
</comps>
<selectable>true</selectable>
<costList>
<Gold>50</Gold>
</costList>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<inspectorTabs>
  <li>ITab_Art</li>
</inspectorTabs>
<forceDebugSpawnable>true</forceDebugSpawnable>
<building>
<expandHomeArea>false</expandHomeArea>
<repairable>false</repairable>
<isInert>true</isInert>
</building>
    </ThingDef>

</Defs>

wwWraith

This may be related to the error.

I think the other way could be to make the shell just a material required to construct a new statue type.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

ilikegoodfood

That does indeed seem to be related to the error. I can't deal with it today now. The error message in the screenshot seems to be the same...

ilikegoodfood

Well, I have discovered two things:

1) The error message I'm getting is not the same one that the mod you linked is designed to fix.

2) I still don't know why I'm getting the error. Following the trace through, it seems to be trying to place a zero on a quantity or something like that, but I'm not sure what I'm reading.

Here is the trace:
JobDriver threw exception in initAction. Pawn=Sanchez, Job=DoBill (Job_142) A=Thing_TableButcher5011 B=Thing_CarrionCrawler_Corpse5020 C=(83, 0, 92), Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.GenRecipe.PostProcessProduct (Verse.Thing product, Verse.RecipeDef recipeDef, Verse.Pawn worker) [0x00000] in <filename unknown>:0
  at Verse.GenRecipe+<MakeRecipeProducts>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[Verse.Thing].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0
  at System.Collections.Generic.List`1[Verse.Thing]..ctor (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable.ToList[Thing] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at Verse.AI.Toils_Recipe+<FinishRecipeAndStartStoringProduct>c__AnonStorey2.<>m__0 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=RimWorld.JobGiver_Work, curJob.def=DoBill, curDriver=Verse.AI.JobDriver_DoBill
Verse.Log:Error(String)
Verse.AI.Pawn_JobTracker:StartErrorRecoverJob(String)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.<DoRecipeWork>c__AnonStorey1:<>m__1()
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

ilikegoodfood

Success, sort of.

I have discovered that, in order to make a successful art item that uses the Building_Art thingClass and the CompProperties_Art, it must have the following four things:


  • CompQuality
  • nameMaker
  • descriptionMaker
  • canBeEnjoyedAsArt

Now then, this leaves me with two options, one of which is easy, the other is hard. I can either:


  • Change the item from an art item to a beauty item, which removes the art tags and releases it as a high-beauty piece of furniture.
  • Create a nameMaker, descriptionMAker and set the CompQuality to use cooking (butchering) instead of art.

The first option would let me get the creature out tonight, or tomorrow.
The second would take a while, since the makerDefs are a little more complex and I don't honestly want to get into them for an item that shouldn't have a name or description anyway.

I've decided to go with the first option.