Page 1 of 2

[clothing] Clothing Mod

PostPosted: Mon Mar 10, 2014 19:57
by tinoesroho
[b]This mod is outdated[/b]
This mod is outdated and is only available for historical purposes.

Please use stu's Clothing [Clothing] mod. Stu's mod is a complete implementation, and at the moment, has 16 colors of capes, shirts, and pants. Honestly, go download stu's Clothing [Clothing] mod today!


[s]
WARNING: THIS MOD IS INCOMPLETE

For Designers

How You Can Help
  • Color Images
    We need more overlays for Pants and Shirts.
    Currently have 3/15 main colors:
    Blue, White, Red, Yellow
    Image
    Image
    Image
    Image
  • More Images
    We need Dresses or Skirts. Even just a plain White-colored file will do.
  • Fix image combination
    The code to overlay a color is broken. Please help!


Why Clothing?
Skins.

In my opinion, skins should never be used to show off clothing. No, skin is for selecting the base of your character: gender and skin color.

For character customization, mods are key. Mods like 3D-Armor (by Stu), Hair, Jewellery and Clothing exist. Or should, right?

Introducing Clothing!
Shirts!
Pants

Planned Features
* More colors
4 colors is much too low. How about 16?

* More materials
Furs, leathers - animals mod could be more useful.

* Dedicated weaving table
Crafting sucks.

* Hats
Headgear is cool. Hats could spice up the game, plus... you could always sell them.

* Shoes
Shoeless joe is pretty cool. Actual shoes would be nice.

* Capes
It's a bird. It's a plane. No, it's Super Guest_2999! Capes would add desired flair, and would be worn atop armor - if any.

License:
WTFPL

Download:
To be uploaded later[/s]

PostPosted: Mon Mar 10, 2014 22:24
by Inocudom
What about dresses? Some players might find them to be useful.

The layer that is used by the clothes should probably be thinner than what the armor mod uses.

PostPosted: Mon Mar 10, 2014 22:57
by tinoesroho
Inocudom wrote:What about dresses? Some players might find them to be useful.


Right! And Robes-

- well, I know how I'm spending my evening.

PostPosted: Tue Mar 11, 2014 02:00
by jenova99sephiros
Unified Dyes!

PostPosted: Tue Mar 11, 2014 05:32
by 4aiman
@ Tinoesroho: Wanna check my capes prototype? It uses entities which are synchronized with the player "wearing" them. This way one can make a wardrobe with clothes that can be right-clicked to put on. Also this way anyone would be able to easy add any type of clothing :)

PostPosted: Wed Mar 12, 2014 00:07
by Inocudom
Considering your first post, hair, hats, and jewelry should be mods as well. Think of the customization possibilities.

Err, why isn't this mod getting more attention? Would it help if screenshots were posted?

PostPosted: Wed Mar 12, 2014 05:14
by 4aiman
Having screenshots would be great :)

PostPosted: Wed Mar 12, 2014 13:27
by rubenwardy
This looks really good.

Well done!

edit: Have you forgot the dofile to clothing.lua?

PostPosted: Wed Mar 12, 2014 15:28
by tinoesroho
jenova99sephiros wrote:Unified Dyes!

@jenova99sephiros: Unified Dyes support is a must-have. I'll do my best.

Inocudom wrote:Err, why isn't this mod getting more attention? Would it help if screenshots were posted?


@Inocudom: Eh. It isn't quite finished yet.

Rubenwardy wrote:This looks really good.
Well done!
edit: Have you forgot the dofile to clothing.lua?

@Rubenwardy: Probably. It's quite unfinished and unpolished at the moment.

4aiman wrote:@ Tinoesroho: Wanna check my capes prototype? It uses entities which are synchronized with the player "wearing" them. This way one can make a wardrobe with clothes that can be right-clicked to put on. Also this way anyone would be able to easy add any type of clothing :)

@4aiman: Screenshots would be nice to have. I'm currently sketching out the next big update on paper - with a pattern table, an automatic loom, and a way to spin thread.

Do you have the capes code uploaded?

