Could not resolve cross reference?

Started by Nocturnal, May 13, 2015, 11:54:41 AM

Previous topic - Next topic

Nocturnal

Hello, I'm making a armor mod but I've run into a problem. When loading in, this message pops up. When in game, the helmet I'm working on doesn't show up. The XML file has everything I think it needs to have. No other mods are enabled. Here is the error message. Could anybody help me please?

Here is the XML.
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

  <ThingDef Name="ApparelMakeableBase" Abstract="True">
    <thingClass>Apparel</thingClass>
    <category>Item</category>
    <selectable>True</selectable>
    <pathCost>10</pathCost>
    <useHitPoints>True</useHitPoints>
    <graphicOnGroundRandomRotateAngle>35</graphicOnGroundRandomRotateAngle>
    <drawGUIOverlay>true</drawGUIOverlay>
    <statBases>
      <MaxHitPoints>100</MaxHitPoints>
      <Flammability>1.0</Flammability>
      <DeteriorationRate>1</DeteriorationRate>
      <SellPriceFactor>0.5</SellPriceFactor>
    </statBases>
    <altitudeLayer>Item</altitudeLayer>
    <alwaysHaulable>True</alwaysHaulable>
    <tickerType>Never</tickerType>
    <thingCategories>
      <li>Headgear</li>
    </thingCategories>
    <comps>
      <li>
        <compClass>CompForbiddable</compClass>
      </li>
      <li>
        <compClass>CompColorable</compClass>
      </li>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
  </ThingDef>

  <ThingDef Name="ApparelMakeableBase" ParentName="HatBase" Abstract="True">
    <recipeMaker>
      <workSpeedStat>TailoringSpeed</workSpeedStat>
      <workSkill>Crafting</workSkill>
      <effectWorking>Tailor</effectWorking>
      <soundWorking>Recipe_Tailor</soundWorking>
      <recipeUsers>
        <li>TableTailor</li>
      </recipeUsers>
      <unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
    </recipeMaker>
  </ThingDef>

  <ThingDef ParentName="ApparelMakeableBase">
    <defName>MRomanHelmet</defName>
    <label>Roman Helmet Helmet</label>
    <description>Ancient Roman Legionaire Armor helmet. Basic protection against swords.</description>
    <graphicPath>MedievalArmor\Textures\Hats\RomanHelmet</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <statBases>
  <MarketValue>150</MarketValue>
      <WorkToMake>500</WorkToMake>
      <ArmorRating_Blunt>0.10</ArmorRating_Blunt>
      <ArmorRating_Sharp>0.20</ArmorRating_Sharp>
  <ArmorRating_Heat>0.1</ArmorRating_Heat>
      <ArmorRating_Electric>0.2</ArmorRating_Electric>
  <Insulation_Cold>-1</Insulation_Cold>
      <Insulation_Heat>-3</Insulation_Heat>
    </statBases>
    <apparel>
      <bodyPartGroups>
        <li>UpperHead</li>
      </bodyPartGroups>
      <worngraphicPath>MedievalArmor\Textures\Hats\RomanHelmet</worngraphicPath>
      <layers>
        <li>Overhead</li>
      </layers>
      <commonality>1</commonality>
      <tags>
        <li>Antique</li>
      </tags>
      <defaultOutfitTags>
        <li>Soldier</li>
      </defaultOutfitTags>
    </apparel>
    <colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>2<weight>
  <only>RGBA(1,1,1,1)</only>
        </li>
      </options>
    </colorGenerator>
  </ThingDef>

</ThingDefs>

Acruid

Like the error says, the weight tag is not closed on line 87. All of the red errors after that are the cross references in other xmls failing because the ThingDef was not parsed properly.

Adamiks

#2
Here you go. You just had to put "/" in <weight>2</weight>

[attachment deleted due to age]

Nocturnal

#3
Quote from: Adamiks on May 13, 2015, 03:09:01 PM
Here you go. You just had to put "/" in <weight>2</weight>

Oh my god. Thank you.
Also, is there any tutorial to making apparel or items craftable at a custom station?

Acruid

