SetHairColor

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender.

Description

Sets the hair color RGB value, specified as a single int, for the specified NPC or calling reference. To see the changes, you must call Update3D.

Syntax

[help]
(none) Actor.SetHairColor NewRGB:int Actor:NPC 

Example

SunnyREF.SetHairColor 1044735
SunnyREF.Update3D

Note

In order to calculate the 7-digit integer that SetHairColor accepts based on regular RGB integers between 0 and 255 (see GetHairColor to have the system explained more fully), each color's integer needs to be converted to a 2-digit hex string, the hex strings concatted in BGR order, and the result converted to decimal:

let svBlue := NumToHex iBlue, 2
let svGreen := NumToHex iGreen, 2
let svRed := NumToHex iRed, 2
let svFull := svBlue + svGreen + svRed
let iFull := ToNumber svFull, 1

See Also