Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004298Zandronum[All Projects] Suggestionpublic2024-05-30 04:382024-05-30 15:40
ReporterBarrelsOFun 
Assigned To 
PriorityhighSeverityfeatureReproducibilityN/A
Statusneeds reviewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0004298: Expanded Skin Functionality (Patch)
DescriptionI've been working on and off for about a month and a half on a patch to increase the functionality of skins for both the skin creator and mod makers.

With this patch, you can now define multiple classes for a skin, map different sprites to a skin to allow skins for classes that use more than one set of sprites, define your own color range for a skin, and grab information from a skin using GetSkinInfo (including custom parameters)

new/modified values

    "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:
(Player.CrouchSprite "FRDC") will still use the Spawn state sprite as a crouch sprite.

Though with two parameters:
(Player.CrouchSprite "FDC2", "FDM2") will map the sprite of the first parameter to the sprite of the second parameter.

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
    
Additional InformationProvided pk3 has a test map,

A few skulltag skins for the Marine class that have some modifications to showcase some new parameters and parameter tweaks.

A class to showcase skins with the same name and duplicates within the same class.

Another class to test Weapon Skins override.

The showcase skin is "Crash" for the latter 2.
"Crash" for Marine class is marked unselectable to showcase that, yet can still be chosen in the skin selector with the custom 'exception' parameter.
Attached Filespatch file icon skin_expansion.patch [^] (121,346 bytes) 2024-05-30 04:38 [Show Content]
? file icon skinexpansion.pk3 [^] (1,836,754 bytes) 2024-05-30 04:39

- Relationships

-  Notes
There are no notes attached to this issue.

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2024-05-30 04:38 BarrelsOFun New Issue
2024-05-30 04:38 BarrelsOFun File Added: skin_expansion.patch
2024-05-30 04:39 BarrelsOFun File Added: skinexpansion.pk3
2024-05-30 15:40 unknownna Status new => needs review






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker