CCS Keywords

From HEWIKI
Jump to: navigation, search
Caution: This page may contain information which is Hero's Journey-specific!



Contents

CCS Keywords can be used in the Repository Parts Files which graphically define Dynamic characters for the Character Creation System.

Are these keywords used in CleanEngine, or only in HJ?

The CCS is comprised of a number of different reusable elements, including Part Selectors. A Part Selector contains the necessary information to display the contents of a Slot, Subslot or Layer, and allow the user to choose from the available options therein.

While the old (pre-2006) CCS was almost entirely keyword-driven, keywords for Characters 2.0 mostly exist to handle a few circumstances:

A keyword actually contains keyword pairs, each of which contains a key (handled, in the Head keyword below) and a value or setting for that key (ignored in the Head keyword below), which are separated by a colon and terminated with a semi-colon. Note that in the case of Ears and Hair, the keyword is actually made up several such keyword pairs, each ended with its own semi-colon.

Also worth noting is that keywords are never case-sensitive, and in fact are obtained by the game engine as strictly lowercase. Any capitalization is lost, and is applied in the keyword purely to improve readability.

Before we go into the keyword types themselves, we must cover the placement of keywords in the parts (.par) and texturebank (.dtb) files. Each area of the character model has its own manner of being defined, and it is here that we apply keywords.

Slots

Slots are defined at the top of a .par file. Here we see the first five slots for a human male. Head, Ears, and Hair all have keywords defined, while Headwear and Upper Body do not.

 [Slots]
 !
 ! The slots are the areas defined for the Human in which various parts can go
 !
 Head
    Keyword=handled:ignore;
 Ears
    Keyword=type:feature;path:face.ears.shape;
 Hair
    Keyword=type:hair;palettes:Hair Color,Shine,Highlights,Accessories;
 Headwear
 Upper Body

Subslots

Subslots are really defined in two different places. First, they are "claimed" by any Parts for which they are valid, and secondly, they have a series of entries which define their own Parts. In the example below, we see that the Human Ranger Boot Part in the Left Leg Slot makes available a Left Bootcuff Subslot. It is here that the keyword would be applied.

 Left Leg: Bare,Character\Dynamic_2\Shared_Geometry\Male\leg_left_base.gr2
 Left Leg: Human Ranger Boot,Character\Dynamic_2\Shared_Geometry\Male\human_ranger_leg_left_boot.gr2
    Subslot=Left Bootcuff
      Keyword=sync:lower body.right bootcuff;syncname:bootcuffs;

Layers

Layers are simple. Each Layer has as part of its definition a Settings section, as indicated below. Keywords are placed here if necessary.

 {Female Face Detail}
    Type=Tint4
    Region=(0,0,511,511)
    {Settings}
      Keyword=type:feature;path:details.cosmetic;palettes:eyes,eyebrows,lips,secondary details;

Pieces

Pieces are similarly straightforward. Pieces in a layer are basically a list of piece names contained in the {Pieces} area of a Layer definition. Each piece may or may not have various settings such as palettes and default colors. Keywords simply sit in there with the rest of a piece's optional settings. The only keyword currently appropriate for a Piece definition would be palettes.

  {Pieces}
    Look 1
     Type=Tint3
       Keyword=palettes:eyes,eyebrows,lips;
    Look 2
     Type=Tint4
       Keyword=palettes:eyes,eyebrows,lips,eye makeup;
       DefaultColor3=#.6,.75,.80,1
       Palette4=Eye Make-up 1,default_2.dds
       DefaultColor4=#.35,.51,.80,1

With that said, on to the keyword types.

Display Name

In the interest of making the CCS as self-maintaining as possible, the name displayed on a Part Selector is taken directly from the name of the Slot, Subslot, or Layer that it represents. However, this is not always appropriate from a human-readable standpoint. For example, the human female's cleric armor has a Layer called "Upper Body Armor Base", which allows switching between breastplate and chainmail armor; you might want it to read "Cleric Armor Type" or "Armor Material" instead, so you would simply include a keyword such as the following:

 {Upper Body Armor Base}
    Type=Tint4
    Region=(0,0,511,511)
    {Settings}
      Keyword=displayName:Cleric Armor Type;
      Palette1=Human Cleric Armor 1,palette_metallics.dds
      DefaultColor1=#.25,.25,.26,1.0
      Palette2=Human Cleric Cloth 1,Human_Palette_1.dds
      DefaultColor2=#.20,.20,.22,1.0

As noted above, the capitalization of "Cleric Armor Type" will be lost when they keyword is read by the game engine, but it will be recapitalized before being displayed. However, this will only (and always) capitalize the first letter of each separate word. Any hyphenated words will only have their first letter hyphenated, so "dragon-skin pimp hat" would become "Dragon-skin Pimp Hat", not "Dragon-Skin Pimp Hat".

Synchronization

Probably the most common keyword, sync is used to allow the CCS to automatically combine symmetrical slots such as a left and right boot. One of these slots is considered the "master" slot and the other the "slave" slot. Synchronization is done by telling the master slot that it has a slave, by applying a combination of three keywords.

The first and most obvious of the three keywords is of course sync. The sync keyword applies to the master, and takes as its value a "path" to the synched slot, consisting of the Division->Slot/SubSlot. (I don't think there is currently a need to synchronize Layers in this manner, just Slots and Subslots. If time proves me wrong, I'll add in an explanation of that.)

