MantisBT - Zandronum |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0004122 | Zandronum | [All Projects] Suggestion | public | 2023-04-05 13:29 | 2025-03-06 13:42 |
|
Reporter | Trillster | |
Assigned To | Kaminsky | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | needs testing | Resolution | open | |
Platform | | OS | | OS Version | |
Product Version | 3.1 | |
Target Version | 3.2 | Fixed in Version | | |
|
Summary | 0004122: SetPlayerSkin and skin related functions |
Description | Mega Man 8-Bit Deathmatch uses ConsoleCommand for `skin` in its offline campaign skin selector. ConsoleCommand has also been used in that way for many mods in online situations (TF2-esque Spy classes), so there is a definite interest in being able to manipulate this on players.
In addition, there has been interest in being able to retrieve the name of a player's current skin to compare it to some known string. Currently, we can only get an ID which is variable to change when more skins are loaded, which makes checking it very tricky.
Additionally, some function(s) to get a list of current loaded skins would be helpful as well, perhaps designed in the same way as GetMapRotationInfo. We could use this to expand our skin selector to support custom skins then. |
Steps To Reproduce | |
Additional Information | |
Tags | No tags attached. |
Relationships | child of | 0001070 | new | Dusk | Phasing out the dangerous ConsoleCommand for various additional/improved ACS commands |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2023-04-05 13:29 | Trillster | New Issue | |
2023-04-05 13:46 | WaTaKiD | Relationship added | child of 0001070 |
2024-02-25 21:13 | Kaminsky | Note Added: 0023085 | |
2024-02-25 21:13 | Kaminsky | Assigned To | => Kaminsky |
2024-02-25 21:13 | Kaminsky | Status | new => needs review |
2024-02-25 21:13 | Kaminsky | Target Version | => 3.2 |
2024-02-25 23:03 | Kaminsky | Note Added: 0023086 | |
2024-02-25 23:03 | Kaminsky | Status | needs review => needs testing |
2024-02-26 00:41 | Trillster | Note Added: 0023088 | |
2024-02-26 00:43 | Trillster | Note Edited: 0023088 | bug_revision_view_page.php?bugnote_id=23088#r14089 |
2024-02-29 20:20 | Ru5tK1ng | Status | needs testing => feedback |
2024-03-03 06:37 | Kaminsky | Note Added: 0023286 | |
2024-03-03 06:37 | Kaminsky | Status | feedback => needs review |
2024-03-03 22:25 | Ru5tK1ng | Note Added: 0023297 | |
2024-03-03 22:25 | Ru5tK1ng | Status | needs review => needs testing |
2024-03-09 08:15 | BarrelsOFun | Note Added: 0023317 | |
2024-03-09 08:17 | BarrelsOFun | Note Edited: 0023317 | bug_revision_view_page.php?bugnote_id=23317#r14111 |
2024-03-09 08:20 | BarrelsOFun | Note Edited: 0023317 | bug_revision_view_page.php?bugnote_id=23317#r14112 |
2024-03-09 22:34 | BarrelsOFun | Note Edited: 0023317 | bug_revision_view_page.php?bugnote_id=23317#r14113 |
2024-03-09 22:34 | BarrelsOFun | Note Edited: 0023317 | bug_revision_view_page.php?bugnote_id=23317#r14114 |
2024-03-10 06:07 | BarrelsOFun | Note Edited: 0023317 | bug_revision_view_page.php?bugnote_id=23317#r14119 |
2025-03-06 13:42 | Kaminsky | Note Added: 0024238 | |
Notes |
|
|
|
|
|
|
|
(0023088)
|
Trillster
|
2024-02-26 00:41
(edited on: 2024-02-26 00:43) |
|
Although out of the scope of phasing out ConsoleCommand, I do still think some sort of GetMapRotationInfo-esque function would pair quite nicely with these two new functions.
It would help out MM8BDM's custom skin selector in particular to be able to get a list and count of skins that are valid for the player's current class and maybe even details for each skin such as its face icon. This can technically be accomplished with LumpOpen already, but it's a rather tedious implementation.
That aside, below are some notes regarding the new functions.
GetPlayerSkin
- If called in a CLIENTSIDE script, it won't respect the client's `cl_skins` value.
- If called in either CLIENTSIDE or non-CLIENTSIDE scripts, it won't respect the behavior of the +NOSKIN actor flag.
-- Note that `weapon.preferredskin` and SetPlayerSkin take precedence over +NOSKIN (which is preferable behavior!) so GetPlayerSkin as a result should return any forced skins via these means, but in the instance of those not being in play, it should just display "Base".
I'd much appreciate if these kinks could be worked out, because I think this function is most useful in CLIENTSIDE contexts, for example, to change visual effects depending on the skin that players are using, so it should respect which skins the client has enabled via console variable.
SetPlayerSkin
- SetPlayerSkin is capable of setting skins which the server does not have.
-- This can cause incorrect results with GetPlayerSkin when combined with the overrideWeaponSkin parameter. If you force the skin to a skin that the server does not own, the weapon skin will be the "visible" skin despite clients with the skin seeing the forced skin.
- Similar behavior can happen in the opposite situation of a server having an optional wad skin that the client does not have.
-- If the client is forced to be a skin that they do not own via SetPlayerSkin, their `weapon.preferredskin` skin will show on their end, despite the visible skin being the skin they don't own.
Those notes aside, I think this SetPlayerSkin behavior is good enough, since I worry that a more "accurate" approach of using "Base" if the context isn't aware of the skin would make the function worse to use overall.
|
|
|
|
Thanks for the valuable feedback! I created a new MR to address your points on "GetPlayerSkin":'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/38 [^]'
This change should ensure that "Base" gets returned if a player's skins is disabled by the client's "cl_skins" CVar or if a player's class has the +NOSKIN actor flag enabled.
Also, regarding "SetPlayerSkin": I also think keeping the current behaviour is the best way to go. The server and client(s) can load different skins, some of which the other might not have, so it's not necessarily "incorrect" if the function is used to change the player's skin to something that only one or the other might see. There's no guarantee that "GetPlayerSkin" returns the same result for the server and every client either. |
|
|
|
|
|
(0023317)
|
BarrelsOFun
|
2024-03-09 08:15
(edited on: 2024-03-10 06:07) |
|
Building off of the idea of being able to get a skin's face Icon, a 'GetSkinInfo' would probably be better, as it would also allow function for parameters that are otherwise unused in SKININFO such as 'color' and potentially allow for custom parameters.
Preferably it would use GetPlayerSkin or Skin Name/Number outright (such as from an array of all of the skins) as the first argument, and the desired parameter for the second.
ex: GetSkinInfo(GetPlayerSkin(0,GETPLAYERSKIN_VISIBLE),"face")
or GetSkinInfo(MaxSkins[i],"author")
|
|
|
|
|