I tested this with only vanilla and no other mods not even royalty enabled and I still got the error... Here is my log file:
https://pastebin.com/wc5gkuXTI would like to note, this wasn't tested on a previous save file, this was tested on a brand-new save file, with Forgotten tribe starting, 5% world generation, and minimum population. And a 200x200 map size. I made one of the pawns max skills and added creativity inspiration to them. I unlocked all the research via dev menu, and then forced them to build the Sarcophagus and it failed completely and threw that error.
EDIT: I made a mod to patch the vanilla function to fix this bug. It should only affect vanilla but if any other mods patch the function,
SendCraftNotification, will probably not work. I have tested it with Quality Builder, Crafting Quality Rebalance, and Mad Skills. I will explain a bit of what the issue is after these links for the download of the mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2154320105https://github.com/thakyZ/SarcophagusPatch/releases/tag/1.0.0Basically there is a line of code that tries to create art when there is a
compArt class in the building. When doing so it tries to generate the text but first has to create a
TaleRefrence instance, but when doing so it checks to see if the building can initially show art, and if not sets the
TaleRefrence instance to
null. When it checks the building it sees if the building's Def contains the key
mustBeFullGrave and the value is true. If the value is true, then it returns false to the check of whether to initially show the art. Which then to restate makes the
TaleRefrence instance be
null. And after it tries to create the
TaleRefrence instance it runs a command to generate text within the
TaleRefrence instance but the instance is
null and crashes. So I thought of two ways this could be fixed. One by setting
mustBeFullGrave to false, but then I found out that if I were to set it to false it would start to error when burring the bodies because there is already a function to generate art based on the quality of the building after burring a body. So I would have to patch the game via Harmony anyways. So I instead made the patch when
SendCraftNotification gets called it checks to see if the building is a grave, and if it is then it will just let you know that the work was legendary or masterwork instead of generating art on top of letting you know.
TD;LR there is just a function that ends up not being necessary to call with stuff that has a property in the Def and ends up breaking the building when it is the way it currently is.