Secondly, you need to provide a human-readable syncName for the synched slots. For example, two slots named "Left Boot" and "Right Boot" would have a combined name of "Boots". Simple enough, eh? This name will be automatically applied to the combined Part Selector whenever synchronization is active for the pair of slots. This keyword is applied to the master slot.

Finally, the slave slot needs to be told that it will be handled as a synchronized slot, via the handled keyword.

Here we see the Left Arm and Right Arm of the human male model being synched up.

 Left Arm
    Keyword=sync:upper body.right arm;syncname:arms;
 Right Arm
    Keyword=handled:synced;


Note: The Master slot of a Master/Slave pair should always be specified first in the parts files, and should always consistent across all such slots. For example, if it is decided that the Left should come first, then the Left should always come first. The reason is that parts are read into the game engine in the order in which they are placed in the files, and if someone gets used to having the Left part come first, you don't want to mess with their head by occasionally throwing the Right part in first. Currently, all Master slots are the Left side.

Handled

Handled is a catch-all keyword that essentially tells the CCS to go on about its business and not bother with this Slot/Subslot/Layer. This may be because the slot is the Slave slot in a Master/Slave synchronization, or because it is simply not something the player will have the ability to change. Various values are given for the handled keyword, such as "ignored" or "synced", but these are simply organizational. If the keyword is present, the Slot/Subslot/Layer is skipped.

 Head
    Keyword=handled:ignore;

Note also that while the Head is marked as ignored, the Face Detail layer still appears under the features section of the CCS. Ignoring a Slot is not inherited by any Layers that may belong to that Slot's Parts.

It's unlikely you will need to use this keyword.

Type

Given that the CCS is split up into several different sections, not all Slots and Layers are handled at the same time. Features such as the Face Detail layer are handled separately from the Hair slot, which is handled separately from the vast majority of model parts which make up the clothing and armor. Here we see two entire slots being claimed by the feature and hair parts of the CCS.

 Ears
    Keyword=type:feature;path:face.ears.shape;
 Hair
    Keyword=type:hair;palettes:Hair Color,Shine,Highlights,Accessories;
 Headwear
 Upper Body

Note that while hair is simply specified as being hair, the feature type requires some additional information in the form of a path. This path is representative of the GUI organization itself, and has nothing to do with the parts files or character model. Luckily, you shouldn't have to use this.

Anything not given a type of feature or hair is assumed to be clothing-related, such as Headwear and Upper Body above.

Palettes

The Palettes keyword allows you to specify less generic names for the color channels used by a piece. By default, the four color channels are simply called "Primary Color", "Secondary Color", "Primary Detail Color" and "Secondary Detail Color". In the case of much clothing, this is sufficient, but all Hair pieces use a very specific color scheme, as do many of the feature details such as eye and lip color.

Palettes can be set at the highest level from which they are going to be consistent across all pieces. For example, Hair, as mentioned, uses the same palette-naming scheme for every piece, so the palette names may be set at the slot level.

 [Slots]
 !
 ! The slots are the areas defined for the Human in which various parts can go
 !
 Head
    Keyword=handled:ignore;
 Ears
    Keyword=type:feature;path:face.ears.shape;
 Hair
    Keyword=type:hair;palettes:Hair Color,Shine,Highlights,Accessories;

However, as mentioned, keywords are inherited only if no lower level has a keyword of its own, and then they are inherited as a whole keyword. Below is the Female Face Detail Layer and its first two pieces. The palette names are set as defaults in the layer's settings, but are overridden by both of these pieces. To override one palette, you must override them all, since the layer's keyword will not carry over at all if the piece has a keyword of its own.

 {Female Face Detail}
    Type=Tint4
    Region=(0,0,511,511)
    {Settings}
      Keyword=type:feature;path:details.cosmetic;palettes:eyes,eyebrows,lips,secondary details;
      Palette1=Eyes,palette_eye_1.dds
      DefaultColor1=#.44,.31,.18,1
      Palette2=Eyebrows,palette_hair.dds
      DefaultColor2=#.23,.16,.13,1
      Palette3=Lips,default_2.dds
      DefaultColor3=#.84,.55,.44,1
      Palette4=details 1,default_2.dds
      DefaultColor4=#.76,.16,.12,1
    {Files}
      (512,512)
      Look_1_d.dds,Look_1_t.dds
      Look_2_d.dds,Look_2_t.dds
      Look_3_d.dds,Look_3_t.dds
      Look_4_d.dds,Look_4_t.dds
      Look_5_d.dds,Look_5_t.dds
    {Pieces}
      Look 1
       Type=Tint3
         Keyword=palettes:eyes,eyebrows,lips;
      Look 2
       Type=Tint4
         Keyword=palettes:eyes,eyebrows,lips,eye makeup;
         DefaultColor3=#.6,.75,.80,1
         Palette4=Eye Make-up 1,default_2.dds
         DefaultColor4=#.35,.51,.80,1

Note also that the first piece, "Look 1", is only a Tint3 piece, presumably meaning that it uses only the first three color channels, so only three palette names are necessary.

Restrictions

Currently, the only restriction is that of a clothing option being npc-only. Simply add a keyword of restrictions:npc; to disallow a normal player character from choosing these items.

 [Slots]
 !
 ! The slots are the areas defined for the Human in which various parts can go
 !
 Hair
    Keyword=type:hair;palettes:Hair Color,Shine,Highlights,Accessories;restrictions:npc;
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox