[Mod] 3D Players [3d_player]

User avatar
BrandonReese
Member
 
Posts: 839
Joined: Wed Sep 12, 2012 00:44
Location: USA
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Fri Nov 02, 2012 15:28

PilzAdam,
I was working on multiple textures for your 3d players. I noticed the player texture is 'squished' from 32x64 to 32x32. How would I use a 32x64 texture? I setup a couple different textures, setting up the 2d table pixel for pixel (32x64) that had odd results, so I made the textures 32x32 but they lose any detail once they are stretched in game. With this method am I stuck using 32x32 textures and having the game stretch them?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Nov 02, 2012 15:53

The code first creates a node that has the texture and the nodebox and then a entity that has drawtype "wielditem" and is set to the node.
A node needs square textures so I resized the 16x32 texture to 32x32. You should also choose the higher width/height to not loose pixels. The table for the nodebox has to be done for this resized texture.
If you use higher resolutions you may have to change some other parts of the code.
Feel free to ask me if you have any questions.
 

User avatar
BrandonReese
Member
 
Posts: 839
Joined: Wed Sep 12, 2012 00:44
Location: USA
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Fri Nov 02, 2012 16:44

PilzAdam wrote:The code first creates a node that has the texture and the nodebox and then a entity that has drawtype "wielditem" and is set to the node.
A node needs square textures so I resized the 16x32 texture to 32x32. You should also choose the higher width/height to not loose pixels. The table for the nodebox has to be done for this resized texture.
If you use higher resolutions you may have to change some other parts of the code.
Feel free to ask me if you have any questions.


Ok I think I know what I did wrong now. Thank you.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Sat Nov 03, 2012 00:33

can you make 2 other nodeboxes, the same but with the legs and arms moved a little forward? Then when pos is changing, swap the nodeboxes so it looks like walking is animated.
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia

by Josh » Sat Nov 03, 2012 02:07

PilzAdam wrote:
Josh wrote:This look's cool! great job PilzAdam. I thought i could only be made in c++ how did you make it in lua?

With the same "wielditem" hack as for animals. You can use player:set_object_proberties() to change the visuals of the player (somehow like Lua entities).


Would it be possible to have animations to the 3d player? for example a turning head.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Sat Nov 03, 2012 02:26

Josh wrote:Would it be possible to have animations to the 3d player? for example a turning head.


I think the only way you can get animation is to swap the nodebox, this means nobeboxes that rotate are not really an option yet.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Nov 03, 2012 09:46

There is no (good) way to add animation for the player. Somone is currently working on real 3D players and this mod is just for people who cant wait.
 

User avatar
Neuromancer
Member
 
Posts: 795
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sat Nov 03, 2012 13:03

Can you make them any thicker, say like 5 pixels thick?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Nov 03, 2012 13:13

Neuromancer wrote:Can you make them any thicker, say like 5 pixels thick?

You can change it yourself:
Code: Select all
--- 3d_player/init.lua    2012-11-03 14:09:51.542665223 +0100
+++ 3d_player_thick/init.lua    2012-11-03 14:09:18.406664423 +0100
@@ -40,7 +40,7 @@ for i=1,#pix do
         if pix[i][j] == 1 then
             local y = (i-16)*-1+1
             local x = j-16
-            table.insert(box, {(x-1)/32, (y-1)/32, -0.5/32, x/32, y/32, 0.5/32})
+            table.insert(box, {(x-1)/32, (y-1)/32, -2.5/32, x/32, y/32, 2.5/32})
         end
     end
 end

 

User avatar
terminalerror
Member
 
Posts: 33
Joined: Tue Oct 30, 2012 22:46
Location: The Sar-Chasm

by terminalerror » Sat Nov 03, 2012 21:17

PilzAdam wrote:
Neuromancer wrote:Can you make them any thicker, say like 5 pixels thick?

You can change it yourself:
Code: Select all
--- 3d_player/init.lua    2012-11-03 14:09:51.542665223 +0100
+++ 3d_player_thick/init.lua    2012-11-03 14:09:18.406664423 +0100
@@ -40,7 +40,7 @@ for i=1,#pix do
         if pix[i][j] == 1 then
             local y = (i-16)*-1+1
             local x = j-16
