<SOLVED> I don't understand this error message ?

Started by Mr.Rock23, September 12, 2022, 12:05:17 PM

Previous topic - Next topic

Mr.Rock23

I'm new to modding, so please bear with me. I'm trying to add an implant that gives a 10% increase to consciousness (which I managed to do with a different mod I made). Below is the copied debug log, and below that is the section of code that won't work. As far as I know (which isn't much) the error was caused by me missing a backslash in the ThingDef category . . . but the error was still there. Any and all help is appreciated!

RimWorld 1.3.3389 rev40
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Message (string)
RimWorld.VersionControl:LogVersionNumber ()
Verse.Root:CheckGlobalInit ()
Verse.Root:Start ()
Verse.Root_Entry:Start ()

Could not resolve cross-reference: No Verse.ThingDef named Cortex Drive found to give to Verse.DefHyperlink Verse.DefHyperlink
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.DirectXmlCrossRefLoader/WantedRefForObject:TryResolve (Verse.FailMode)
Verse.DirectXmlCrossRefLoader/<>c__DisplayClass15_1:<ResolveAllWantedCrossReferences>b__0 (Verse.DirectXmlCrossRefLoader/WantedRef)
Verse.GenThreading/<>c__DisplayClass7_1`1<Verse.DirectXmlCrossRefLoader/WantedRef>:<ParallelForEach>b__0 (object)
System.Threading.QueueUserWorkItemCallback:WaitCallback_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
System.Threading.ThreadPoolWorkQueue:Dispatch ()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

Some descriptionHyperlinks in CortexDrive had null def.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Warning (string)
Verse.Def/<ConfigErrors>d__21:MoveNext ()
Verse.HediffDef/<ConfigErrors>d__55:MoveNext ()
Verse.DefDatabase`1<Verse.HediffDef>:ErrorCheckAllDefs ()
System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
System.Reflection.MethodBase:Invoke (object,object[])
Verse.GenGeneric:InvokeStaticMethodOnGenericType (System.Type,System.Type,string)
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__6_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

Code:

   <!-- Cortex Drive -->

<HediffDef ParentName="ImplantHediffBase">
    <defName>CortexDrive</defName>
    <label>cortex drive</label>
    <labelNoun>a cortex drive</labelNoun>
    <description>An installed cortex drive.</description>
    <descriptionHyperlinks><ThingDef>Cortex Drive</ThingDef></descriptionHyperlinks>
    <spawnThingOnRemoved>CortexDrive</spawnThingOnRemoved>
    <stages>
      <li>
        <capMods>
          <li>
            <capacity>Consciousness</capacity>
            <offset>0.1</offset>
          </li>
        </capMods>
      </li>
    </stages>
   <comps>
     <li Class="HediffCompProperties_ReactOnDamage">
       <damageDefIncoming>EMP</damageDefIncoming>
      <createHediff>BrainShock</createHediff>
     </li>
   </comps>
  </HediffDef>

  <ThingDef ParentName="BodyPartArchotechBase">
    <defName>CortexDrive</defName>
    <label>cortex drive</label>
    <description>This brain implant acts as a smaller, secondary processing system for the brain in order to relieve stress on the cerebral cortex.</description>
    <descriptionHyperlinks><RecipeDef>InstallCortexDrive</RecipeDef></descriptionHyperlinks>
    <statBases>
      <MarketValue>3000</MarketValue>
    </statBases>
  </ThingDef>

  <RecipeDef ParentName="SurgeryInstallImplantBase">
    <defName>InstallCortexDrive</defName>
    <label>install cortex drive</label>
    <description>Install a cortex drive.</description>
    <descriptionHyperlinks>
      <ThingDef>CortexDrive</ThingDef>
      <HediffDef>CortexDrive</HediffDef>
    </descriptionHyperlinks>
    <jobString>Installing cortex drive.</jobString>
    <ingredients>
      <li>
        <filter>
          <thingDefs>
            <li>CortexDrive</li>
          </thingDefs>
        </filter>
        <count>1</count>
      </li>
    </ingredients>
    <fixedIngredientFilter>
      <thingDefs>
        <li>CortexDrive</li>
      </thingDefs>
    </fixedIngredientFilter>
    <appliedOnFixedBodyParts>
      <li>Brain</li>
    </appliedOnFixedBodyParts>
    <addsHediff>CortexDrive</addsHediff>
  </RecipeDef>
 
  <RecipeDef ParentName="SurgeryRemoveImplantBase">
    <defName>RemoveCortexDrive</defName>
    <label>remove cortex drive</label>
    <description>Remove cortex drive.</description>
    <descriptionHyperlinks>
      <ThingDef>CortexDrive</ThingDef>
      <HediffDef>CortexDrive</HediffDef>
    </descriptionHyperlinks>
    <jobString>Removing cortex drive.</jobString>
    <removesHediff>CortexDrive</removesHediff>
  </RecipeDef>

Shinzy

the red error is pointing to
    <descriptionHyperlinks><ThingDef>Cortex Drive</ThingDef></descriptionHyperlinks>

Try to remove the space in "Cortex Drive"

Mr.Rock23