View Single Post
Old 03-08-10, 11:45 AM   #4
Heretic
Commodore
 
Join Date: Mar 2005
Location: Nebraska
Posts: 617
Downloads: 240
Uploads: 2


Default

Here's some simple examples using the function Wp:SetBodyPartVisibility().
syntax is Wp:SetBodyPartVisibility("object", 1 or 0); 1 for on, 0 for off. Objects are defined in the body parts file in Characters folder.

Crewmen are made up of Head, Left Eye, Right Eye, Torso, and Pants. Optionally they can have a Hat and an Object. They start out as defined in the CHR files, be can all be changed with this function.


Add binoculars to a crewman.
Quote:
Wp:SetBodyPartVisibility("object1_Binocular", 1);
Adding a hat. Not all hats work on all heads. Some of the larger heads will show through the hat.
Quote:
Wp:SetBodyPartVisibility("A_Hat01", 1);
Changing a uniform. Important to remove the old one or both will be displayed.
Quote:
Wp:SetBodyPartVisibility("D_Torso05", 1); <-- adds Torso05
Wp:SetBodyPartVisibility("D_Torso01", 0); <-- Removes Torso01
Adding a beard.
Quote:
Wp:SetBodyPartVisibility("object1_Barba_CAP13", 1);
Changing a head. It's best to also use the proper eyes. It's not required, but they might not line up right otherwise.
Quote:
Wp:SetBodyPartVisibility("B_Head03", 0);
Wp:SetBodyPartVisibility("B_EyeL03", 0);
Wp:SetBodyPartVisibility("B_EyeR03", 0);
Wp:SetBodyPartVisibility("D_Head10", 1);
Wp:SetBodyPartVisibility("D_EyeL10", 1);
Wp:SetBodyPartVisibility("D_EyeR10", 1);
The stock scripts use this function to convert the XO into the Captain for the tutorial. Whenever you see someone with something in their hand, a book, knife, screwdriver, whatever, it's done with this function.

Last edited by Heretic; 03-08-10 at 12:02 PM.
Heretic is offline   Reply With Quote