Stop clothing piece from changing colour based on materials

Started by EzraN, August 12, 2016, 12:48:07 AM

Previous topic - Next topic

EzraN

I am trying to create a piece of clothing that will not be affected by the materials it is made by, is there a setting to turn this off?

RawCode

did you checked xml def of common "piece" before asking on forum?

EzraN


kaptain_kavern

#3
meaning "read" here

Just open the files with a text editor

take any item/object that is not affected by material/stuff (like beer, medicine, etc)

kaptain_kavern

I haven't been clear enough :
In fact nearly all objects in games are not affected by theirs materials.

So you'd better check how they're done (those affected by) and compare with other "normal" objects to see (and try to guess) what <xml tag/s> is/are responsible for this behaviour; and not using them.

Hope it was clearer this time

CannibarRechter

I just compared ordinary apparel to power armor just now. While power armor doesn't take the coloration of the stuff it's made with, it also doesn't have a stuffCategory. Is there an item in the game that has a stuffCategory, but doesn't take the coloration of the stuff? I can't think of one off the top of my head.

Side note. I've spent a lot of time in the XML files. I think this thread is less than helpful to the poster, and somewhat hostile to newbies. We should encourage new modders by giving them slightly more directed tips.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Shinzy

you need to remove the comp colorable from the item and it's parent def to get it to not use stuffcolour (but then you'll have to manually colour the texture yourself if you want it to have any colour of it's own)

ckjzam

