Page 1 of 2
3d Armor - need help!

Posted:
Fri Jan 11, 2013 21:05
by 4aiman
Just a couple of minutes ago I tried to make this:

And here's a video of a player in 3d armor:
http://youtu.be/98rZ1P8PdF0I named this prototype of a mod "capes". Don't ask why, though, 'cause I don't know either ;)
What type of help do I need:- a piece of code to synchronize the armour mesh with it's "wearer" (maybe get_player_at_pos would do to find which one is wearer);
- an Idea how to take off that armour (I have an idea of wardrobe node, but I don't like the idea of using additional nodes)
Here is how I done what I have:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local ar = {
physical = true,
collisionbox = {-0.5,-1,-0.5, 0.5,1,0.6},
visual = "mesh",
mesh = "test2.x",
textures = {"ar.png"},
visual_size = {x=1.3, y=1.1, z = 1.3},
driver = nil,
v = 0,
}
function ar:on_rightclick(clicker)
if not clicker or not clicker:is_player() then
return
end
if self.driver and clicker == self.driver then
self.driver = nil
clicker:set_detach()
elseif not self.driver then
self.driver = clicker
self.object:set_attach(clicker, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
self.object:setyaw(clicker:get_look_yaw())
end
end
minetest.register_entity("capes:ar", ar)
minetest.register_craftitem("capes:ar", {
description = "Cape",
inventory_image = "ar.png",
wield_image = "ar.png",
wield_scale = {x=2, y=2, z=1},
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
minetest.env:add_entity(pointed_thing.above, "capes:ar")
itemstack:take_item()
return itemstack
end,
})
How to "put on" that "armor":
- Press "T"
input "/giveme capes:ar" - place that on the ground using the right click
- right click on the "armor" entity.

Posted:
Fri Jan 11, 2013 21:09
by jojoa1997
I LOVE YOU MAN SO MUCH. WE HAVE ARMOR!!!!!!
+100000000
:-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-) :-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-)

Posted:
Fri Jan 11, 2013 21:09
by jojoa1997
also can you make armor using moreores mod

Posted:
Fri Jan 11, 2013 21:15
by LorenzoVulcan
+1,This should become a good API.

Posted:
Fri Jan 11, 2013 21:16
by 4aiman
That's only a prototype. Crafting is a piece of cake, but the animation isn't. At least for me at least for now.
I'll be trying to find a way by myself, but I really need some help.

Posted:
Fri Jan 11, 2013 21:17
by jojoa1997
my suggestion is to make the hat more like a helmet

Posted:
Fri Jan 11, 2013 21:18
by LorenzoVulcan
4aiman wrote:That's only a prototype. Crafting is a piece of cake, but the animation isn't. At least for me at least for now.
I'll be trying to find a way by myself, but I really need some help.
I think you can't get best animations with LUA api.Anyway,you don't need it.It's a cubic game,graphics are not so important.

Posted:
Fri Jan 11, 2013 21:19
by jojoa1997
so it looks silly to have a person wearing something and making him move in and out of it

Posted:
Fri Jan 11, 2013 21:21
by LorenzoVulcan
jojoa1997 wrote:so it looks silly to have a person wearing something and making him move in and out of it
This also happens with the UFO mod.I think it's a c++ core problem.

Posted:
Fri Jan 11, 2013 21:22
by 4aiman
I think you can't get best animations with LUA api.Anyway,you don't need it.It's a cubic game,graphics are not so important.
I do not want "best" animations, I only want to make this armor fit a player. Basically the mesh for this armour is the character.x model without some parts. So, the animations is the same, I only need to sync them.

Posted:
Fri Jan 11, 2013 21:23
by jojoa1997
make pants shoes and a helmet like in the armor mod

Posted:
Fri Jan 11, 2013 21:25
by 4aiman
I would, but the core is much more important

Posted:
Fri Jan 11, 2013 21:26
by jojoa1997
ok well just make it the chestplate then

Posted:
Fri Jan 11, 2013 22:46
by lord_james
It's just my opinion but I think could be more efficient remade a player's model with pieces of armor and switch player's model when he wears the armor.

Posted:
Fri Jan 11, 2013 22:52
by 4aiman
+100! That's work! How is that I never have thought of that? >_<
Will make some models then ^__________^

Posted:
Fri Jan 11, 2013 23:12
by Chinchow
Wait but what if I have a different skin than default what would the armor look like?
Also what if I only have a chestplate on or a hat and boots would you make a model for every combination?

Posted:
Fri Jan 11, 2013 23:43
by jojoa1997
maybe have the armor model overlap the skin model

