diff --git a/add_skins_and_capes.lua b/add_skins_and_capes.lua index de96dc3..3c2f3fb 100644 --- a/add_skins_and_capes.lua +++ b/add_skins_and_capes.lua @@ -67,6 +67,10 @@ end npc_talk.add_skins_from_skinsdb = function(mob_name_string) + if(not(yl_speak_up.mob_skins[mob_name_string]) + or(#yl_speak_up.mob_skins[mob_name_string] < 1)) then + yl_speak_up.mob_skins[mob_name_string] = {"character.png"} + end -- read skins from skinsdb if(not(minetest.get_modpath("skinsdb"))) then return diff --git a/example_npc.lua b/example_npc.lua index 7a9a3c7..29d08d6 100644 --- a/example_npc.lua +++ b/example_npc.lua @@ -1,5 +1,17 @@ npc_talk.register_example_npc = function() + local mesh = npc_talk.talking_npc_mesh + local textures = {npc_talk.talking_npc_texture} + if(minetest.get_modpath("skinsdb")) then + mesh = "skinsdb_3d_armor_character_5.b3d" + -- this mesh has a diffrent texture setup as well + textures = {{ + "blank.png", -- cape? + "npc_talk_default_skin.png", -- 64x64 skin + "3d_armor_trans.png", -- shield?! + "3d_armor_trans.png", -- item right hand + }} + end -- register the new mob mobs:register_mob("npc_talk:npc", { type = "npc", @@ -16,15 +28,9 @@ npc_talk.register_example_npc = function() collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, visual = "mesh", visual_size = {x = 1, y = 1}, - -- TODO: mesh, textures - mesh = "skinsdb_3d_armor_character_5.b3d", + mesh = mesh, drawtype = "front", - textures = {{ - "blank.png", -- cape? - "yl_speak_up_main_default.png", -- 64x64 skin - "3d_armor_trans.png", -- shield?! - "3d_armor_trans.png", -- item right hand - }}, + textures = textures, makes_footstep_sound = true, sounds = {}, walk_velocity = 2,