Draft: Expanded Skin Functionality
Skins have been given Increased functionality.
"name" checks for skins named "skin#" and marks those as 'duplicate' naming them their actual skin number. Duplicate names are allowed once per class considering every class has a skin named "Base".
"scale" now supports X and Y scaling if you use two values.
scale = 0.75, 1.25
"color" now uses V_GetColor and stores a hex value. So you can use color names, RGB, and hex.
If defined, pressing backspace over 'Custom' colorset will set your color to this.
color = red
color = "255 0 0"
color = FF0000
"gender" works similarly to color now, where pressing backspace over "Gender" will set your gender to the skin's defined gender.
"sprites" a Sprite Array to map multiple sprites to a skin. Works with Crouch Sprites and Weapon Skins as well. (Weapon Skins can also have their own sprites array which can be interfaced with)
sprites = [
frdm = crsh
fdm2 = mass
fdm3 = illp
fdm4 = chex
fdm5 = crte
frdc = crac
]
"displayname" is a skin equivalent to the class Displayname, using that in place of the CVAR value in menus to display long names while keeping CVAR names small and easy to type in the console.
displayname = "Crash The Skin"
"colorrange" overrides the class's color range with the skin's own. Useful for when you don't want certain colors to change for your skin.
colorrange = 192, 207
"selectable" true by default. When set to false, the skin is only accessible through Weapon.PreferredSkin or SetPlayerSkin.
"removable" false by default. When set to true, clearplayerskins mentioned below will always remove it. Though if a modder decides they can wipe all skins regardless.
Custom Values for GetSkinInfo
customparam = "Something"
customarray = "Stuff", "More Stuff"
custchararr = [
key1 = value1
key2 = value2
]
GetSkinInfo returns a string of the requested value of a skin's SKININFO parameter or "" if there is none.
GetSkinInfo(int skinIndex, str skinParam)
Array Value is 0 by default
GetSkinInfo(int skinIndex, str skinParam, int ArrayValue)
If a param is a regular array
GetSkinInfo(int skinIndex, str skinParam, str ArrayValue)
If param is a uses a string key array
This should allow for greater flexibility for modders when it comes to skin functionality in their mods.
The existing parameters are set in a specific way, while custom parameters are always what is written as the value, with some existing parameters having a secondary.
For example, GetSkinInfo(#,"name") would return the name in the CVAR value and GetSkinInfo(#,"name",1) would return the name in the SKININFO should the CVAR value be replaced with 'skin#'
This function will always return a string of the given value, so for number values, additional parsing will have to be done.
GetPlayerSkin now returns the index instead of the name which can be interfaced with GetSkinInfo for more flexibility.
There's also an addition to Player.CrouchSprite to allow Crouch sprites for states other than the Spawn state sprite.
Player.CrouchSprite with one parameter will still use the Spawn state sprite as a crouch sprite.
Player.CrouchSprite "FRDC"
Though with two parameters, it will map the sprite of the first parameter to the sprite of the second parameter.
Player.CrouchSprite "FDC2", "FDM2"
Finally there's a 'clearplayerskins' command for KEYCONF with parameters.
clearplayerskins [allskins] [class]
- Default; Clear all 'removable' skins
- clearplayerskins
- Remove all skins.
- clearplayerskins true
- Uses class displayname; removes only removable skins from this class.
- clearplayerskins false classname
- Removes all skins in this class
- clearplayerskins true classname