-            table.insert(box, {(x-1)/32, (y-1)/32, -0.5/32, x/32, y/32, 0.5/32})
+            table.insert(box, {(x-1)/32, (y-1)/32, -2.5/32, x/32, y/32, 2.5/32})
         end
     end
 end



Oh man! Could you please implement this in your simple mobs mod?
ERROR[main]: ModError: Failed to load and run a sarcastic remark.
 

mikey2020
Member
 
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Sun Nov 04, 2012 23:18

make him thicker i think it really cool tho
 

mikey2020
Member
 
Posts: 30
Joined: Sun Jul 15, 2012 03:39
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Mon Nov 05, 2012 02:23

You're right, PilzAdam. It's VERY time consuming to change the nodebox. Working on a Minecraft player shaped nodebox.
 

Sokomine
Member
 
Posts: 3956
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Mon Nov 05, 2012 15:26

There are at least two nodebox editors out there: http://minetest.net/forum/viewtopic.php?id=2840 from rubenwardy and
http://minetest.net/forum/viewtopic.php?id=3162 from sapier. Maybe you can get one of them running.
A list of my mods can be found here.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Wed Nov 07, 2012 22:28

Here's a nodebox for a "somewhat minecraft" shape. This has not been tested so I don't know what it looks like yet.
Code: Select all
local pix = {
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0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, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Nov 08, 2012 16:16

InfinityProject wrote:Here's a nodebox for a "somewhat minecraft" shape. This has not been tested so I don't know what it looks like yet.
[...]

The numbers in the table dont have a effect on the thickness. If there is a 1 it creates a 1 px thick box, nothing else.
 

Sokomine
Member
 
Posts: 3956
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Fri Nov 09, 2012 01:44

After experimenting a bit with sapiers Wielditem editor I came up with this:
Image
The texture is that of wood (I'm not good at textures!). The collection of nodeboxes is modelled after the image of players on Redcrabs server combined with the default green shape. It looks a bit as if the players are severely undernourished. The image above was taken on the testserver of King Arthurs Land (difficult to do in singleplayer) and works fine if inserted into PilzAdam's mod here.

Can someone come up with a texture for it? Or improve the model? The wood texture doesn't look that great...

You can find the model and a working modified version of PilzAdams mod here: https://github.com/Sokomine/3d_player
A list of my mods can be found here.
 

mikey2020
Member
 
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Fri Nov 09, 2012 02:50

can someone make it the shape and color of a minecraft person
 

Sokomine
Member
 
Posts: 3956
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Fri Nov 09, 2012 03:04

I don't think copying Minecraft would be such a good idea. Plus the Minecraft player is a figure that is much simpler in construction. I'm afraid it won't look good as a static model. Arms, legs, head...none of these can move yet! For that we'll need the patches MirceaKitsune is working on. But if you really want a character that looks like the one in Minecraft then get the wielditem editor and construct your own set of nodeboxes :-) It's not that difficult.
A list of my mods can be found here.
 

mikey2020
Member
 
Posts: 30
Joined: Sun Jul 15, 2012 03:39

by mikey2020 » Fri Nov 23, 2012 00:36

i think minecraft would be good you don't have to make the players arms and legs move
 

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Fri Nov 23, 2012 02:38

Can you anchor entities to other entities either through lua or some strange lua hack?
I've been gone for a long time
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Nov 23, 2012 11:32

jordan4ibanez wrote:Can you anchor entities to other entities either through lua or some strange lua hack?

No. But Taoki's 3D player branch includes attachment (anchor) code. I have made a branch of my carts mod that uses this. To test it you have to compile Taoki's 3D player branch and install the attachment branch of my carts mod. Its realy aweseome!
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02
Location: France

by Zeg9 » Sun Dec 02, 2012 16:38

PilzAdam wrote:This mod is rather useless since 0.4.4-dev has real 3D models.

Some people is still on 0.4.3
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
pop_harte
Member
 
Posts: 27
Joined: Sun Mar 23, 2014 07:39

by pop_harte » Fri Mar 28, 2014 19:58

ow it's like that player?[img]jpgh[/img]
 

Previous

Return to Old Mods



Who is online

Users browsing this forum: No registered users and 1 guest