From 0057a87b99d2034733da1546fb34ae0e99daf3db Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Wed, 24 Oct 2012 15:23:45 +0300 Subject: [PATCH] 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 --- mods/default/init.lua | 1 + mods/default/models/player.b3d | Bin 0 -> 9067 bytes mods/default/models/player.mtl | 12 ++++ mods/default/models/player.obj | 106 +++++++++++++++++++++++++++++++++ mods/default/models/player.png | Bin 0 -> 203 bytes mods/default/player.lua | 28 +++++++++ 6 files changed, 147 insertions(+) create mode 100644 mods/default/models/player.b3d create mode 100644 mods/default/models/player.mtl create mode 100644 mods/default/models/player.obj create mode 100644 mods/default/models/player.png create mode 100644 mods/default/player.lua diff --git a/mods/default/init.lua b/mods/default/init.lua index 4a94331c..2a27988d 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -12,6 +12,7 @@ LIGHT_MAX = 14 default = {} -- Load other files +dofile(minetest.get_modpath("default").."/player.lua") dofile(minetest.get_modpath("default").."/mapgen.lua") dofile(minetest.get_modpath("default").."/leafdecay.lua") diff --git a/mods/default/models/player.b3d b/mods/default/models/player.b3d new file mode 100644 index 0000000000000000000000000000000000000000..bbe4910ede9336b921c8a12ee20295b8684c57b6 GIT binary patch literal 9067 zcmb7~2~-qE8i0u!5fK&TQiNf^Bf5f2mqtXUN|8fBz!PsrlqBeKDIO@uv{wl0^`e4u z$)Uyzf$35_5fF(;MAzW4nrJj8s61TVc*JCA>@73Sa%~#cbchz(kA9#BM zpLs4OCZCv?m;{IT_)a08M=hEA1=(#~SY%?-y0-i*$amssJF?qEO6Y`16FZU5d}n-Z zL+Z%jF+uz>zRc6dSa1GBODs)HyknxjaC3K8=?}MrmJ`iaI%EFCnKOg-&R6DR?~q_$ zo(uGyHgPcNz?6LEPecl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U7R2l3v8SHc!>#0iNJH*N{T)IM_3J6!-&O;K_c_# zjZS@27{9=OI3}zIVQJ!}wqID$sWZCaW`w=qd((I!uGuY4lS8WhfeCSDY) z-xZlY9_?lIT8jc5odHd}SR}g^UugQq>l%@KS@zC=CSJn-np=EDg}o*`(V_%fXFwA# zSF1J`pK5#0>uS9gEw^+AH1V=)o38jE(@C9qg9ukMXFwA#=;pQJtvUVG)#tS6;#(yU zix-1v<;S98byM->V`J1SinXZIVD0ZqJIygWy@e5FnuX{JSJof3$} zOY44Lk=>rV{v2^4)lGgRX4iZM7~j2{{Z@0-AWKxt^)}((;8`-6sj1 zdgcUZ;w53~LEUvYN)%z-MFKNQlMhXQncr@UVtWEv|ucq}9iF?KzHSiBhiK*?WU zTt*1j@cS;fD0vZ@mEHr;#EbQy$=sEoeXzs#3(+r*J%Cuev>vzin(3V1mj%$$Vj()Q z-wx2kOGZBp*VDBacAg!Je)F^gV)4>C-_oz=affp;oO&V#4XLvQH1X0Y;VbTWSqXG; zi9w6vYynNYY;OBc&f#CjA)6kJ{Cn8~v3O~HZNDm_xu4&igrSbn$nT;Jpoy1vmtwj8 zj;CP+7lj&AY=DL`&#bNDIMstPI4(2_rH9ynITW_CaWNM$s{*EUj6xX-8$c5;XQnUZ zG)ZS*#HC2o@0B&6iI>LN%ed;mO6asF5{3O@4aDN*6EbJ`%Fi9oSIfBh-&ew#^^s`u WC2K$vFQ;7NIh*ExKxsN}4gL?ioEj(q literal 0 HcmV?d00001 diff --git a/mods/default/models/player.mtl b/mods/default/models/player.mtl new file mode 100644 index 00000000..6e3b60a3 --- /dev/null +++ b/mods/default/models/player.mtl @@ -0,0 +1,12 @@ +# Blender MTL File: 'None' +# Material Count: 1 +newmtl Material +Ns 96.078431 +Ka 0.000000 0.000000 0.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.500000 0.500000 0.500000 +Ni 1.000000 +d 1.000000 +illum 2 + + diff --git a/mods/default/models/player.obj b/mods/default/models/player.obj new file mode 100644 index 00000000..442de104 --- /dev/null +++ b/mods/default/models/player.obj @@ -0,0 +1,106 @@ +# Blender v2.64 (sub 0) OBJ File: '' +# www.blender.org +mtllib player.mtl +o Cube +v 1.000000 -1.000000 -1.000000 +v 1.000000 -1.000000 1.000000 +v -1.000000 -1.000000 1.000000 +v -1.000000 -1.000000 -1.000000 +v 1.000000 1.000000 -0.999999 +v 0.999999 1.000000 1.000001 +v -1.000000 1.000000 1.000000 +v -1.000000 1.000000 -1.000000 +v 1.194667 -1.194667 0.000000 +v 0.000000 -1.194667 -1.194667 +v 1.194667 0.000000 -1.194666 +v 0.000000 -1.194667 1.194667 +v 1.194666 0.000000 1.194667 +v -1.194667 -1.194667 -0.000000 +v -1.194667 0.000000 1.194666 +v -1.194666 0.000000 -1.194667 +v 1.194667 1.194667 0.000001 +v 0.000000 1.194667 -1.194667 +v -0.000001 1.194667 1.194667 +v -1.194667 1.194667 -0.000000 +v 0.000000 -1.543509 -0.000000 +v -0.000000 1.543509 0.000000 +v 1.543509 0.000000 0.000000 +v -0.000000 0.000000 1.543509 +v -1.543509 0.000000 -0.000000 +v 0.000000 0.000000 -1.543509 +v -1.500000 -1.500000 1.500000 +v 1.500001 1.500000 -1.499999 +v 1.792000 0.000000 -1.792000 +v -0.000000 -1.792000 1.792000 +v -1.792001 -0.000000 1.792000 +v 0.000000 1.792000 -1.792000 +v -0.000001 -0.000000 2.315264 +v 0.000001 0.000000 -2.315264 +vt 0.750000 0.750000 +vt 0.790763 0.846234 +vt 0.699682 0.874273 +vt 0.653766 0.790763 +vt 0.250000 0.250000 +vt 0.153766 0.290763 +vt 0.125727 0.199681 +vt 0.209237 0.153766 +vt 0.500000 0.144103 +vt 0.346234 0.209237 +vt 0.300318 0.125727 +vt 0.351225 0.000000 +vt 0.144103 0.000000 +vt 0.000000 0.148774 +vt 0.000000 0.355896 +vt 0.199681 0.374273 +vt 0.148774 0.500000 +vt 0.644104 0.500000 +vt 0.709237 0.653766 +vt 0.625727 0.699681 +vt 0.500000 0.648774 +vt 0.800319 0.625727 +vt 0.846234 0.709237 +vt 0.874273 0.800318 +vt 0.374273 0.300318 +vt 0.290763 0.346234 +vt 1.000000 0.644103 +vt 1.000000 0.851226 +vt 0.851226 0.500000 +vt 0.500000 0.351226 +vt 0.855897 1.000000 +vt 0.500000 0.855896 +vt 0.648774 1.000000 +vt 0.355896 0.500000 +usemtl Material +s off +f 21/1 12/2 3/3 14/4 +f 22/5 20/6 7/7 19/8 +f 23/9 17/10 6/11 13/12 +f 24/13 19/8 7/7 15/14 +f 25/15 20/6 8/16 16/17 +f 26/18 10/19 4/20 16/21 +f 10/19 21/1 14/4 4/20 +f 1/22 9/23 21/1 10/19 +f 9/23 2/24 12/2 21/1 +f 17/10 22/5 19/8 6/11 +f 5/25 18/26 22/5 17/10 +f 18/26 8/16 20/6 22/5 +f 9/23 23/27 13/28 2/24 +f 1/22 11/29 23/27 9/23 +f 11/30 5/25 17/10 23/9 +f 33/31 30/2 12/2 24/31 +f 2/24 13/28 24/31 12/2 +f 13/12 6/11 19/8 24/13 +f 14/4 25/32 16/21 4/20 +f 3/3 15/33 25/32 14/4 +f 15/14 7/7 20/6 25/15 +f 18/26 26/34 16/17 8/16 +f 18/26 5/25 28/25 32/26 +f 11/29 1/22 10/19 26/18 +f 30/2 33/31 31/33 27/3 +f 28/25 29/30 34/34 32/26 +f 30/2 27/3 3/3 12/2 +f 24/13 15/14 31/14 33/13 +f 29/30 28/25 5/25 11/30 +f 26/34 18/26 32/26 34/34 +f 15/33 3/3 27/3 31/33 +f 34/18 29/29 11/29 26/18 diff --git a/mods/default/models/player.png b/mods/default/models/player.png new file mode 100644 index 0000000000000000000000000000000000000000..7ebc9930d42866f70bba6e07a6f7c4affd0bc3da GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z@ErkR#;MwT(m=snPZ!4!i{7P|14SDY1Y9mknobN`&^4oxsqBJJnqgCRbFIAf{sXBG z8t%HS5U3C0I+J^a;nXAT`2y?=TbOena6EV4@i~!A;hxg|Bkt=MZ#aZ6IdE+uBjb$) u>n#foTRSjFUr4`oe=}RavQtT(zZf4Ts++F4S*!-Mn8DN4&t;ucLK6U8heQhi literal 0 HcmV?d00001 diff --git a/mods/default/player.lua b/mods/default/player.lua new file mode 100644 index 00000000..4822ec79 --- /dev/null +++ b/mods/default/player.lua @@ -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