1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-11-05 01:30:25 +01:00
minetest_game/mods/default/player.lua
MirceaKitsune 0057a87b99 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
2012-11-25 21:02:00 +02:00

29 lines
712 B
Lua

-- 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