Masking images so colors don't affect part of an image...

Started by jabbamonkey, November 07, 2014, 09:26:19 PM

Previous topic - Next topic

jabbamonkey

I created a graphic for a new research table...


However, when you build this table out of wood, all of the whites become brown. So, the computer, the papers and the book are all brown. I took a look at some other mods, and they use masks to hide specific areas from the object color.



The question is, what is the naming convention for these new masks - For both SINGLE and MULTI image files? (I tried ResearchBenchm.png and ResearchBench_m.png but that didn't work) And, does the XML need to be changed in order to incorporate the image mask?


mrofa

https://ludeon.com/forums/index.php?topic=6942.0

Also i got this done in clutter with custome research table, but its only a copy of orginal one with chnged name and size
here is the xml.
All i do is clutter all around.

skullywag

make sure you have the shaderType set to cutOutComplex is the main part. Without it, it wont work.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

jabbamonkey

#3
So, in the following file .... Mods/Core/Defs/ThingDefs/Buildings_Misc.xml

For the ResearchBench... under the <label></label> tag, I added...
<shaderType>CutoutComplex</shaderType>

But it still isn't working...

Here is the full code for the ResearchBench...
  <ThingDef ParentName="BuildingBase">
    <defName>ResearchBench</defName>
    <eType>Building_ResearchBench</eType>
    <label>research bench</label>
<shaderType>CutoutComplex</shaderType>
    <thingClass>Building_ResearchBench</thingClass>
    <graphicPathSingle>Things/Building/Production/ResearchBench</graphicPathSingle>
    <altitudeLayer>Waist</altitudeLayer>
    <passability>Impassable</passability>
    <castEdgeShadows>true</castEdgeShadows>
    <statBases>
      <MaxHealth>250</MaxHealth>
      <WorkToBuild>900</WorkToBuild>
      <Flammability>1.0</Flammability>
    </statBases>
    <description>Researchers work here to discover new things.</description>
    <size>(2,5)</size>
    <madeFromStuff>true</madeFromStuff>
    <costStuffCount>40</costStuffCount>
    <costList>
      <Metal>50</Metal>
    </costList>
    <overdraw>true</overdraw>
    <fillPercent>0.4</fillPercent>
    <killedLeavings>
      <ChunkSlag>4</ChunkSlag>
    </killedLeavings>
    <filthLeavings>
      <SlagRubble>2</SlagRubble>
    </filthLeavings>
    <leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
    <interactionSquareOffset>(2,0,0)</interactionSquareOffset>
    <hasInteractionSquare>true</hasInteractionSquare>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <designationCategory>Misc</designationCategory>
    <staticSunShadowHeight>0.20</staticSunShadowHeight>
    <itemSurface>true</itemSurface>
    <designationHotKey>N</designationHotKey>
  </ThingDef>

mrofa

Wierd well it uses graphicSingle, i know that it gives you error on anything other than walls when you use it that way, but still it should work ..
You could try to turn false overdraw, not hing else coms to mind.
All i do is clutter all around.

jabbamonkey

I figured it out. I was modifying the CORE def ... but I am also using the "Tech Tree Minami" mod which also modifies the ResearchBench. So, I had to go into the XML file for the mod which changes the Research Bench (TTM_Building_Misc.xml) and add the <shadertype> tag line.

mrofa

Here is a link to small mod that replace research bench with your textures.
All i do is clutter all around.