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
Player API: Animation-dependent player model collisionbox #2742
Comments
https://github.com/minetest/minetest/blob/f3b7be97feb5f1de8f31c1841cb7fdd3d89ac451/src/content_cao.cpp#L345-L346 Easy PR. Makes the selection box not selectable for dead objects but keeps the model to indicate that the player died (nametag will also be there). |
What does the Beginner Friendly label mean ? |
It means that it's friendly to beginners. |
In the game or in implementation ? |
I assume you mean 'bad collision box' as in an upright box for a player laying down. And i assume the selection box is the issue not the collision box. |
Your assumptions are right. |
if we give the body the correct selectionbox, it should have a correct collisionbox, too. It's strange when selectionbox and collisionbox are different. Plus, you should give a dead body more gravity(=more acceleration downwards). I may open a new feature request/issue : I really want to be able to access player velocity/acceleration etc. from a mod, just like with entities... |
@appgurueu, see the LuaEntitySAO methods section of |
Agreed, sorry to imply otherwise.
No, obviously. There is an issue open about strange behaviour of dead bodies.
This is unclear, replace the dead body with an entity after player respawn? |
@paramat : Okay, but leave it with normal grav, at least. "replacing with entity" - Yeah so the dead body doesn't disappear before it's lifetime ended. Could be done from a Mod. |
The body disappears when the player respawns because that is when the body comes back to life, otherwise would be unjustified complexity. In MTG that is when bones are placed. Dev discussion is about latest master, not 0.4.16. |
👎 for request but giving a dead body the correct boxes may be a good idea. |
PR #2184 |
What's left of this PR now? Hasn't this been decided to be resolved in MTG? |
See #2184 (comment) onwards, needs consideration. |
Right, thanks. SmallJoker's idea is quite interesting. It's unfortunate you've decided to drop the PR. :) |
I have been thinking about this recently. |
Obviously, some animations of a player model are likely to require a different collisionbox and eye_height, for example when sitting or laying down. But the Player API is designed to have a single collisionbox and eye_height for all animations. It needs to be backwards compatible with registered models that do not have tables for collisionbox and eye_height. So considering collisionbox as an example i suggest this as an initial idea:
Can anyone see any problems with this approach? |
That is the straightforward approach (except I would just check for falsy instead of checking for type) |
Things to consider: Mods: Player classes (short, tall) |
Engine issue, not related to this PR: The boat collides with the environment, the attached player does not. The collisionbox only matters for external objects colliding with the player. This PR will improve upon that as a sitting player should have a different collisionbox than a standing one.
Out of the scope of this PR. These mods need to see how to not mess with other mods (including player_api) by overriding player properties. |
Closed by #2745 |
Issue type
Minetest version
Any I think
Summary
When a player dies, he leaves a dead body, which AFAIK only disappears when this player hits the respawn button. And this dead body has bad collision box & prevents for instance firearms from shooting through. IMO, dead body should disappear after 5 secs or so, and not only when respawn button is pressed. I know that might pose a problem, as the player entity has to be somewhere even while he's dead, but why not temporarily remove model & collisionbox, make them invisible ?
I'm pretty sure I can't change that outta a mod...
The text was updated successfully, but these errors were encountered: