b3d, you have failed me. x model format, you're in
Entries for the newly added animation features Update player script to work with the latest code Add a test case for attachments. A LUA entity is attached to the player with a specified name 10 seconds after the server starts Add a detachment test case (5 seconds after attaching) Update function names, plus add a test case for both player to player and lua-entity to player attachments
This commit is contained in:
parent
0057a87b99
commit
24781813fa
5 changed files with 8053 additions and 121 deletions
|
@ -6,18 +6,80 @@
|
|||
-- Set mesh for all players
|
||||
function switch_player_visual()
|
||||
prop = {
|
||||
mesh="player.b3d",
|
||||
mesh = "player.x",
|
||||
textures = {"player.png", },
|
||||
visual="mesh",
|
||||
visual_size={x=1, y=1},
|
||||
colors = {{255, 255, 255, 255}, },
|
||||
visual = "mesh",
|
||||
visual_size = {x=1, y=1},
|
||||
}
|
||||
|
||||
for _, obj in pairs(minetest.get_connected_players()) do
|
||||
obj:set_properties(prop)
|
||||
obj:set_animation({x=1, y=50}, 35, 0)
|
||||
--obj:set_bone_position("", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
||||
end
|
||||
|
||||
minetest.after(1.0, switch_player_visual)
|
||||
end
|
||||
minetest.after(1.0, switch_player_visual)
|
||||
|
||||
-- Test case for attachments: An object is spawned and attached to the player with the specified name (use your own playername there) 10 seconds after the server starts
|
||||
|
||||
test2 = {
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
visual = "cube"
|
||||
}
|
||||
|
||||
minetest.register_entity("default:test2", test2)
|
||||
|
||||
function detachments(newobject)
|
||||
newobject:set_detach()
|
||||
print ("Detached test object")
|
||||
end
|
||||
|
||||
function attachments()
|
||||
prop = {
|
||||
mesh = "player.x",
|
||||
textures = {"player.png", },
|
||||
colors = {{255, 255, 255, 255}, },
|
||||
visual = "mesh",
|
||||
visual_size = {x=1, y=1},
|
||||
}
|
||||
|
||||
local pos={x=0,y=0,z=0}
|
||||
local newobject=minetest.env:add_entity(pos, "test:test2")
|
||||
newobject:set_properties(prop)
|
||||
newobject:set_animation({x=1, y=50}, 35, 0)
|
||||
print ("Spawned test object")
|
||||
|
||||
for _, obj in pairs(minetest.get_connected_players()) do
|
||||
if(obj:get_player_name() == "MirceaKitsune") then
|
||||
newobject:set_attach(obj, "Bone.001", {x=0,y=3,z=0}, {x=0,y=45,z=0})
|
||||
print ("Attached test object to "..obj:get_player_name())
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(5.0, function() detachments(newobject) end)
|
||||
end
|
||||
minetest.after(15.0, attachments)]]
|
||||
|
||||
-- Test case for player to player attachments
|
||||
|
||||
function attachments_player()
|
||||
for _, obj in pairs(minetest.get_connected_players()) do
|
||||
if(obj:get_player_name() == "MirceaKitsune") then
|
||||
for _, obj2 in pairs(minetest.get_connected_players()) do
|
||||
if(obj2:get_player_name() == "MirceaKitsune1") then
|
||||
obj2:set_attach(obj, "Bone.001", {x=0,y=6,z=0}, {x=0,y=45,z=0})
|
||||
print ("Attached player "..obj2:get_player_name().." to player "..obj:get_player_name())
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(10.0, attachments_player)
|
||||
|
||||
-- Definitions made by this mod that other mods can use too
|
||||
default = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue