SetCreatureBodyPart( CREATURE_PART_NECK, ...) doing something strange

When I do a SetCreatureBodyPart(CREATURE_PART_NECK, 0) on a creature (e.g. the PC) not only the creature is changed (in case neck was 1 before) but also the armor she’s wearing. So if the armor had a neck before it has none afterwards. And it’s not only a visual effect - GetItemAppearance(, , ITEM_APPR_ARMOR_MODEL_NECK) really returns 0.

Even more funny. If said armor is set hiddenwhenequipped the whole armor (but the neck) gets visually imprinted on the creature’s body. You can now unequipp the armor but the imprint remains. Only equipping a different armor will change that.

Same with left/right forearm. Other creature parts don’t show that behavior.

At least that happens on my NWN installations. Perhaps someone else can test this?

Have you checked that your desired model number exists? I don’t know what happens if it doesn’t, and I’m pretty sure there are no standard models with number 0 (0 is the constant value for CREATURE_MODEL_TYPE_NONE). Here’s the nwscript.nss info for SetCreatureBodyPart:

// Sets the body part model to be used on the creature specified.
// The model names for parts need to be in the following format:
//   p<m/f><race letter><phenotype>_<body part><model number>.mdl
//
// - nPart (CREATURE_PART_*)
//      CREATURE_PART_RIGHT_FOOT
//      CREATURE_PART_LEFT_FOOT
//      CREATURE_PART_RIGHT_SHIN
//      CREATURE_PART_LEFT_SHIN
//      CREATURE_PART_RIGHT_THIGH
//      CREATURE_PART_LEFT_THIGH
//      CREATURE_PART_PELVIS
//      CREATURE_PART_TORSO
//      CREATURE_PART_BELT
//      CREATURE_PART_NECK
//      CREATURE_PART_RIGHT_FOREARM
//      CREATURE_PART_LEFT_FOREARM
//      CREATURE_PART_RIGHT_BICEP
//      CREATURE_PART_LEFT_BICEP
//      CREATURE_PART_RIGHT_SHOULDER
//      CREATURE_PART_LEFT_SHOULDER
//      CREATURE_PART_RIGHT_HAND
//      CREATURE_PART_LEFT_HAND
//      CREATURE_PART_HEAD
// - nModelNumber: CREATURE_MODEL_TYPE_*
//      CREATURE_MODEL_TYPE_NONE
//      CREATURE_MODEL_TYPE_SKIN (not for use on shoulders, pelvis or head).
//      CREATURE_MODEL_TYPE_TATTOO (for body parts that support tattoos, i.e. not heads/feet/hands).
//      CREATURE_MODEL_TYPE_UNDEAD (undead model only exists for the right arm parts).
// - oCreature: the creature to change the body part for.
// Note: Only part based creature appearance types are supported.
// i.e. The model types for the playable races ('P') in the appearance.2da
void SetCreatureBodyPart(int nPart, int nModelNumber, object oCreature=OBJECT_SELF);

Also see the lexicon entry: SetCreatureBodyPart(int, int, object) - NWN Lexicon

1 Like

It doesn’t really matter. 0 (or CREATURE_MODEL_TYPE_NONE) or any number without an existing mdl file just hides the specified body part.

But regardless of the model number the result is always the same: for CREATURE_PART_NECK (always), CREATURE_PART_RIGHT_FOREARM / CREATURE_PART_LEFT_FOREARM
(often) and CREATURE_PART_RIGHT_BICEP / CREATURE_PART_LEFT_BICEP (less often) not only the creature’s body is modified but also the equipped armor.

For forearm/biceps it seems to depend on the equipped armor because for the same char with one armor it happens and with another armor it doesnt.