Talk:CCG V3-1 Conversion:Part 8 Custom Races
From NWN1 Custom Content Guide
How to get the base model parts of a new player race to use their own PLT textures. (Hats off to Elorfin Endorfin for this.)
The problem: After going to the trouble of creating custom race models, creating new armor with NWArmory and finagling with hakpaks, one bug still afflicts custom races – they default to the human skin textures once armor is removed from them. This is a Bioware bug, one unfixed as of patch 1.62. Because custom races are not likely seen as a make-or-break issue for NWN functionality by Bioware, a variety of work-arounds have been cobbled together ranging from never removing armor to SetAppearance calls in game.
However, a method described on the Bioware Neverwinter Nights/Builders/Custom Content forum (total thread at http://nwn.bioware.com/forums/viewtopic.html?topic=360405&forum=48) offers one solution to the problem. It’s not a complete solution, as it doesn’t stop human skin colors appearing on individual armor pieces, but it does keep the basic model appropriately textured without armor.
Basically, since the game is so dead-set on defaulting to the human plt’s, you are going to accommodate it by removing the first models of each part and replace them with one new custom mdl and a customized human plt. The key is to make a new set of models and plt's numbered in the 200 (or higher) range (e.g. pmp0_chestX where "X" is a number not in use by another custom race, somewhere in the 203 or higher range) to replace the models and plt’s numbered 001 & 002 (e,g. pmp0_chest001) and use those for the custom race.
The method:
1. Create the custom race (for purposes of example named pmp0.mdl in this description) using modeling tools and churn out armor as appropriate (e.g. pmp0_belt001-157, pmp0bicepl001-157, etc., pmp0_armorname001-157), most likely using NWArmory.
2. Make a new set of models AND plt's suffixed with a 203 or higher number. The models must be prefixed with the custom race prefix (pmp0 in the example so far), and the plts prefixed with pmh0 and suffixed with the number in the 203 or higher number you’ve selected. We’ll use 203 in this discussion for the parts, but you’ll likely have to choose another one, to prevent conflicts with other custom races (see Rule 4. below.)
a. So a file named pmp0_chest203.mdl might actually read like so internally:
filedependancy pmp0_chest203.max
newmodel pmp0_chest203
setsupermodel pmp0_chest203 NULL
bitmap pmh0_chest203 (where this is your custom plt)
b. A side note: To use tga or dds textures, instead of plts, see Rule 5 below in the last section of this discussion. Otherwise, move on to step 3.
3. Now delete all model parts suffixed by a 001 or 002, except for shoulders, belts and heads. So, the example custom race has pmp0_bicepl models numbering 003 to somewhere around 157. It also has a pmp0_biceptl203 (and also have forearms 203, feet 203, etc.)
4. Load these files into your hakpak with appropriate .2da’s and create the creature in the toolset using the creature wizard. By deleting the 001 & 003 models, you have removed these from the Appearance tab of the Creature Properties Window. But by inserting the models numbered 203, you have successfully added one option there for each part.
5. Start the toolset, add the hakpak and add your custom race to the game (remember to close and re-open the toolset after you add the hak and save to reset the module) using the Creature wizard. Now your options for each body part are 000 and 203 in the Appearance tab of the Creature Properties wizard in the toolset. Select 203 for the various armor pieces (all save shoulders, belts and heads as well as any static parts in your model.) The creature will default to your custom plt when armor is removed.
The rules (so far):
1. A player model part (chest, biceps, leg, etc.) will use the human PLT if the internal references reflect the model name. The models must be prefixed with the custom race designation (e.g. pmp0 in the discussion above), and the plts prefixed with pmh0 and suffixed with a 203 or higher number.
If the internals reflect a model name other than the one it's in (i.e. leave the human, elf, etc. in-game character races references in it), then it will first look for a dds file, then a tga if no dds is found. The dds or tga that it looks for is specified in the line starting with "bitmap". Please note, that a model with multiple parts can actually use multiple textures, each piece having a different tga (if you wanted).
2. Unfortunately, this is either one or the other. You cannot rename the internals and have it use a plt file named "mypetmonster.plt" Tga or dds only.
3. These rules also have another exception: Heads. Here, you can keep the internal references the same as the model and instead of using a human plt, these will look for a matching file name plt (i.e.: your pm+0_head001.plt). And if you rename the internals to something else, then you can use the above rules for a dds or tga texture.
4. Numbering anything above 200 is acceptable as long as there isn't already a player model using that number. For instance, many human skeleton pieces already use 200 and 201, plus 202 is in use for a custom race lizard man and 203 for a custom kobold race. So, new custom races should use different numbered part (203 or higher) due to the fact that the human plt 202 will be used. (Note: as of July 2004 other custom races planned for community use (some Maztica creatures) that will use 204 and 205 are also planned.)
Therefore making human 206 plts and creature pm?0_armorpiece206 models would be advised for the next race of models, then 207 for the next, and so on. (Note: for HOTU owners -- the number 255 seems to hold the Pale Master bone appendage models, so avoid it.)
5. A side note: To use tga or dds textures, instead of plts, you need to make the .mdl file’s internal prefix references differ from the name of the file it is within.
a. Rename all the pmp0_armorname001 pieces (the base appearance without armor where you could have written in a appropriate creature texture on the bitmap line that let’s call mypetmonster.tga) to pmp0_arrmorname203, except for shoulders, belts and heads.
If the internal references in the .mdl file reflect a model name other than the one it's in (i.e. pmh0_arrmorname203), then it will display the texture file listed in the bitmap row of the file (Neverwinter will first look for a dds file, then a tga if no dds is found specified in the line starting with "bitmap".)
b. So a file named pmp0_chest203.mdl might actually read like so internally: MAXMODEL ASCII
model: pmh0_chest203
filedependancy pmh0_chest203.max
newmodel pmh0_chest203
setsupermodel pmh0_chest203 NULL
bitmap mypetmonster
c. Bonus side note: a model with multiple parts can actually use multiple textures, each piece having a different tga (if you wanted).
6. Need to make the females and also heavy phenotypes?
a. You will need to make plt 203's (or whatever number) for the heavy phenotypes AND the females.
For instance, you'll have the following plt's & models: pmh0_biceptl203.plt for pmx0_biceptl203.mdl pmh0_biceptr203.plt for pmx0_biceptr203.mdl
pmh2_biceptl203.plt for pmx2_biceptl203.mdl pmh2_biceptr203.plt for pmx2_biceptr203.mdl
pfh0_biceptl203.plt for pfx0_biceptl203.mdl pfh0_biceptr203.plt for pfx0_biceptr203.mdl
pfh2_biceptl203.plt for pfx2_biceptl203.mdl pfh2_biceptr203.plt for pfx2_biceptr203.mdl
b. And that's just for both biceps. Similar process for all the other pieces as well. Some server game developers have choosen NOT to do phenotypes or females because of the hak pack size and also because they're only giving the players one option for each new race.
So, the rules for such a restricted-case server will be (as an example only): If you want to become a lizardman, log on, create a new human male, normal phenotype. Then upon logging in to the module, you tell the system you want to be lizardman, and it confirms and logs you off. As soon as you log off, the scripts run and changes your BIC file to what we have specified for a lizardman. These specifications are skin color green, hair white, head001, legr202, legl202, etc... The BIC is modified right away so that as soon as you relog back in, you are now a lizardman with green skin and an attitude!
Creating options for phenotype or even male/female can become a real scripting nightmare cause you have to ask the players so many questions that they probably don't know the answer to anyway (like which head do you want?).
7. The last rule is to let the community know if you figure anything else out about the method, or if you see some place where community content is conflicting, as more custom races appear that use substitute plt’s.