As a newbie I agree with CannibarRechter's assessment that kaptain_kavern's posts seem hostile to newbies :(

@Shinzy can you please be more specific? My objects get recolored even though neither they nor their parent def have <comps>...</comps> OR anything about "colorable" OR anything about "stuffcolor" anywhere in them. I assume I'm misunderstanding what you're talking about since my objects are still being recolored. I'm doing walls though, not clothing.

CannibarRechter

Hi ckjzam,

Which types of objects are you trying to alter?
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

ckjzam

I'm adding fences based on Itchy Flea's fence mod. The category and thingClass for them are both "Building." I don't mean to monopolize EzraN's thread if it doesn't help with the clothes though! I just want to learn.

CannibarRechter

Looking over sculptures, which are an instance of SculptureBase, these don't have the colorable comp, so I'd venture that the prior advice doesn't work for buildings. You might play around and try to make a clothes item not colorable, to see if it actually does work for apparel. Whatever the mechanism is, it doesn't appear generic.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

kaptain_kavern

#11
Quote from: ckjzam on August 15, 2016, 12:17:27 PM
As a newbie I agree with CannibarRechter's assessment that kaptain_kavern's posts seem hostile to newbies :(
Please don't. I consider myself a newbie too seriously.

And again sorry for my weird way of talking. I'm no natural english speaker and i ve learned by myself. If all of this was in my natural language i'm sure you will not feel me hostile.

Again sorry I don't want to be hostile at all. I mean I replied to help not to insult you in any way


Edit : I literally spend several hours a day trying to help people on this forum, on Reddit (and the Slackware when i'm here). All this, since a quite amount of time, and it's just lately that I have been "insulting" or "harsh" against people(w/o me wanting to).
Is that folks from the Steam Release are more fragile/delicate ? I mean i replied and provide information on how to proceed/learn.    How is that insulting ?

(asking all that to try talk in a better way next time ;) )

Shinzy

Yeah the comp colorable is apparel only thing, it works just for them
with buildings my best guess would be to just use the Costlist instead of CostStuffcount
looking at the defs only the buildings that get coloured in vanilla use those. Check some of the vanilla buildings (like cooking stove) for some pointers

And knowing Kavern he was just being as helpful as he could, trying to point the OP to a working example from vanilla =P
It's hard to give any definitive answers unless you have done the thing yourself first

CallMeDio

Hello, I just oppened the def folder: "ThingDefs_Misc" where you can find "Apparel_Various.xml", there you can find all the clothes and its colours, taking for example the parka:

  <ThingDef ParentName="ApparelMakeableBase">
    <defName>Apparel_Parka</defName>
    <label>parka</label>
    <description>A thick parka for staying warm in even the coldest of temperatures.</description>
    <graphicData>
      <texPath>Things/Pawn/Humanlike/Apparel/Parka/Parka</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <costStuffCount>120</costStuffCount>
    <stuffCategories>
      <li>Fabric</li>
      <li>Leathery</li>
    </stuffCategories>
    <thingCategories>
      <li>Apparel</li>
    </thingCategories>
    <statBases>
      <MaxHitPoints>140</MaxHitPoints>
      <WorkToMake>30000</WorkToMake>
      <ArmorRating_Sharp>0.03</ArmorRating_Sharp>
      <ArmorRating_Heat>0.03</ArmorRating_Heat>
      <Insulation_Cold>-40</Insulation_Cold>
      <Insulation_Heat>-3</Insulation_Heat>
    </statBases>
    <equippedStatOffsets>
      <MoveSpeed>-0.05</MoveSpeed>
      <WorkSpeedGlobal>-0.20</WorkSpeedGlobal>
    </equippedStatOffsets>
    <apparel>
      <bodyPartGroups>
        <li>Torso</li>
        <li>Shoulders</li>
        <li>Arms</li>
      </bodyPartGroups>
      <worngraphicPath>Things/Pawn/Humanlike/Apparel/Parka/Parka</worngraphicPath>
      <layers>
        <li>Shell</li>
      </layers>
      <commonality>1</commonality>
      <tags>
        <li>Outlander</li>
        <li>Tribal</li>
      </tags>
      <defaultOutfitTags>
        <li>Worker</li>
        <li>Soldier</li>
      </defaultOutfitTags>
    </apparel>
    <colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>10</weight>
          <only>RGBA(0.33,0.33,0.33,1)</only>
        </li>
        <li>
          <weight>10</weight>
          <only>RGBA(0.65,0.65,0.65,1)</only>
        </li>
        <li>
          <weight>10</weight>
          <only>RGBA(0.4,0.3,0.15,1)</only>
        </li>
        <li>
          <weight>15</weight>
          <min>RGBA(0.3,0.3,0.3,1)</min>
          <max>RGBA(0.5,0.5,0.5,1)</max>
        </li>
        <li>
          <weight>6</weight>
          <min>RGBA(0.5,0.5,0.5,1)</min>
          <max>RGBA(1,1,1,1)</max>
        </li>
      </options>
    </colorGenerator>
  </ThingDef>


the part at the end:

<colorGenerator Class="ColorGenerator_Options">
      <options>
        <li>
          <weight>10</weight>
          <only>RGBA(0.33,0.33,0.33,1)</only>
        </li>
        <li>
          <weight>10</weight>
          <only>RGBA(0.65,0.65,0.65,1)</only>
        </li>
        <li>
          <weight>10</weight>
          <only>RGBA(0.4,0.3,0.15,1)</only>
        </li>
        <li>
          <weight>15</weight>
          <min>RGBA(0.3,0.3,0.3,1)</min>
          <max>RGBA(0.5,0.5,0.5,1)</max>
        </li>
        <li>
          <weight>6</weight>
          <min>RGBA(0.5,0.5,0.5,1)</min>
          <max>RGBA(1,1,1,1)</max>
        </li>
      </options>
    </colorGenerator>


Are color codes (RGBA), I took a look inside the source code and the color of the apparel is generated randomly between the <min>colorcodehere</min> and the <max>colorcodehere</max> color codes, for your objective(as a first test) take the part I added in the second big code box, put in the end of the apparel definition of the thing you don't want to change color (just like it is on the parka right before </ThingDef>, keep the weights like they are and make all color codes: RGBA(1,1,1,1), if you get an error try making all mins RGBA(0.98,0.98,0.98,1) and all max RGBA(1,1,1,1) let me know what happened.
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

CannibarRechter

I don't think the colorGenerator impacts items that you make. I think it affects items that drop. I'm not positive, but I think that's how that goes.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects