1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-30 13:50:23 +02:00

Add script to turn players into meshes, ticks every 1 second

Trigger the player.lua file in init.lua

Commit the ugly and temporary test model and texture. We'll get to a real animated player mesh once the code for that is ready

Set visual_size accordingly so the player model doesn't stretch vertically (default of the sprite player)

Attempt to use the b3d model format, although it doesn't seem to work so far
This commit is contained in:
MirceaKitsune
2012-10-24 15:23:45 +03:00
committed by Perttu Ahola
parent dfa0f096ce
commit 0057a87b99
6 changed files with 147 additions and 0 deletions

28
mods/default/player.lua Normal file
View File

@ -0,0 +1,28 @@
-- Minetest 0.4 mod: player
-- See README.txt for licensing and other information.
-- The API documentation in here was moved into doc/lua_api.txt
-- Set mesh for all players
function switch_player_visual()
prop = {
mesh="player.b3d",
textures = {"player.png", },
visual="mesh",
visual_size={x=1, y=1},
}
for _, obj in pairs(minetest.get_connected_players()) do
obj:set_properties(prop)
end
minetest.after(1.0, switch_player_visual)
end
minetest.after(1.0, switch_player_visual)
-- Definitions made by this mod that other mods can use too
default = {}
-- Load other files
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/leafdecay.lua")
-- END