Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an armor stand #48

Closed
kilbith opened this issue Mar 30, 2016 · 33 comments
Closed

Adding an armor stand #48

kilbith opened this issue Mar 30, 2016 · 33 comments

Comments

@kilbith
Copy link

kilbith commented Mar 30, 2016

Hello @stujones11.

So the idea is to add a Minecraft-like armor stand from whose we could hold our equipment.

Some proof-of-concept to achieve that :

  • Take the current player model as base, convert it to .obj (static).
  • Remove the body inside to get the armor only.
  • Modelize a simple piece of wood adjusted to the armor positioning.

You would need to check the wielded item when the player right-clicks on the armor stand then apply accordingly a texture overlay to your entity.

armor_stand

@stujones11
Copy link
Owner

+1 Good idea. There is already a mod called 'armor_stand' but I do not think it works like that. I did actually suggest something similar to the mod's author https://forum.minetest.net/viewtopic.php?f=9&t=11967#p180912

Definitely added to the to-do list.

@0-afflatus
Copy link

👍 yes! My players have been hassling for this for ages.

@stujones11
Copy link
Owner

I am in the process of doing the blender/gimp part. I would like to know how the mechanics of equipping armor from the stand should work before I start coding it, so ideas are welcomed.

Fun fact: I have never actually played Minecraft.

@kilbith
Copy link
Author

kilbith commented Apr 1, 2016

@stujones11
Copy link
Owner

Cool video, it's making me wonder whether I should have used an entity for this rather than a mesh-node but that will have to be another day as I have almost completed the model.
I still do not quite understand (in terms of clicking) how one removes the armor from the stand. I kinda expected it to be a quick way of equipping armor in times of danger.

@kilbith
Copy link
Author

kilbith commented Apr 1, 2016

You'll be forced to use an entity because many combination of textures are possible.

@stujones11
Copy link
Owner

I have not got round to texturing yet and can't really disagree since I have never tried multiple materials with meshnodes before, however, I cannot see any reason why it would be any different.
I will use an entity if I absolutely have to, though I would rather not.

@kilbith
Copy link
Author

kilbith commented Apr 1, 2016

Also about taking the armor from the stand, it depends from where you click on the armor stand in MC. I think it's possible in MT as well, but a formspec would be simpler.

And I repeat : an entity is necessary since you can have e.g. a diamond helmet, a golden chestplate and steel boots. If you go with meshnode you'd be forced to register hundreds of nodes to cover all combinations possible.

@stujones11
Copy link
Owner

Indeed, though I could pinch the 'line-of-sight' code from my shooter mod, I think that would be overkill for this. A formspec it shall be.

And I repeat : an entity is necessary.

You may well be right but if that turns out to be true then I will file an issue.

@kilbith
Copy link
Author

kilbith commented Apr 2, 2016

I'm 100% sure to be right. Meshnode only supports pre-defined texturing. You need dynamic texturing of your meshes with the armor stand.

@stujones11
Copy link
Owner

Yeah, okay, I see what you're getting at, nodes don't support dynamic texturing which is a shame because entities just suck. I think the solution will be to use a meshnode for the stand itself but the armor will have to be an entity.

@stujones11
Copy link
Owner

@kilbith you have some experience with meshnodes, right? Any idea why my model would show up black yet the inventory and wielded image are correctly textured? This is starting to drive me nuts...

@kilbith
Copy link
Author

kilbith commented Apr 2, 2016

Did you add paramtype = "light" ?

Give me your current work into a .zip and I can give a look.

@stujones11
Copy link
Owner

I did not add paramtype = "light" which if I am not mistaken was the right thing to do?

Here is a zip of my current .blend: 3d_armor_stand_6.blend.zip

The test case is the existing 'armor_stand' mod with the node converted into a mesh.

armor_stand.zip

@kilbith
Copy link
Author

kilbith commented Apr 2, 2016

OK, tested. This is exactly what I assumed : you need to set paramtype = "light" and dig/re-place your node. Also consider paramtype2 = "facedir", walkable = false and making the armor stand lower.

screenshot_20160402_234531

@stujones11
Copy link
Owner

Duh, I did try the paramtype but did not dig/replace, thank you for your assistance. I realize the model still needs some tweaking but this just had me a bit stuck.

@kilbith
Copy link
Author

kilbith commented Apr 2, 2016

That's because the light information is stored internally per node by the engine. So when it's placed, the light information of the node doesn't change if not destructed.

@stujones11
Copy link
Owner

I guess that makes sense but I still don't understand why the 'regular' node I replaced worked fine without it, probably I should re-read the doc's :-)

@stujones11
Copy link
Owner

I have just pushed a feature branch for testing, if anyone would like to try and break it :D

https://github.com/stujones11/minetest-3d_armor/tree/armor_stand

It is probably nothing like the minecraft version but I am sure it can always be improved.

screenshot_20160403_183622

@kilbith
Copy link
Author

kilbith commented Apr 3, 2016

👍 Great work.

Two remarks :

  • I maintain you should use walkable = false as it's disturbing to collide with empty space between the stand and the limits of collision box. You can walk through the armor stand in Minecraft too.
  • The boots should lay on the socle (and thus you should move the armor down), seems more logical to me.

@stujones11
Copy link
Owner

I maintain you should use walkable = false

Yes, that was an oversight, see the latest commits.

The boots should lay on the socle, seems more logical to me.

I will lower the models more so that the boot are touching the base but maybe not tonight, I have had my fill of blender for one weekend ;-)

Thank you for your prompt response.

@kilbith
Copy link
Author

kilbith commented Apr 3, 2016

I also noticed the upper part of the helmet does not touch the summit of the armor stand.

@stujones11
Copy link
Owner

Noted, thanks, I will take care of that when I re-adjust the models.

@0-afflatus
Copy link

I can't say I've attempted to break it, but I like the way it works and agree with kilbith's comments above. I'm feeling strongly to give this some live testing - I have several hyperactive players who will find any breaking points really quickly.

@stujones11
Copy link
Owner

The models have now been lowered so that boots rest on the base and the helmet appears to sit on the top (as close as I can approximate with full pixels). I have also narrowed the entity collisionbox so that it is now possible to walk between stands but not directly through them.

@kilbith
Copy link
Author

kilbith commented Apr 6, 2016

OK that's better. I don't like how the lower part of the helmet goes inside the chestplate.

Also why the formspec list has 6 slots instead of 4 ?

If you fix that, I don't see anything preventing to push the armor stand in the master branch.

@stujones11
Copy link
Owner

I don't like how the lower part of the helmet goes inside the chestplate.

Yes, that is just a consequence of using the armor model as a base for this. I also just noticed that the boots need to be moved slightly closer together. Again, the formspec was more copy-pasta from the armor mod but you are quite correct, it only needs 4 slots. I will be sure to address these issues before merging, thank you once again for testing, I value your opinion.

@kilbith
Copy link
Author

kilbith commented Apr 6, 2016

You might as well redesign the helmet. See the rear of the Minecraft's helmet :

2016-04-06_22 29 29

@stujones11
Copy link
Owner

I have had a closer look in-game and I think that shifting the back of the helm up by one pixel should clear it from the chestplate. That is a lot of textures to change so a job for another day, meanwhile I have reduced the formspec to 4 slots, being meta-based this will only be the case for newly placed stands.

@0-afflatus
Copy link

I have done a little live testing of this and so far no breakages, no negative comments and no-one has asked how it's supposed to work. So with the proposed changes I'd agree that it's good to go.
👍

@stujones11
Copy link
Owner

@0-afflatus Thank you for testing this on your server, unfortunately the recent inventory changes mean that existing stands will no longer work properly so I hope this does not inconvenience you.
I am reasonably happy to merge this, however, the proposed changes to the helmet will have to wait for now.

@0-afflatus
Copy link

@stujones11 not a problem I knew it was WIP.

@stujones11
Copy link
Owner

Cool, well here goes...

AntumDeluge added a commit to AntumMT/mp-3d_armor that referenced this issue Jun 9, 2021
* Add setting to disable armor visuals on player model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants