Merge pull request #15 from Wuzzy2/newplayermodel

Update player model, use seperate mod for it
This commit is contained in:
GunshipPenguin 2015-06-06 22:20:36 -07:00
commit 87bbbbe0d0
17 changed files with 7511 additions and 6570 deletions

View File

@ -1 +1,2 @@
default
playermodel

View File

@ -88,12 +88,6 @@ Calinou (CC BY-SA):
default_copper_lump.png
default_mineral_copper.png
MirceaKitsune (WTFPL):
character.x
Jordach (CC BY-SA 3.0):
character.png
PilzAdam (WTFPL):
default_jungleleaves.png
default_junglesapling.png

View File

@ -9,11 +9,19 @@ LAVA_VISC = 7
LIGHT_MAX = 14
-- Definitions made by this mod that other mods can use too
default = {}
if default == nil then
default = {}
end
default.inventory_background = "background[0,0;9,8;default_inventory_background.png;true]"
default.inventory_listcolors = "listcolors[#8E6C3C;#EEAF6B;#683E12;#CA7700;#FFFFFF]"
-- Update appearance when the player joins
minetest.register_on_joinplayer(function(player)
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
end)
-- Load files
dofile(minetest.get_modpath("default").."/functions.lua")
dofile(minetest.get_modpath("default").."/nodes.lua")
@ -21,5 +29,4 @@ dofile(minetest.get_modpath("default").."/tools.lua")
dofile(minetest.get_modpath("default").."/craftitems.lua")
dofile(minetest.get_modpath("default").."/crafting.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
Minetest 0.4 mod: Player Model [playermodel]
============================================
Version: 1.1.0
License of source code:
-----------------------
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
MirceaKitsune (WTFPL):
character.x
Jordach (CC BY-SA 3.0):
character.png
Wuzzy (CC BY-SA 3.0)
playermodel_dummy_front.png (derivate work of character.png)
playermodel_dummy_back.png (derivate work of character.png)

View File

View File

@ -0,0 +1 @@
A basic 3D player model with a basic API.

View File

@ -0,0 +1,5 @@
if default == nil then
default = {}
end
dofile(minetest.get_modpath("playermodel").."/player.lua")

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
-- Minetest 0.4 mod: player
-- Minetest 0.4 mod: Player Model [playermodel]
-- See README.txt for licensing and other information.
--[[
@ -84,6 +84,7 @@ local player_model = {}
local player_textures = {}
local player_anim = {}
local player_sneak = {}
default.player_attached = {}
function default.player_get_animation(player)
local name = player:get_player_name()
@ -111,7 +112,7 @@ function default.player_set_model(player, model_name)
default.player_set_animation(player, "stand")
else
player:set_properties({
textures = { "player.png", "player_back.png", },
textures = { "playermodel_dummy_front.png", "playermodel_dummy_back.png", },
visual = "upright_sprite",
})
end
@ -140,9 +141,10 @@ end
-- Update appearance when the player joins
minetest.register_on_joinplayer(function(player)
default.player_attached[player:get_player_name()] = false
default.player_set_model(player, "character.x")
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=4, z=0})
end)
minetest.register_on_leaveplayer(function(player)
@ -161,7 +163,7 @@ minetest.register_globalstep(function(dtime)
local name = player:get_player_name()
local model_name = player_model[name]
local model = model_name and models[model_name]
if model then
if model and not default.player_attached[name] then
local controls = player:get_player_control()
local walking = false
local animation_speed_mod = model.animation_speed or 30

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B