Customizing NPC appearance
- Last UpdatedDec 06, 2023
- 1 minute read
By default, Non Playing Characters (NPCs) are created with a default set of active human submeshes, such as helmet and gloves.
You can modify these settings to customize your NPCs as needed.
Submeshes
Submesh references are created during loading and cannot be set with a patch on corresponding human node.
Create a custom command to set up submeshes. The command is called just once before the submesh displays.
For more information, see Human node.
Code example
This is a code example for setting up submeshes.
<Command name="customizeRobot">
<setfield field="NPC_name_human.submesh_tshirt_visible" value="false" />
<setfield field="NPC_name_human.submesh_airline_mask_visible" value="false" />
<setfield field="NPC_name_human.submesh_back_airline_mask_visible" value="false" />
<setfield field="NPC_name_human.submesh_back_tank_visible" value="false" />
<setfield field="NPC_name_human.submesh_tshirt_visible" value="false" />
<setfield field="NPC_name_human.submesh_hearing_protection_visible" value="true" />
<setfield field="NPC_name_human.submesh_normal_hardhead_visible" value="true" />
<setfield field="NPC_name_human.submesh_safety_glasses_visible" value="true" />
</Command>
Changing appearance
You can change TextureSwitch nodes to change the textures of these NPCs to make each look different. Textures may depend on the selected avatar type.
Typical images to override are:
-
avatar_pants_blu.dds
-
shirt_blu_d.dds
-
avatar_hardhat_sumitomo.dds
Code example
This is a code example for changing TextureSwitch nodes.
<TextureSwitch name=" NPC_name_txtswitchHelmet" mesh="normal_hardhead" human=" NPC_name _human" texture="avatar_hardhat_sumitomo.dds" states="avatar_hardhat_sumitomo.dds,Helmet_contractor.dds" state="1" preload="true"/>
<TextureSwitch name=" NPC_name_txtswitchJacket" mesh="jacket" human=" NPC_name _human" texture="shirt_blu_d.dds" states="shirt_blu_d.dds,shirt_blu_d_contractor.dds" state="1" preload="true"/>
<TextureSwitch name=" NPC_name_txtswitchJeans" mesh="jeans" human=" NPC_name_human" texture="avatar_pants_blu.dds" states="avatar_pants_blu.dds,avatar_pants_blu_contractor.dds" state="1" preload="true"/>