Posted:
Fri Jan 11, 2013 23:53
by tinoesroho
I believe there's a lua command you can use to attach the armor to an object (or player). Or vice-versa. Read the /doc/api.txt for more info

Posted:
Fri Jan 11, 2013 23:57
by 4aiman
tinoesroho wrote:I believe there's a lua command you can use to attach the armor to an object (or player). Or vice-versa. Read the /doc/api.txt for more info
Read the topic, please ;)
Chinchow wrote:Wait but what if I have a different skin than default what would the armor look like?
I know a workaround :
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
Does that ring a bell? ;)
Chinchow wrote:Also what if I only have a chestplate on or a hat and boots would you make a model for every combination?
I'm in no need of "making" combinations :)
I can do a full-set and then delete&save.

Posted:
Sat Jan 12, 2013 00:03
by jojoa1997
4aiman wrote:I'm in no need of "making" combinations :)
I can do a full-set and then delete&save.
Do you mean that you will be making one model for each item. One for chestplate. onr for helmet. ect....

Posted:
Sat Jan 12, 2013 00:09
by 4aiman
Is there any other opportunity? One model at a time. So, I need to create
char + boots+pants+chest+helmet model and then saving it in different combinations.

Posted:
Sat Jan 12, 2013 00:22
by jojoa1997
with overlapping images i was thinking that you have a GUI like this mod
http://minetest.net/forum/viewtopic.php?id=3099 but have you open it with a letter "u". then when you put armor into a slot the image gets overlapped with the player image.

Posted:
Sat Jan 12, 2013 02:03
by Chinchow
Alright well good luck

Posted:
Sat Jan 12, 2013 02:14
by Josh
Awesome! We have 3D armor. Watch out minecraft! minetest is growing fast.

Posted:
Sat Jan 12, 2013 03:11
by lord_james
4aiman wrote:Is there any other opportunity? One model at a time. So, I need to create
char + boots+pants+chest+helmet model and then saving it in different combinations.
Uhm... Another suggestion: Alpha texture. One model, differents combinations of armors.
http://minetest.net/forum/viewtopic.php?pid=53712#p53712

Posted:
Sat Jan 12, 2013 04:07
by Likwid H-Craft
Q:How do you change view to thirdperson?

Posted:
Sat Jan 12, 2013 04:26
by jojoa1997
you would have to make the canera go behind the player.

Posted:
Sat Jan 12, 2013 05:27
by dannydark
@Likwid H-Craft: You can't, this feature doesn't exist in Minetest.
He's connected with two clients and he is recording from one client while playing on the other.
@jojoa1997: Chill out mate, give the developer chance he was asking for help not 1 million and 1 ideas haha.
@4aiman: nice work mate, definitely deserves a +1 my only concern is if you do go down the route of adding the armour to the player model and then just switching states with that it will make it harder for people to add new types of armour. They would need to edit the character model and then either get it merged upstream or release a modified version with their mods.
It would be much better if you were able to carry on down the route you started at with making armour attachable models etc instead of part of the same character file.
EDIT: Also the next problem that you would get if the armour was added to the character model is a server could only ever have one modified character model (with the armour from one mod) because as soon as you have multiple mods that add new armour types etc they will be overwriting each others character model.

Posted:
Sat Jan 12, 2013 07:43
by Ragnar
(0.| <!=== Omg, that looks GREAT!
Hey can i put it on my webiste when its ready-ish?

Posted:
Sat Jan 12, 2013 10:13
by 4aiman
lord_james wrote:Uhm... Another suggestion: Alpha texture. One model, differents combinations of armors.
That's exactly what I'm going to do ;)
jojoa1997 wrote:but have you open it with a letter "u".
There is no need in additional keybindings. It's VERY likely I'll use modified inventory_plus mod (so yes, this would be compatible with skin selection from the very beginning)
Edit:
I tried to change models like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
prop = {
mesh = "helmet.x",
textures = default_textures,
visual = "mesh",
visual_size = {x=1.3, y=1.1, z = 1.3},
}
clicker:set_properties(prop)
@dannydark
Well, you're right about one model at a time... every new armor will result in adding even more meshes... some kind of avalanche... Dilemma.
I'll try to find out how to make synchronization then. If I will fail at that then at least I can modify character model and add at least some basic armor...
I'm looking into player.lua and butter creeper mod right now. I got the idea how to set an animation, but I have to modify built-in stuff to be able to easily read current animation.
Thanks everyone so far! New thoughts highly appreciated!