Code improvements and updated dwarf model.
parent
0fe1b02617
commit
b3da61ab4e
|
@ -73,35 +73,35 @@ classes:load()
|
|||
|
||||
minetest.register_privilege("class", "Player can change class.")
|
||||
|
||||
minetest.register_on_chat_message(function(name, message)
|
||||
local args = string.split(message, " ", 2)
|
||||
if args[1] == "/class" then
|
||||
if not args[2] then
|
||||
minetest.register_chatcommand("class", {
|
||||
params = "[class]",
|
||||
description = "Change or view character class.",
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name, "Current character class: "..classes.class[name])
|
||||
return true
|
||||
return
|
||||
end
|
||||
if not minetest.check_player_privs(name, {class=true}) then
|
||||
minetest.chat_send_player(name, "Changing class requires the 'class' privilege!")
|
||||
return true
|
||||
return
|
||||
end
|
||||
if not classes.mesh[args[2]] then
|
||||
if not classes.mesh[param] then
|
||||
local valid = ""
|
||||
for k,_ in pairs(classes.mesh) do
|
||||
valid = valid.." "..k
|
||||
end
|
||||
minetest.chat_send_player(name, "Invalid class '"..args[2].."', choose from:"..valid)
|
||||
return true
|
||||
minetest.chat_send_player(name, "Invalid class '"..param.."', choose from:"..valid)
|
||||
return
|
||||
end
|
||||
if classes.class[name] == args[2] then
|
||||
return true
|
||||
if classes.class[name] == param then
|
||||
return
|
||||
end
|
||||
classes.class[name] = args[2]
|
||||
classes.class[name] = param
|
||||
classes:save()
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
classes:update_character_mesh(player)
|
||||
return true
|
||||
end
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
|
|
|
@ -740,62 +740,6 @@ Frame Root {
|
|||
3;
|
||||
6;
|
||||
}
|
||||
SkinWeights {
|
||||
"Armature_Arm_Right";
|
||||
24;
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
112,
|
||||
113,
|
||||
114,
|
||||
115,
|
||||
120,
|
||||
121,
|
||||
122,
|
||||
123,
|
||||
128,
|
||||
129,
|
||||
130,
|
||||
131,
|
||||
136,
|
||||
137,
|
||||
138,
|
||||
139;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.889652, 0.133878, 0.024430, 0.000000,
|
||||
-0.024705,-0.000000, 0.899661, 0.000000,
|
||||
0.133828,-0.889987, 0.003675, 0.000000,
|
||||
-3.707526,11.210880,-0.101809, 1.000000;;
|
||||
} //End of Armature_Arm_Right Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Body";
|
||||
24;
|
||||
|
@ -852,118 +796,6 @@ Frame Root {
|
|||
0.000000, 0.900000, 0.000000, 0.000000,
|
||||
0.000000,-5.115126,-0.000000, 1.000000;;
|
||||
} //End of Armature_Body Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Leg_Right";
|
||||
24;
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
80,
|
||||
81,
|
||||
82,
|
||||
83,
|
||||
88,
|
||||
89,
|
||||
90,
|
||||
91,
|
||||
124,
|
||||
125,
|
||||
126,
|
||||
127,
|
||||
140,
|
||||
141,
|
||||
142,
|
||||
143;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.900000,-0.000000,-0.000000, 0.000000,
|
||||
0.000000, 0.000000, 0.900000, 0.000000,
|
||||
-0.000000,-0.900000, 0.000000, 0.000000,
|
||||
-1.000000, 5.115126,-0.000001, 1.000000;;
|
||||
} //End of Armature_Leg_Right Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Leg_Left";
|
||||
24;
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
84,
|
||||
85,
|
||||
86,
|
||||
87,
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
103;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.900000,-0.000000,-0.000000, 0.000000,
|
||||
0.000000, 0.000000, 0.900000, 0.000000,
|
||||
-0.000000,-0.900000, 0.000000, 0.000000,
|
||||
1.000000, 5.115126,-0.000001, 1.000000;;
|
||||
} //End of Armature_Leg_Left Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Head";
|
||||
48;
|
||||
|
@ -1124,6 +956,174 @@ Frame Root {
|
|||
-0.133828,-0.889987, 0.003675, 0.000000,
|
||||
3.707526,11.210880,-0.101809, 1.000000;;
|
||||
} //End of Armature_Arm_Left Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Arm_Right";
|
||||
24;
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
112,
|
||||
113,
|
||||
114,
|
||||
115,
|
||||
120,
|
||||
121,
|
||||
122,
|
||||
123,
|
||||
128,
|
||||
129,
|
||||
130,
|
||||
131,
|
||||
136,
|
||||
137,
|
||||
138,
|
||||
139;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.889652, 0.133878, 0.024430, 0.000000,
|
||||
-0.024705,-0.000000, 0.899661, 0.000000,
|
||||
0.133828,-0.889987, 0.003675, 0.000000,
|
||||
-3.707526,11.210880,-0.101809, 1.000000;;
|
||||
} //End of Armature_Arm_Right Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Leg_Right";
|
||||
24;
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
80,
|
||||
81,
|
||||
82,
|
||||
83,
|
||||
88,
|
||||
89,
|
||||
90,
|
||||
91,
|
||||
124,
|
||||
125,
|
||||
126,
|
||||
127,
|
||||
140,
|
||||
141,
|
||||
142,
|
||||
143;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.900000,-0.000000,-0.000000, 0.000000,
|
||||
0.000000, 0.000000, 0.900000, 0.000000,
|
||||
-0.000000,-0.900000, 0.000000, 0.000000,
|
||||
-1.000000, 5.115126,-0.000001, 1.000000;;
|
||||
} //End of Armature_Leg_Right Skin Weights
|
||||
SkinWeights {
|
||||
"Armature_Leg_Left";
|
||||
24;
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
84,
|
||||
85,
|
||||
86,
|
||||
87,
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
103;
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000,
|
||||
1.000000;
|
||||
0.900000,-0.000000,-0.000000, 0.000000,
|
||||
0.000000, 0.000000, 0.900000, 0.000000,
|
||||
-0.000000,-0.900000, 0.000000, 0.000000,
|
||||
1.000000, 5.115126,-0.000001, 1.000000;;
|
||||
} //End of Armature_Leg_Left Skin Weights
|
||||
} //End of Mesh Mesh
|
||||
} //End of Player
|
||||
} //End of Armature
|
||||
|
|
Loading…
Reference in New Issue