PostPosted: Wed Mar 12, 2014 18:28
by tinoesroho
Scribblings:
Could I combine crafter with workers:builder to make a sewing crafter?
The idea being, give table pattern and raw materials, and it would make from pattern.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("workers:builder", {
    description = "Benjo The Builder",
    tile_images = worker_images("benjo"),
    stack_max = 1,
    paramtype2 = "facedir",
    groups = {oddly_breakable_by_hand=2,flammable=1,worker=1},
    legacy_facedir_simple = true,
   
    after_place_node = function(pos,player)
        local meta = minetest.env:get_meta(pos)
        meta:set_string("formspec",
                        "invsize[8,6;]"..
                        "list[current_player;main;0,2;8,4;]"..
                        "list[current_name;plan;2,0;1,1;]"..
                        "list[current_name;material;5,0;1,1;]"..
                        "image[6,0;1,1;default_brick.png]")
        local inv = meta:get_inventory()
        inv:set_size("plan", 1)
        inv:set_size("material", 1)
        meta:set_string("infotext", "I can build simple structures, Master")
        meta:set_string("master",player:get_player_name())
        meta:set_int("start_work",0)
        minetest.chat_send_player(player:get_player_name(), "Benjo: Hello, Master.")
    end,
   
    on_punch = function(pos, node, player)
        local meta = minetest.env:get_meta(pos)
        local inv = meta:get_inventory()
        local master = meta:get_string("master")
        if player:get_player_name() ~= master then
            defend(player,master,"Benjo")
            return
        end
       
        if inv:is_empty("plan") or inv:is_empty("material") then return end
       
        if meta:get_int("start_work") == 0 then --if Benjo hasn't moved yet
            meta:set_int("start_work",1)
            minetest.chat_send_player(master, "Benjo: Right away, Master.")
        end
    end,
   
    can_dig = function(pos,player)
        local meta = minetest.env:get_meta(pos)
        local master = meta:get_string("master")
        local inv = meta:get_inventory()
        if not (inv:is_empty("plan")) and not (inv:is_empty("material")) then
            minetest.chat_send_player(master, "Benjo: I cannot leave yet, Master. There are items in my inventory.")
            return false
        end
        minetest.chat_send_player(master, "Benjo: Pleasure to work for you, Master.")
        return true
    end,
})

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
--[[

A simple crafter for Minetest

Made by pandaro
License: GPLv3

a block and a entity

thanks to:
cornernote for inspiration code
PilzAdam for any suggestions
"all" patience

]]--


-- expose api
crafter = {}

-- table of non playing characters
crafter.npc = {}
crafter.chest={}

--definition of crafter chest
minetest.register_node("crafter:crafter_chest", {
    description = "crafter chest",
    tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
        "default_chest_side.png", "default_chest_side.png", "villager_crafter_chest_front.png"},
    paramtype2 = "facedir",
    groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
    legacy_facedir_simple = true,
    sounds = default.node_sound_wood_defaults(),

    on_construct=function(pos)
        local k = pos.x..","..pos.y..","..pos.z
   
        crafter.npc[k] =minetest.env:add_entity({x=pos.x,y=pos.y+1.5,z=pos.z},"crafter:crafter")--add crafter
        crafter.chest[k] =minetest.env:get_meta(pos)--give metainf
        crafter.chest[k]:set_string("formspec",
                "size[12,12]"..
                "list[current_name;necessary;0,0;2,4;]"..
                "list[current_name;crafting_table;3,0;3,3;]"..
               
                "list[current_name;crafted;7,0;2,4;]"..
                "list[current_player;main;0,5;8,4;]")
        crafter.chest[k]:set_string("infotext", "crafter chest")
        local inv = crafter.chest[k]:get_inventory()--give inventory
        inv:set_size("necessary", 2*4)
        inv:set_size("crafting_table", 3*3)
        inv:set_size("crafted",2*4)
       
        crafter.npc[k]:get_luaentity().code=k--give a name
        crafter.npc[k]:get_luaentity().cesto=pos--give a reference to the chest
        crafter.npc[k]:get_luaentity().zione="crafter"
        crafter.npc[k]:get_luaentity().inv=inv       
        crafter.npc[k]:get_luaentity()
        nodeupdate(pos)
       
    end,

    on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff in chest at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_put = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff to chest at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_take = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " takes stuff from chest at "..minetest.pos_to_string(pos))
    end
})


--Definition of crafter
minetest.register_entity("crafter:crafter",{
    hp_max = 5,
    physical = true,
    weight = 5,
    collisionbox = {-0.4, -1, -0.4, 0.4, 1, 0.4},
    visual = "upright_sprite",
    visual_size = {x=1, y=2},
    textures = {"villager_crafter_npc_sprite_front.png", "villager_crafter_npc_sprite_back.png"},
    spritediv = {x=1, y=1},
    initial_sprite_basepos = {x=0, y=0},
    is_visible = true,
    makes_footstep_sound = false,
    automatic_rotate = false,


    get_staticdata = function(self)--save necessary informations
        return minetest.serialize({
            code = self.code,
            cesto=self.cesto,
            zione=self.zione,
        })
    end,
 
    on_activate=function(self,staticdata)--load necessary informations
        local data = minetest.deserialize(staticdata)
        if data and data.code then
            local k = data.code
            crafter.npc[k] = self.object
            self.code = data.code
            self.cesto = data.cesto
            self.zione = data.zione           
            crafter.npc[self.code]:get_luaentity()
            crafter.chest[self.code]= (minetest.env:get_meta(self.cesto))           
            self.inv=crafter.inv(self)           
        end   
    end,
           
    on_step=function(self,dtime)
        if math.random(1,100)==1 then
            crafter.crafting(self,{{name="default:cobble",count=2},{name="default:stick",count=1}},{name="default:sword_stone",count=1})
            crafter.crafting(self,{{name="default:wood",count=2},{name="default:stick",count=1}},{name="default:sword_wood",count=1})
            crafter.crafting(self,{{name="default:steel_ingot",count=2},{name="default:stick",count=1}},{name="default:sword_steel",count=1})
        end
    end,
})

crafter.inv=function(self)
    local inv=crafter.chest[self.code]:get_inventory()
    return inv
end

crafter.crafting=function(self,needed,output)
    local canbuild=1
    for i,v in pairs (needed) do
        if self.inv:contains_item("necessary",v) then
        else
            canbuild=0
            break
        end
    end
    if canbuild==1 then
        for i,v in pairs (needed) do
            self.inv:remove_item("necessary",v)
        end
        self.inv:add_item("crafted",output)
    end       
end

-- log that we started
minetest.log("action", "[MOD]"..minetest.get_current_modname().." -- loaded from "..minetest.get_modpath(minetest.get_current_modname()))

PostPosted: Wed Mar 12, 2014 19:03
by tinoesroho
Design Documents:
== Pattern Crafting Table ==

[_][_][_][_][_][_]
[_][_][_][_][_][_]
[_][_][_][_][_][_]
[_][_][_][_][_][_]
[_][_][_][_][_][_]
[_][_][_][_][_][_]

== Spinning thread ==

Wool:
[_]

Thread:
[_]

== Making a pattern ==
1. Craft Paper into paper parts (Paper+Thread(any)=Paper Parts 4)
2. Place on table like this:

# = blank
--- Shirt ---
#PP##
PPPP#
#PP##
#PP##

--- Pants ---

PPP
P#P
P#P

--- Hoodie ---

#PP##
#PP##
PPPP#
#PP##
#PP##

--- Dress ---
#PP##
PPPP#
#PP##
#PP##
PPP##


== Sewing the pattern ==
Loom:

Pattern: [_]
Material: [_][_][_][_]
Output: [_][_][_][_]

== Robes as separate mod ==
Robes should go above worn clothing and armor, and thus should be split into own mod.
Robes should occupy a single slot.
Should be a single texture.

=== Does this make this a modpack? ===
Why not?

We should add a hairstyles sub-project, and a jewellery project.

PostPosted: Wed Mar 12, 2014 19:48
by tinoesroho
*bump*

Topic updated with templates, what you can do, and other notes.

PostPosted: Thu Mar 13, 2014 02:07
by Inocudom
It would help if you posted this mod on GitHub. That way, people could help you out more.

PostPosted: Thu Mar 13, 2014 06:46
by 4aiman
@ tinoesroho:
I haven't got the download link ATM. But you can look at the code and decide whether it suits your purpose.
[spoiler]
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
default_model = "helmet.x"
--
-- Start of configuration area:
--

-- Player animation speed
animation_speed = 30

-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
animation_blend = 0

-- Frame ranges for each player model
function armour_get_animations(model)

        return {
        stand_START = 0,
        stand_END = 79,
        sit_START = 81,
        sit_END = 160,
        lay_START = 162,
        lay_END = 166,
        walk_START = 168,
        walk_END = 187,
        mine_START = 189,
        mine_END = 198,
        walk_mine_START = 200,
        walk_mine_END = 219
        }

