Add a simple skins mod
WIP PR #1967
Is it worth discussing which skins to add into the game?
Probably some shirt color & skin tone variations of Sam/Samantha.
No it's not worth dicussing, it would be unbearable bikeshedding.
I'll add what i think is suitable, then other devs can add more, so we have a really big choice.
I made it halfway there to making a databased skins mod but I encountered this issue in the engine. Until we can actually make dynamic textures properly I don't think built-in skins are worth it.
Some ideas from my site:
I think some of the skins handling should be implemented to the new player_api mod, in same way like model. The API enhancement should be usable for all skins provider mods. Maybe the simplest skins provider https://github.com/PilzAdam/player_textures/blob/master/init.lua, should be in player_api, but as function overridable by other mods.
This enhancments I see to the player_api (pseudo-code):
player_api.registered_skins = {}
function player_api.register_skin(skin_name, def)
function player_api.set_skin(player, skin_name)
function player_api.get_initial_skin(player) return player_"playername" or "sam" end
The skin definition is at least
{
textures = {}, -- the skins textures for model
model_name = 'model_name', -- the model to be used for the skin
on_set_hook = function(player), -- optional
-- additional optional data supported, if needed for skins provider mods
}
next functionality should be in player_api mod
Additional idea: instead of hard-coded "sam" or 1:1 port of https://github.com/PilzAdam/player_textures/blob/master/init.lua as initial skins, just check if player_api.registered_skins["player_"..playername] then .... else "sam" + and also check initially the textures folder for provided skins.
I plan to start to work on proposed changes on player_api and start a new mod called spsp (=Simple Player Skins Provider) with next functionalities:
i think this concept is basic enough and enhanceable by external skins provider mods like skinsdb trough defined API.
Initial version https://github.com/minetest/minetest_game/compare/master...bell07:player_api_skins_spsp open for discussion.
The version contains the player_api draft changes at the first, for discussion. Based on this changes I implement spsp-mod mentioned above ...
Note the "upright_sprite" is now an registered skin, that means useable in parallel to Sam (for different users), if re-assignment possible by chat command ;-)
PR #2122 is open for discussion