User:Azeon/Custom Skincolors

From SRB2 Wiki
Jump to navigation Jump to search

skincolor_t

General
Accessibility Read+Write
Allows custom variables No
# (Length) Number of colors
skincolor_t structure
Name Type Accessibility Description/Misc notes
name string Read+Write The name of the skincolor. Used in the console and Player Setup menu. Names containing spaces must be put in quotes in the console.
ramp UINT8 array Read+Write An array of 16 palette indices, which in whole represent the skincolor's color ramp.
invcolor UINT8 Read+Write The opposite skincolor. Used on the Goal Sign.
invshade UINT8 Read+Write The shade of the opposite skincolor, from 0 (lightest) to 15 (darkest). Used on the Goal Sign.
chatcolor UINT16 Read+Write Color to use when coloring a player name in the chat. Accepts V_*MAP constants.
accessible boolean Read+Write Skincolor accessibility. Determines whether the color can be accessed from the Player Setup menu or from the console.

Lua definition

This is an example of a skincolor definition written in Lua. The color is identical to SKINCOLOR_BLUE.

freeslot("SKINCOLOR_BLUECLONE")
skincolors[SKINCOLOR_BLUECLONE] = {
	name = "BlueClone",
	ramp = {146,147,148,149,150,151,152,153,154,155,156,157,158,159,253,254},
	invcolor = SKINCOLOR_ORANGE,
	invshade = 9,
	chatcolor = V_BLUEMAP,
	accessible = true
}

SOC definition

This is an example of a skincolor definition written in SOC. The color is identical to SKINCOLOR_BLUE.

I have no idea why you would choose to do this instead of writing it in Lua, but it's a feature so I may as well document it here.

(Due to the lump loading order being the way it is, if you want to use a custom color in S_SKIN, you must write the color in Lua.)

FREESLOT
SKINCOLOR_BLUECLONE

SKINCOLOR SKINCOLOR_BLUECLONE
NAME = BlueClone
RAMP = 146,147,148,149,150,151,152,153,154,155,156,157,158,159,253,254
INVCOLOR = SKINCOLOR_ORANGE
INVSHADE = 9
CHATCOLOR = V_BLUEMAP
ACCESSIBLE = TRUE

Color order

These functions can be used to get or set the order of skincolors as displayed in the Player Setup menu.

Function Return value(s) Description
M_MoveColorBefore(int color, int targ) nil Moves the color color before the color targ.
M_MoveColorAfter(int color, int targ) nil Moves the color color after the color targ.
M_GetColorBefore(int color) int Returns the color before the color color.
M_GetColorAfter(int color) int Returns the color after the color color.