Tags for use in custom factions

Started by catter, July 25, 2018, 09:31:50 PM

Previous topic - Next topic

catter

Ok, so I am trying to implement a new faction type for A17 and run into a snag. You see, I want to make it so that the faction wears a very specific set of apparel that doesn't follow any of the other default sets. From what I could gather, this section of code is what does it:

(other code)
    <apparelTags>
      <li>(insert tag here)</li>
    </apparelTags>
(other code)

The thing is, I don't know how to create a custom tag for this. Is there a way to make a new tag? Is that even the right code to change? Thanks in advance for any help.

Mehni

Those are simply strings.

When it's time to clothe a pawn, the game looks through its closet (well, the part of the def database that contains apparel anyway) and only selects apparel with that tag.

Outlanders have
Quote<apparelTags>
      <li>IndustrialBasic</li>
      <li>IndustrialAdvanced</li>
    </apparelTags>

and for instance the jacket has
Quote<tags>
        <li>IndustrialAdvanced</li>
      </tags>

The tag accepts string values, so it's not picky about what you put in. No need for cross-references or defs. If you want your faction to wear certain types of existing apparel, you'll need to add the appropriate tags to the apparel with x-path. If you got custom apparel, just add it to your xml.

TL;DR: apparelTags are like a dresscode. Pawns are expected to just know the difference between black tie, white tie and their undress clothes.

catter

Ok, so I looked for the first section of codethat you gave in all the places I could, but never found it. Where did you find it, because I checked the FactionDefs and never found it in there.

Mehni

If you have a good text editor, you have a Find in Files feature. Use it, abuse it. RimWorld has like a thousand Defs and a million tags, so there's no way anyone can remember where they all are.

Most good text editors also have a "Open folder as workspace" option, which opens an explorer style pane. If you keep the Defs folder open, you can easily search and easily reference files.

apparelTags are in the PawnKindDef.

catter

Ok, problem solved. While the advice you gave didn't help, I found out how it actually works. For A17, to use apparel tags you go to the apparel def you want to edit and add a new tag in there where it says: <tags>
  <li>Tribal/Outlander/Military/Spacer</li>
</tags>

This is where you put the new tag for the apparel, and make sure your new faction has the same tag in it leading to the apparel tag.

Hope that helps any out-of-date modders out there!