Ludeon Forums

RimWorld => Mods => Help => Topic started by: JT on August 08, 2016, 05:30:47 PM

Title: Can't find a type/class name from recipe
Post by: JT on August 08, 2016, 05:30:47 PM
So I'm puzzling over this one.  Here's the relevant portion of the assembly's source:

using System;
using System.Reflection;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Text;

using UnityEngine;
using RimWorld;
using Verse;

namespace JTFieldSurgery
{
class Recipe_JTFieldSurgeryFieldAmputate : Recipe_MedicalOperation
{
...


which compiles successfully and is placed in my mod's Assemblies subfolder.

Here's my RecipeDef:<RecipeDef ParentName="SurgeryFlesh">
<defName>JTFieldSurgeryFieldAmputate</defName>
<label>field amputation</label>
<description>Removes a natural body part without the use of anaesthetic, for use in emergencies if no medicine is available. Removed limb will not be usable.</description>
<jobString>Amputating without anaesthetic.</jobString>

<workerClass>Recipe_JTFieldSurgeryFieldAmputate</workerClass>
...


Yet for reasons I completely fail to understand, I receive a "Could not find a type named Recipe_JTFieldSurgeryFieldAmputate" error during boot.  Is there somewhere I have to "register" an assembly for it to be loaded by the game?  What could be going wrong here?
Title: Re: Can't find a type/class name from recipe
Post by: CallMeDio on August 08, 2016, 05:37:07 PM
You need to add the namespace:
<workerClass>JTFieldSurgery.Recipe_JTFieldSurgeryFieldAmputate</workerClass>
Title: Re: Can't find a type/class name from recipe
Post by: JT on August 08, 2016, 05:41:50 PM
Heh, figures it'd be something easy. =)

Thanks!  Seems to be loading just fine now.  And now, the always time-consuming testing phase... ;-)
Title: Re: Can't find a type/class name from recipe
Post by: CallMeDio on August 08, 2016, 06:06:51 PM
You're welcome :)