Wall Graphic path

Started by mrofa, October 10, 2014, 11:05:39 AM

Previous topic - Next topic

mrofa

So maybe anyone know what are namings for files when using "<graphicPathFolderAppearances>" ?
All i do is clutter all around.

Omni

It seems that this line from the wall definition might be the key to specifying different textures for different materials, and I assume that's what you're referring to:
<graphicPathFolderAppearances>Things/Building/Linked/Wall</graphicPathFolderAppearances>
This is a different way of referencing textures than <graphicPathMulti> or <graphicPathSingle>, and likely way to control visual variation. In the Unity assets, I can see files named "Wall_Atlas_Bricks", "Wall_Atlas_Planks" and "Wall_Atlas_Smooth". Unfortunately, I can't observe folder structure to see if that has any relevance. However, these do seem to correlate with the <appearance> tag in the resource listings in Items_Resources.xml
[...]
  <ThingDef ParentName="ResourceBase">
    <defName>StoneBlocks</defName>
[...]
      <appearance>Bricks</appearance>
[...]
  <ThingDef ParentName="ResourceVerbBase">
    <defName>WoodLog</defName>
[...]
      <appearance>Planks</appearance>
[...]

There is more defined related to "stuff" where that is in the files:
[...]
  <ThingDef ParentName="ResourceBase">
    <defName>StoneBlocks</defName>
[...]
    <stuffProps>
      <canMakeBuildings>true</canMakeBuildings>
      <color>(122,109,103)</color>
      <constructEffect>ConstructDirt</constructEffect>
      <appearance>Bricks</appearance>
      <soundImpactStuff>BulletImpactGround</soundImpactStuff>
      <statOffsets>
        <Beauty>2</Beauty>
      </statOffsets>
      <statFactors>
        <MarketValue>0.4</MarketValue>
        <MaxHealth>2.4</MaxHealth>
        <Beauty>1.3</Beauty>
        <Flammability>0</Flammability>
        <WorkToBuild>2.5</WorkToBuild>
        <DoorOpenSpeed>0.45</DoorOpenSpeed>
        <BedRestEffectiveness>0.9</BedRestEffectiveness>
      </statFactors>
      <nameAsStuff>stone</nameAsStuff>
    </stuffProps>
[...]
  <ThingDef ParentName="ResourceVerbBase">
    <defName>WoodLog</defName>
[...]
    <stuffProps>
      <canMakeBuildings>true</canMakeBuildings>
      <color>(133,97,67)</color>
      <constructEffect>ConstructWood</constructEffect>
      <appearance>Planks</appearance>
      <soundImpactStuff>BulletImpactWood</soundImpactStuff>
      <statOffsets>
        <Beauty>2</Beauty>
      </statOffsets><statFactors>
        <MarketValue>0.5</MarketValue>
        <MaxHealth>0.5</MaxHealth>
        <Beauty>1.5</Beauty>
        <Flammability>1</Flammability>
        <WorkToBuild>0.7</WorkToBuild>
        <DoorOpenSpeed>1.2</DoorOpenSpeed>
      </statFactors>
    </stuffProps>
[...]

Note that metal does not have an <appearance> tag - neither does silver - and silver's stuff definitions are as follows:
[...]
  <ThingDef ParentName="ResourceBase">
    <defName>Silver</defName>
[...]
<stuffProps>
      <canMakeBuildings>true</canMakeBuildings>
      <volumePerUnit>0.05</volumePerUnit>
      <color>(180,173,150)</color>
      <constructEffect>ConstructMetal</constructEffect>
      <soundImpactStuff>BulletImpactMetal</soundImpactStuff>
      <statOffsets>
        <Beauty>6</Beauty>
      </statOffsets>
      <statFactors>
        <MaxHealth>0.7</MaxHealth>
        <MarketValue>10</MarketValue>
        <Flammability>0.2</Flammability>
        <Beauty>3</Beauty>
      </statFactors>
    </stuffProps>
[...]

This only defines a color variation as far as appearance goes. My assumption is that anything without a special appearance tag is considered "smooth", including metal, silver, gold, plasteel and uranium, and recolored based on material. Of course, simply having <madeFromStuff>false</madeFromStuff> should prevent unwanted recoloring. Then again, why bother? If people want awkward green recolored computer consoles, that's their choice. ;D

This does not account for the "atlas" part of the wall texture name, but I think that is generally just part of what defines a wall. Only way to know for sure how/if having specific textures would work is trying it out. Also to note, I think the recoloring occurs regardless of using a separate texture, judging by the recoloring of the menu graphic for walls when placing wooden ones changing color but not texture. So unfortunately, I do not think this makes it possible to prevent recoloring for material variations.

Is there a way to attach a separate entity/pawn/sprite to the object that would be drawn on top of the original, or simply draw a second image? If so, that secondary graphic could probably be used to have non-recolored parts. (Though the building placement preview image and building icon would likely be better having those parts included, even if they get recolored in the build icon. Posted the same sentiment in the Clutter thread.)