-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle undefined appearance, docs for appearance
- Loading branch information
Showing
3 changed files
with
311 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Player - Appearance | ||
|
||
Used to set various freeroam character appearance data and store in the database. | ||
|
||
```ts | ||
import { usePlayerAppearance } from '@Server/player/appearance.js'; | ||
|
||
const appearance = usePlayerAppearance(somePlayer); | ||
|
||
// Get hair decorator for style, and save to database | ||
const hairDecorator = appearance.getHairOverlay(0, 5); | ||
|
||
// Set eye color and save to database | ||
appearance.setEyeColor(5); | ||
|
||
// Set eyebrow style and save to database | ||
appearance.setEyebrows({ style: 1, color: 5, opacity: 1 }); | ||
|
||
// Set facial hair style and save to database | ||
appearance.setFacialHair({ style: 5, color: 2, opacity: 1 }); | ||
|
||
// Set a hair style and save to database | ||
appearance.setHairStyle({ hair: 5, color1: 25, color2: 25, decorator: hairDecorator }); | ||
|
||
// Set face appearance data | ||
appearance.setHeadBlendData({ | ||
faceFather: 0, | ||
faceMother: 0, | ||
skinFather: 5, | ||
skinMother: 45, | ||
faceMix: 0.5, | ||
skinMix: 0.5, | ||
}); | ||
|
||
// Set to true to have a more feminine body | ||
appearance.setModel(true); | ||
|
||
// Set tattoos on the player and save to database | ||
appearance.setTattoos([{ collection: 'mpairraces_overlays', overlay: 'MP_Airraces_Tattoo_000_M' }]); | ||
|
||
// Called automatically, but resynchronizes freeroam player appearance | ||
appearance.update(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.