end


-- Player stats and animations
local player_model = {}
local player_anim = {}
local player_sneak = {}
local ANIM_STAND = 1
local ANIM_SIT = 2
local ANIM_LAY = 3
local ANIM_WALK  = 4
local ANIM_WALK_MINE = 5
local ANIM_MINE = 6


-- Update appearance when the player joins
-- minetest.register_on_joinplayer(ar_update_visuals)



local ar = {
    physical = false,
    collisionbox = {-0.5,-1,-0.5, 0.5,1,0.5},
    visual = "mesh",
    mesh = "helmet.x",
    textures = {"ar.png"},
    visual_size = {x=1, y=1, z = 1},
    wielder = nil,
    v = 0,
    animation_speed = 30,
    animation_blend = 0,
    animation = ANIM_STAND,
}


function ar:on_rightclick(clicker)
    if not clicker or not clicker:is_player() then
        return
    end
    --if self.wielder and clicker == self.wielder then
---        self.wielder = nil
    --    clicker:set_detach()
--    elseif not self.driver then
        self.wielder = clicker
        -- self.object:set_attach(self.wielder, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
        self.object:setyaw(self.wielder:get_look_yaw())
           
      --  minetest.chat_send_all(self.mesh)
        local anim = armour_get_animations(self.mesh)
        self.object:set_animation({x=anim.stand_START, y=anim.stand_STOP}, 30, 0)

--    end
end

function ar:on_step(dtime)
  local wielder = self.wielder
  if wielder == nil then
     return
  end
--  local name = wielder:get_player_name()
--  if name ~=nil then
 
        local controls = wielder:get_player_control()
        local walking = false
        local animation_speed_mod = animation_speed
        local anim = armour_get_animations(self.mesh)


        if controls.up
        or controls.down
        or controls.left
        or controls.right
        then
            walking = true
        end

       
        if  controls.sneak
        and wielder:get_hp() ~= 0
        and (walking or controls.LMB)
        then
            animation_speed_mod = animation_speed_mod / 2                   
        else
            animation_speed_mod = animation_speed_mod * 2       
        end



        if wielder:get_hp() == 0 then
           if self.animation ~= ANIM_LAY then
              self.object:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_LAY
           end
           
        elseif walking and controls.LMB then
           if self.animation ~= ANIM_WALK_MINE then
              self.object:set_animation({x=anim.walk_mine_START, y=anim.walk_mine_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_WALK_MINE
           end
           
        elseif walking then
           if self.animation ~= ANIM_WALK then
              self.object:set_animation({x=anim.walk_START, y=anim.walk_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_WALK
           end
           
        elseif controls.LMB then
           if self.animation ~= ANIM_MINE then
              self.object:set_animation({x=anim.mine_START, y=anim.mine_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_MINE
           end
           
        else
           if self.animation ~= ANIM_STAND then
              self.object:set_animation({x=anim.stand_START, y=anim.stand_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_STAND
           end
           
        end


end

minetest.register_entity("capes:ar", ar)


minetest.register_craftitem("capes:helmet", {
    description = "Cape",
    inventory_image = "ar.png",
    wield_image = "ar.png",
    wield_scale = {x=2, y=2, z=1},
    liquids_pointable = true,
    on_place = function(itemstack, placer, pointed_thing)
        if pointed_thing.type ~= "node" then
            return
        end
        local arm = minetest.env:add_entity(pointed_thing.above, "capes:ar")
        local prop = {mesh = "helmet.x",    }
        arm:set_properties(prop)
        itemstack:take_item()
        return itemstack
    end,
})


minetest.register_craftitem("capes:char", {
    description = "Cape",
    inventory_image = "ar.png",
    wield_image = "ar.png",
    wield_scale = {x=2, y=2, z=1},
    liquids_pointable = true,

    on_place = function(itemstack, placer, pointed_thing)
        if pointed_thing.type ~= "node" then
            return
        end
        local arm = minetest.env:add_entity(pointed_thing.above, "capes:ar")
        local prop = {mesh = "character.x",    }
        arm:set_properties(prop)
        itemstack:take_item()
        return itemstack
    end,
})
[/spoiler]

I'll try to find where did I put sources + textures + models and will make a link.

Edit: those patterns look like realtest's blueprints :)

PostPosted: Thu Mar 13, 2014 18:31
by tinoesroho
4aiman wrote:@ tinoesroho:
I haven't got the download link ATM. But you can look at the code and decide whether it suits your purpose.

I'll try to find where did I put sources + textures + models and will make a link.

Edit: those patterns look like realtest's blueprints :)


The code looks pretty good. You have github? Maybe tonight I'll throw my code on GitHub and open it up to take patches.

It's going to be a fork-fest; I'll be forking Stu's 3d Armor for integration as per the design document. Probably will fork Zeg9's Skins mod as well.

== Interface ==
=== From Default Craft Screen ===
[Back]

[_][_][_] [_]
[_][_][_]
[_][_][_]

[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
=== Inventory Plus ===
[Character][Crafting]

[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
[_][_][_][_][_][_][_][_]
=== Character Screen ===
[Back]

[Skin]
[Clothing]
[Armor]
[Capes]
[Jewellery]

... etc etc. I'll see what I can do when I get home.

PostPosted: Fri Mar 14, 2014 03:04
by tinoesroho
Uploaded to Github.

PostPosted: Fri Mar 14, 2014 06:05
by 4aiman
Here's a link to capes on github: https://github.com/4aiman/capes
*Still haven't found where did I put textures & meshes*

PostPosted: Fri Mar 14, 2014 18:23
by tinoesroho
I wonder what happens when I layer overlays on top of eachother. Will I get purple? That might be easier than creating separate files for each color.

PostPosted: Fri Mar 21, 2014 15:49
by Inocudom
How is progress on this mod?

PostPosted: Fri Mar 21, 2014 17:21
by rubenwardy
The title of this thread should be:

[Mod] Clothing Mod [clothing]


or:

[Mod] Clothing Mod [1.2] [clothing]

where 1.2 is the version number.

PostPosted: Fri Mar 21, 2014 19:12
by 4aiman
There are no rules for naming, just the common practice :)

PostPosted: Fri Mar 21, 2014 19:58
by rubenwardy
4aiman wrote:There are no rules for naming, just the common practice :)


Actually, there is.

https://forum.minetest.net/viewtopic.php?id=1271

PostPosted: Fri Mar 21, 2014 20:23
by rubenwardy
I have made a pull request for this mod:

https://github.com/alexrider/Player_Customization/pull/1

PostPosted: Sat Mar 22, 2014 10:10
by jenova99sephiros
Please "noncolor" texture
It is necessary to define a template

PostPosted: Sat Mar 22, 2014 10:59
by 4aiman
rubenwardy wrote:Actually, there is.

Actually, those are for releases ;)

Also, nothing wrong here, 'cause this would contain parts of 3d_armor and many more mods.
That means this can be considered as a modpack.
And for those we have this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
[Modpack] The Awesome Modpack


To sum it up: when released then maybe this should be renamed. For now there's no reason - it's just a topic amongst other topics. Some of the latter has even weirder titles like "Ahhhh!!! HeLuP Me PuLEASe, DuDeS!!!"

PostPosted: Sat Mar 22, 2014 18:48
by rubenwardy
Mods which use modpack structures can still be called [Mod].

For example, Mesecons.

The guideline is, if the mods are similar then it can be counted as a single mod.

If you do decide to include 3d armor, then [Modpack] would be best.

I don't recommend including it, unless you have changed the source code.

PostPosted: Sat Mar 22, 2014 20:09
by 4aiman
If smth can be in some state it doesn't mean it's necessary for that thing to be in that particular state...
When released, this mod's thread definitely should be renamed.Bot as long as it's here, we're arguing about nothing. So I'm quitting before this would go any further.

PostPosted: Sun Mar 23, 2014 00:43
by tinoesroho
Merged pull request from rubenwardy.

Re: [clothing] Clothing Mod

PostPosted: Sun Apr 27, 2014 22:21
by Inocudom
This mod has so much potential. Too bad the community forgot about it. Is it even worked on anymore?

Re: [clothing] Clothing Mod

PostPosted: Mon Apr 28, 2014 20:25
by tinoesroho
Not really. I did some tweaking here and there, but I have some work to do to get it up to speed with the latest 3d_armor updates. Unless I corner stu for a chit-chat, I'll be teaching myself code and then attempt to recode using the latest 3d_armor api.

EDIT:
Stu left a sixth slot in his armor mod, which could be used by a Capes mod. I don't have any unique textures or code, so I probably won't make that happen.