The best tutorial I have found is the Smelter Tutorial on the wiki, unfortunately it is for alpha 6. :'( A lot of it is still the same, but you may need to cross-reference it with a crafting station in the A10 defs to find out what has changed. There is no up to date tutorials that I know of.

Nocturnal

#5
Ok thank you. When I release the mod both of you will be credited. Also, another weird problem. It says it can't find the texture for the helmet. But it is configured well.

Pic of the file location.


XML
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

  <ThingDef Name="ApparelMakeableBase" Abstract="True">
    <thingClass>Apparel</thingClass>
    <category>Item</category>
    <selectable>True</selectable>
    <pathCost>10</pathCost>
    <useHitPoints>True</useHitPoints>
    <graphicOnGroundRandomRotateAngle>35</graphicOnGroundRandomRotateAngle>
    <drawGUIOverlay>true</drawGUIOverlay>
    <statBases>
      <MaxHitPoints>100</MaxHitPoints>
      <Flammability>1.0</Flammability>
      <DeteriorationRate>1</DeteriorationRate>
      <SellPriceFactor>0.5</SellPriceFactor>
    </statBases>
    <altitudeLayer>Item</altitudeLayer>
    <alwaysHaulable>True</alwaysHaulable>
    <tickerType>Never</tickerType>
    <thingCategories>
      <li>Headgear</li>
    </thingCategories>
    <comps>
      <li>
        <compClass>CompForbiddable</compClass>
      </li>
      <li>
        <compClass>CompColorable</compClass>
      </li>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
  </ThingDef>

  <ThingDef Name="ApparelMakeableBase1" ParentName="HatBase" Abstract="True">
    <recipeMaker>
      <workSpeedStat>TailoringSpeed</workSpeedStat>
      <workSkill>Crafting</workSkill>
      <effectWorking>Tailor</effectWorking>
      <soundWorking>Recipe_Tailor</soundWorking>
      <recipeUsers>
        <li>TableTailor</li>
      </recipeUsers>
      <unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
    </recipeMaker>
  </ThingDef>

  <ThingDef ParentName="ApparelMakeableBase">
    <defName>MRomanHelmet</defName>
    <label>Roman Helmet</label>
    <description>Ancient Roman Legionaire Armor helmet. Basic protection against swords.</description>
    <graphicPath>Textures\Hats\LegionaireHelmet\Rome1\</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <statBases>
  <MarketValue>150</MarketValue>
      <WorkToMake>500</WorkToMake>
      <ArmorRating_Blunt>0.10</ArmorRating_Blunt>
      <ArmorRating_Sharp>0.20</ArmorRating_Sharp>
  <ArmorRating_Heat>0.1</ArmorRating_Heat>
      <ArmorRating_Electric>0.2</ArmorRating_Electric>
  <Insulation_Cold>-1</Insulation_Cold>
      <Insulation_Heat>-3</Insulation_Heat>
    </statBases>
    <apparel>
      <bodyPartGroups>
        <li>UpperHead</li>
      </bodyPartGroups>
      <worngraphicPath>Textures\Hats\LegionaireHelmet\Rome\</worngraphicPath>
      <layers>
        <li>Overhead</li>
      </layers>
      <commonality>1</commonality>
      <tags>
        <li>Antique</li>
      </tags>
      <defaultOutfitTags>
        <li>Soldier</li>
      </defaultOutfitTags>
    </apparel>
    <colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>2</weight>
  <only>RGBA(1,1,1,1)</only>
        </li>
      </options>
    </colorGenerator>
  </ThingDef>

</ThingDefs>

Adamiks

#6
Remove "1" from Rome texture or just add 1 to "Rome_back", "Rome_side" etc. (i mean add "1" between Rome and _side = Rome1_side)

Change this
<graphicPath>Textures\Hats\LegionaireHelmet\Rome1\</graphicPath>

to this
<graphicPath>Hats\LegionaireHelmet\Rome</graphicPath>

Hint: System always load texture folder, so don't write this in the <graphicpath>

Nocturnal


Adamiks

Copy this
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

  <ThingDef Name="ApparelMakeableBase" Abstract="True">
    <thingClass>Apparel</thingClass>
    <category>Item</category>
    <selectable>True</selectable>
    <pathCost>10</pathCost>
    <useHitPoints>True</useHitPoints>
    <graphicOnGroundRandomRotateAngle>35</graphicOnGroundRandomRotateAngle>
    <drawGUIOverlay>true</drawGUIOverlay>
    <statBases>
      <MaxHitPoints>100</MaxHitPoints>
      <Flammability>1.0</Flammability>
      <DeteriorationRate>1</DeteriorationRate>
      <SellPriceFactor>0.5</SellPriceFactor>
    </statBases>
    <altitudeLayer>Item</altitudeLayer>
    <alwaysHaulable>True</alwaysHaulable>
    <tickerType>Never</tickerType>
    <thingCategories>
      <li>Headgear</li>
    </thingCategories>
    <comps>
      <li>
        <compClass>CompForbiddable</compClass>
      </li>
      <li>
        <compClass>CompColorable</compClass>
      </li>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
  </ThingDef>

  <ThingDef Name="ApparelMakeableBase1" ParentName="HatBase" Abstract="True">
    <recipeMaker>
      <workSpeedStat>TailoringSpeed</workSpeedStat>
      <workSkill>Crafting</workSkill>
      <effectWorking>Tailor</effectWorking>
      <soundWorking>Recipe_Tailor</soundWorking>
      <recipeUsers>
        <li>TableTailor</li>
      </recipeUsers>
      <unfinishedThingDef>UnfinishedApparel</unfinishedThingDef>
    </recipeMaker>
  </ThingDef>

  <ThingDef ParentName="ApparelMakeableBase">
    <defName>MRomanHelmet</defName>
    <label>Roman Helmet</label>
    <description>Ancient Roman Legionaire Armor helmet. Basic protection against swords.</description>
    <graphicPath>Hats\LegionaireHelmet\Rome</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <statBases>
  <MarketValue>150</MarketValue>
      <WorkToMake>500</WorkToMake>
      <ArmorRating_Blunt>0.10</ArmorRating_Blunt>
      <ArmorRating_Sharp>0.20</ArmorRating_Sharp>
  <ArmorRating_Heat>0.1</ArmorRating_Heat>
      <ArmorRating_Electric>0.2</ArmorRating_Electric>
  <Insulation_Cold>-1</Insulation_Cold>
      <Insulation_Heat>-3</Insulation_Heat>
    </statBases>
    <apparel>
      <bodyPartGroups>
        <li>UpperHead</li>
      </bodyPartGroups>
      <worngraphicPath>Hats\LegionaireHelmet\Rome</worngraphicPath>
      <layers>
        <li>Overhead</li>
      </layers>
      <commonality>1</commonality>
      <tags>
        <li>Antique</li>
      </tags>
      <defaultOutfitTags>
        <li>Soldier</li>
      </defaultOutfitTags>
    </apparel>
    <colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>2</weight>
  <only>RGBA(1,1,1,1)</only>
        </li>
      </options>
    </colorGenerator>
  </ThingDef>

</ThingDefs>


Remember about changing this:
      <worngraphicPath>Hats\LegionaireHelmet\Rome</worngraphicPath>

Anyway just copy this above (this more above).


Nocturnal

#9
Still the same message as above...
EDIT: what the hell is going on with this. All files are PNG. Other armor I made works fine.

Adamiks

Hmm.... When i start a game with this file i don't have any errors. Do you can send me this textures, please?

Nocturnal

Quote from: Adamiks on May 14, 2015, 07:20:15 AM
Hmm.... When i start a game with this file i don't have any errors. Do you can send me this textures, please?
Sure, gonna PM it to you. There might be some things left from Apparello as it is based on it. Release version will be clean thought.

Adamiks

I still don't know why it didn't want to work, but anyway i just took the file from core, and i fully rewrite your work into new, fresh, clean xml.

EDIT
Oh... And i PM'ed (?) it to you.

1000101

It's your path names in your xml, you need to use unix style path names.  That is, use / instead of \.

ie:
directory1\directory2\filename

Becomes:
directory1/directory2/filename

Or:
<worngraphicPath>Hats\LegionaireHelmet\Rome</worngraphicPath>

To this:
<worngraphicPath>Hats/LegionaireHelmet/Rome</worngraphicPath>
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By