Set the color replacement style||doc135487

September 20, 2022

Format

 Entity:setUseOverlayColorReplaceMode(masterSlaveName, isUse)
  • The class to which the function belongs:Entity

Description

Set the corresponding skin color mode, whether to change from overlay color to replacement color mode.


Precautions

  • Override color mode is to overwrite the color on the original texture, and replace color mode will directly replace the original skin texture with the set color.

How to target individual skin color settings

Each character will have its own skin group in the Appearance list in the Character Editor

According to the attributes of each skin group, you can get the mutually exclusive group name and group name to locate a single skin

The format of positioning is: mutually exclusive group name.group name
如:custom_face.custom_face_1


Parameters

Variable name type Description
masterSlaveName string body parts
isUse boolean If true, override alternate styles with colors


Code Samples

on the client sideglobal script, register when the client map load is completeCallback, change the player's hair color to pure black

Lib.subscribeEvent(Event.EVENT_LOAD_WORLD_END, function()
    Me:setOverlayColor("custom_hair.custom_hair_1", {0,0,0,0})
    Me:setUseOverlayColorReplaceMode("custom_hair.custom_hair_1", true)
  end)