3d Armor - need help!

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

3d Armor - need help!

by 4aiman » Fri Jan 11, 2013 21:05

Just a couple of minutes ago I tried to make this:
Image

And here's a video of a player in 3d armor: http://youtu.be/98rZ1P8PdF0

I 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.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:09

I LOVE YOU MAN SO MUCH. WE HAVE ARMOR!!!!!!
+100000000
:-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-) :-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-)
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:09

also can you make armor using moreores mod
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
LorenzoVulcan
Member
 
Posts: 437
Joined: Mon Mar 12, 2012 06:46

by LorenzoVulcan » Fri Jan 11, 2013 21:15

+1,This should become a good API.
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php?pid=54290#p54290
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 11, 2013 21:16

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.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:17

my suggestion is to make the hat more like a helmet
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
LorenzoVulcan
Member
 
Posts: 437
Joined: Mon Mar 12, 2012 06:46

by LorenzoVulcan » Fri Jan 11, 2013 21:18

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.
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php?pid=54290#p54290
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:19

so it looks silly to have a person wearing something and making him move in and out of it
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
LorenzoVulcan
Member
 
Posts: 437
Joined: Mon Mar 12, 2012 06:46

by LorenzoVulcan » Fri Jan 11, 2013 21:21

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.
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php?pid=54290#p54290
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 11, 2013 21:22

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.
Last edited by 4aiman on Fri Jan 11, 2013 21:23, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:23

make pants shoes and a helmet like in the armor mod
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 11, 2013 21:25

I would, but the core is much more important
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 21:26

ok well just make it the chestplate then
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

lord_james
Member
 
Posts: 51
Joined: Sun Mar 11, 2012 22:06

by lord_james » Fri Jan 11, 2013 22:46

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.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 11, 2013 22:52

+100! That's work! How is that I never have thought of that? >_<
Will make some models then ^__________^
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Fri Jan 11, 2013 23:12

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?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Fri Jan 11, 2013 23:43

maybe have the armor model overlap the skin model
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Fri Jan 11, 2013 23:53

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
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 11, 2013 23:57

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.
Last edited by 4aiman on Sat Jan 12, 2013 00:03, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sat Jan 12, 2013 00:03

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....
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Jan 12, 2013 00:09

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.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sat Jan 12, 2013 00:22

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.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Sat Jan 12, 2013 02:03

Alright well good luck
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

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

by Josh » Sat Jan 12, 2013 02:14

Awesome! We have 3D armor. Watch out minecraft! minetest is growing fast.
 

lord_james
Member
 
Posts: 51
Joined: Sun Mar 11, 2012 22:06

by lord_james » Sat Jan 12, 2013 03:11

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
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20

by Likwid H-Craft » Sat Jan 12, 2013 04:07

Q:How do you change view to thirdperson?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sat Jan 12, 2013 04:26

you would have to make the canera go behind the player.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Sat Jan 12, 2013 05:27

@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.
Last edited by dannydark on Sat Jan 12, 2013 05:30, edited 1 time in total.
 

Ragnar
Member
 
Posts: 850
Joined: Thu Oct 25, 2012 15:19

by Ragnar » Sat Jan 12, 2013 07:43

(0.| <!=== Omg, that looks GREAT!
Hey can i put it on my webiste when its ready-ish?
Are you saying that I put an abnormal brain into a seven and a half foot long, fifty-four inch wide GORILLA?
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Jan 12, 2013 10:13

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!
Last edited by 4aiman on Sat Jan 12, 2013 11:38, edited 1 time in total.
 

Next

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 67 guests

cron