Skip to content
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

Skins #1965

Closed
rubenwardy opened this issue Dec 4, 2017 · 9 comments
Closed

Skins #1965

rubenwardy opened this issue Dec 4, 2017 · 9 comments
Labels

Comments

@rubenwardy
Copy link
Member

Add a simple skins mod

@paramat
Copy link
Contributor

paramat commented Dec 4, 2017

WIP PR #1967

@C1ffisme
Copy link

C1ffisme commented Dec 4, 2017

Is it worth discussing which skins to add into the game?

@benrob0329
Copy link
Member

Probably some shirt color & skin tone variations of Sam/Samantha.

@paramat
Copy link
Contributor

paramat commented Dec 5, 2017

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.

@Aurailus
Copy link

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.

@paramat paramat removed their assignment Mar 3, 2018
@bell07
Copy link
Contributor

bell07 commented Apr 18, 2018

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

  • Adjust model if skin is selected
  • call on_set_hook if defined before setting model and textures (allow dynamically skins definition)
  • Store current assigned skin to player metadata
  • on_joinplayer call the set_skin with selected skin from metadata (including on_set_hook dynamic call)
  • on_newplayer (or on_join player if no selected skin found) - call function player_api.get_initial_skin to get initial skin before setting them. The method could be redefined by other skins mod.
  • of course at least the "sam" skin, maybe an second female skin too?

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.

@bell07
Copy link
Contributor

bell07 commented May 14, 2018

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:

  • Read "textures" folder and register all skins in player_api
  • User "player_"..playername Skin as default for player if such skin registered and no other skin assigned
  • Chat command to list skins and assign skin to player. Player cannot set skin byself because I do not implement any "private/public/wardrobe/???" skin authority concept to player_api or spsp. Just the server owner is allowed to do whatever like, so server privilege required

i think this concept is basic enough and enhanceable by external skins provider mods like skinsdb trough defined API.

@minetest minetest deleted a comment from Xaleth May 14, 2018
@bell07
Copy link
Contributor

bell07 commented May 14, 2018

Initial version 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 ;-)

@bell07
Copy link
Contributor

bell07 commented May 14, 2018

PR #2122 is open for discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants