Merge pull request #15 from Wuzzy2/newplayermodel
Update player model, use seperate mod for it
This commit is contained in:
commit
87bbbbe0d0
@ -1 +1,2 @@
|
||||
default
|
||||
playermodel
|
||||
|
@ -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
|
||||
|
@ -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
31
mods/playermodel/README.txt
Normal file
31
mods/playermodel/README.txt
Normal 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)
|
0
mods/playermodel/depends.txt
Normal file
0
mods/playermodel/depends.txt
Normal file
1
mods/playermodel/description.txt
Normal file
1
mods/playermodel/description.txt
Normal file
@ -0,0 +1 @@
|
||||
A basic 3D player model with a basic API.
|
5
mods/playermodel/init.lua
Normal file
5
mods/playermodel/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
if default == nil then
|
||||
default = {}
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath("playermodel").."/player.lua")
|
BIN
mods/playermodel/models/character.blend
Normal file
BIN
mods/playermodel/models/character.blend
Normal file
Binary file not shown.
BIN
mods/playermodel/models/character.png
Normal file
BIN
mods/playermodel/models/character.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
7457
mods/playermodel/models/character.x
Normal file
7457
mods/playermodel/models/character.x
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
|
BIN
mods/playermodel/screenshot.png
Normal file
BIN
mods/playermodel/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/playermodel/textures/playermodel_dummy_back.png
Normal file
BIN
mods/playermodel/textures/playermodel_dummy_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 864 B |
BIN
mods/playermodel/textures/playermodel_dummy_front.png
Normal file
BIN
mods/playermodel/textures/playermodel_dummy_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 982 B |
Loading…
x
Reference in New Issue
Block a user