Raised This Month: $ Target: $400
 0% 

How to parent an entity to a bone?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Timon5022
Junior Member
Join Date: Jun 2005
Old 04-26-2016 , 06:50   How to parent an entity to a bone?
Reply With Quote #1

So I have gotten down the basics of creating and parenting an entity to the attachments of a model. However, I would like to get the position of a player's elbows, and there are no attachments that are relevant for this.

The position of the bone "arm_lower_L" would be perfect for example, I could then use an offset to always get the position of the elbow even when the model is in motion/animating.

I hear people mentioning bonemerge(ing)?, but I can't seem to find any resources on how to do this. Also I would like this to work for most CT and T models without modifying the models themselves, if possible.

Can you guys tell me where to start?

Thanks in advance.
Timon5022 is offline
Send a message via MSN to Timon5022
d1rTyS
Junior Member
Join Date: Dec 2015
Old 04-26-2016 , 10:12   Re: How to parent an entity to a bone?
Reply With Quote #2

Have a look at the SetParentAttachment and SetParentAttachmentMaintainOffset entity inputs
d1rTyS is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-26-2016 , 10:47   Re: How to parent an entity to a bone?
Reply With Quote #3

Quote:
Originally Posted by d1rTyS View Post
Have a look at the SetParentAttachment and SetParentAttachmentMaintainOffset entity inputs
Those attach to attachment points, not bones.
afaik you cannot attach to a bone directly, you would need to decompile the model and create attachment points for the bones.
Bonemerging is when 2 models have the same bonenames and when parenting with the bonemerge flag the bones are positioned the same.

Last edited by Mitchell; 04-26-2016 at 10:48.
Mitchell is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 04-26-2016 , 13:18   Re: How to parent an entity to a bone?
Reply With Quote #4

In this case I would suggest to use the $attachment "weapon_hand_L" "weapon_hand_L" , than modify the offsets for your position and like someone said before:
Quote:
Have a look at the SetParentAttachment and SetParentAttachmentMaintainOffset entity inputs
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
Timon5022
Junior Member
Join Date: Jun 2005
Old 04-26-2016 , 14:44   Re: How to parent an entity to a bone?
Reply With Quote #5

Quote:
Originally Posted by andi67 View Post
In this case I would suggest to use the $attachment "weapon_hand_L" "weapon_hand_L" , than modify the offsets for your position and like someone said before:
Actually, my current implementation uses said approach. I parent my entity to the weapon_hand_L and R. I then teleport to entity to said attachment with a specific offset. However, the problem with this is that depending on the weapon that the person is using, the hand is in different positions. That is, the relative offset to the hand is different for each weapon.

As an example, when I am holding an AK47, the offsets match with the elbows, but when I am running with the bomb, the right elbow entity point is below the actual elbow of the model.

Thus, I am looking for something more solid than this. But it sounds like such an implementation would require changing the models themselves.
Timon5022 is offline
Send a message via MSN to Timon5022
Mitchell
~lick~
Join Date: Mar 2010
Old 04-26-2016 , 14:52   Re: How to parent an entity to a bone?
Reply With Quote #6

Quote:
Originally Posted by Timon5022 View Post
Actually, my current implementation uses said approach. I parent my entity to the weapon_hand_L and R. I then teleport to entity to said attachment with a specific offset. However, the problem with this is that depending on the weapon that the person is using, the hand is in different positions. That is, the relative offset to the hand is different for each weapon.

As an example, when I am holding an AK47, the offsets match with the elbows, but when I am running with the bomb, the right elbow entity point is below the actual elbow of the model.

Thus, I am looking for something more solid than this. But it sounds like such an implementation would require changing the models themselves.
Or just changing 1 model, and using bonemerging that modle to the player model and setting it's render mode to none. (kind of like my Custom Player Skins API)
Mitchell is offline
Timon5022
Junior Member
Join Date: Jun 2005
Old 04-26-2016 , 15:55   Re: How to parent an entity to a bone?
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
Or just changing 1 model, and using bonemerging that modle to the player model and setting it's render mode to none. (kind of like my Custom Player Skins API)
That is actually a very good idea. I did not think of this because firstly, I did not know about bonemerging at the time I began, and secondly I don't know how to edit models

Also, the players would have to download a custom model from the server then, but that is just a minor thing.
Timon5022 is offline
Send a message via MSN to Timon5022
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode