-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player skinning: Enhanced player_api, skins and skin_admin mods #2122
Conversation
Thanks, i was intending to ask you if you might be interested in writing skins code for MTG. |
My "full-blown" skinning version is skinsdb. Should I apply additional features to spsp from there? Maybe the "private" and "not_in_inventory" flags + the "Simpler skins"-UI + preview using perspective change? I personally like more the preview images on buttons because this way it is possible to see alls skins appearence side-by-side. But agree additional preview textures arent good. |
I feel it's best to wait for more input first, it will be a while before i look at this carefully, and MTG dev is slow recently. |
Added a new hook |
Some additional fixes done. Started work porting other mods to use the API changes: https:/bell07/minetest-player_api_modpack |
Two things: Firstly, I don't like the name Secondly, in the future I'd like player_api to facilitate multiple skin mods working but not conflicting. In practice this would be done by doing something like this from a skin mod: player_api.register_skin_provider("mymod", function(player)
local options = player:get_meta():get("mymod_option")
-- actually set skin
end)
function set_skin(player, options)
player:get_meta():set_string("mymod_option", options)
player_api.set_skin_provider(player, "mymod")
end Haven't read this mod yet, but I think it's important to design it in such a way that adding the above will be possible in future |
Thank you for suggestions The skins provider does not need to be registered. A Skins provider is just a mod that does register skins. The registered skin does have minimal definition: textures + model (optional). The "Skin modifiers" (clothing + armor) could be registered using player_api.register_skin_modifier() |
Added some additional changes:
I follow the next concep to calculate skinst: Basics: If a skin visual update requested: function player_api.update_textures(player) |
Did some cleanup. 1-texture skins can use "texture" attribute now, the "textures" is reserved for multi-textures skins now. Added documentation about possible skin attributes to the first post and to the player_api/skin_api.txt file. |
Just for information: If spsp is to simple, I stripped down the "Flexible Skins API" from skinsdb and adjusted according the proposed API changes. Maybe the "skinsdb5" is a candidate for minetest_game now? |
Last but not least added the skins mod from #1967 and ported to the player_api enhancements. All mods (player_api, spsp, skins + all of player_api_modpack) does work together now trough enhanced API. All puzzle parts are done, now please decide which of them should be added to the Minetest Game. |
Did some cleanup. Moved the private skins assingment from spsp to player_api (to be default behaviour) and renamed spsp to skin_admin. The reason for renaming is the mod contains only the admin chat command for skins reassignment. Updated the initial pull request text. Now I am satisfied the mods could be merged to minetest game. Of course the documentation needs to be done, I cannot do it because of my still insufficient english skills. |
Forum discussion around this pull: https://forum.minetest.net/viewtopic.php?f=9&t=20682 |
@paramat, you mentioned there is a way to swich automatically into third person view. I do not see it in lua_api.txt. Can you please provide the piece of code for "skins" mod? |
Sorry for delayed reply. I was wrong, i don't think there is a way. |
Ah, ok. The "skins" mod in this pull is based on your code in #1967 |
Rebased. Set preview image for demo sprite skin. Semi-standard as used in new skinsdb5 |
I'm still interested in this, thanks for the work. We may be considering skins issues after release, possibly as a way to provide male and female default skins. |
rebased against stable-5 and did a bugfix |
This isn't being delayed by changes needed, more core devs (me included) need to consider and review it. As usual core dev time is the 'bottleneck', not contributors. |
I am still available advisory and can still do small adjustments on my work if needed. But nothing pro-active anymore, just because I do not use/play it. I am glad to see someone wants to take care of my work. I think this PR we can get into Minetest Game together |
Maybe make a note of that. Use github's review function, or make a label. That way, the current stage of this PR is understood. |
b3u, no need for notes or comments, the PR is like every PR in that it needs core dev attention. |
It is possible to have Skin-preview for formspec based on the skin texture. I found it in https:/GreenXenith/skinsdb/blob/master/skin_meta_api.lua (Thanks to @GreenXenith) and copied to the skinsdb5. So may this skin manager can be added to the minetest_game / to this PR? |
Rebased and add parameter to force update to update the same skin. Required for character_creator preview update |
Rebased against origin/stable-5 |
rebased to origin/master |
squashed and rebased agains current stable-5. Merged current origin/master. Did some modernizations |
travis error are false-positives, related to the unified_inventory integration in skinsdb5.
|
Keeping this feature PR open due to at least 2 core devs supporting and the amount of work that has gone into this. |
Found some time to work again on my player_api modpack. Updateted this PR by the way. Changes in the last PR to the player_api: Removed the "hook" from fixed also formspec issue in the skins mod |
Why closed without comment? |
Minetest Game has been frozen for new features for a while now (#2710), with that plus very low dev interest this has practically zero chance to be merged. |
As mentioned in #1965 this is my proposal for skins implementation for minetest_game
Forum discussion around this pull: https://forum.minetest.net/viewtopic.php?f=9&t=20682
player_api - enhanced
How it works
Basics
1.1. Registered Skin is basically a texture, but could be a table with multiple textures
1.2. There is a default model, but for each skin an model override could be assigned (seel sam vs sprite)
1.3. The skin assingment to player can be changed. The model is reassigned automatically based on skin setting (or default).
1.4. A skin could be dynamically trough skin modifiers
Dynamic skin updates
To update the (dynamic) current skin visual
update_textures(player)
is called2.1. Get current skin and build/copy the a textures table
2.2. Call all registered skin-modifier functions to change the textures table
2.3. Call the model:skin_modifier() function to change the textures table for model specific adjustments
2.4. Apply modified textures to player and store in lua-table for globalstep animation updates
If the skin is changed
3.1. Update textures
3.2. Store assingment in player meta if it is not initial assignment
3.3. Call all registered on_skin_change functions
Skin defnition:
Basically a registered skin is just a table with some attributes. The required attributes are the registered "name" and the texture (or textures). All other data is optional metadata. The next metadata is "standardized" to allow interact different mods with the same skins.
textures = { texture }
The API support reading the metadata from text files in meta folder. The metadata file syntax is
key = "value",
skin_admin - new mod
Chat-Command "/skinadm" for server admins to reassign any skins to any player
skins - new mod
Based on #1967 proposal a skins manager for players that allow to select skin on sfinv page