Skip to content

feat: Implement custom/existing NPC appearance system#76

Merged
KaBooMa merged 2 commits intoKaBooMa:bleeding-edgefrom
MaxtorCoder:npc-appearance
May 2, 2025
Merged

feat: Implement custom/existing NPC appearance system#76
KaBooMa merged 2 commits intoKaBooMa:bleeding-edgefrom
MaxtorCoder:npc-appearance

Conversation

@MaxtorCoder
Copy link
Copy Markdown
Collaborator

Implement custom NPC appearance system, also assign existing appearances to already existing NPCs.

Example Usage

Setting pre-defined customizations

public class TestNpc : NPC
{
    public TestNpc() : base("test_npc", "Test", "Npc")
    {
        Appearance.Set<HairStyle>(HairStyle.Afro)
            .Set<HairColor>(0xFF00315C)
            .WithFaceLayer<FacialHair>(FacialHair.Goatee, 0xFF000000)
            .WithFaceLayer<Eyes>(Eyes.EyeShadow, 0xC8000000)
            .WithAccessoryLayer<Head>(Head.BucketHat, 0xFF32C02C);

    }
}

NOTE: Color fields are either Hexadecimal codes (0xAARRGGBB) or Color type from UnityEngine

Random customization:

public class TestNpc : NPC
{
    public TestNpc() : base("test_npc", "Test", "Npc")
    {
        Appearance.GenerateRandomAppearance();
    }
}

Customization Fields (Set<T>)

  • EyeballTint (color field)
  • EyebrowRestingAngle (float field 0 - 1)
  • EyebrowRestingHeight (float field 0 - 1)
  • EyebrowScale (float field 0 - 1)
  • EyebrowThickness (float field 0 - 1)
  • EyeLidRestingStateLeft (float field 0 - 1)
  • EyeLidRestingStateRight (float field 0 - 1)
  • Gender (float field 0 - 1)
  • HairColor (color field)
  • HairStyle
  • Height (float field 0.8 - 1.2)
  • PupilDilation (float field 0 - 1)
  • SkinColor (color field)
  • Weight (float field 0 - 1)

Body Layer Fields (WithBodyLayer<T>)

  • Pants
  • Shirt

Face Layer Fields (WithFaceLayer<T>)

  • Eyes
  • Face
  • FacialHair

Accessory Fields (WithAccessoryLayer<T>)

  • Bottom
  • Chest
  • Feet
  • Hands
  • Head
  • Neck
  • Waist

@KaBooMa KaBooMa merged commit 63b8510 into KaBooMa:bleeding-edge May 2, 2025
1 check failed
@MaxtorCoder MaxtorCoder deleted the npc-appearance branch May 2, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants