Raised This Month: $ Target: $400
 0% 

Origin of a parented entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-24-2015 , 19:47   Origin of a parented entity
Reply With Quote #1

Similar to the problem the pl cart guy had...

m_vecOrigin, m_vecAbsOrigin Prop_Send Prop_Data

all seem to teleport me somewhere out of the map if I parent an entity to something and try to teleport to the child

m_vecOrigin's Prop_Data happens to be 0.0 0.0 0.0, the others seem to give a garbage location.

Is there a way to properly get the location?

Also note I'm attaching it to an attachment point as well.
__________________
Chdata is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-25-2015 , 04:37   Re: Origin of a parented entity
Reply With Quote #2

I suppose the origin recalculation is a clientside thing. So the server doesn't actually know the origin of a parented entity. I've checked all the datamaps and didn't find the real absolute position of the parented entity.
The server only controls animations frames and blending, it doesn't know the result position of each bone. The best thing you can do to find out the real position of a parented entity is to take the clientside code of entity animation from the sourcesdk and make a c++ extension.


I've just remembered that prediction doesn't work with prop_dynamic attachments, so the server may really know the position of such entity. You should try to replace the parent model on the server side, if the position of the attachment will change for the players with the old parent model, then the server controls the result position of the attachment, and there should be a way to get the position. sourcesdk may have an answer to this question

Last edited by kadet.89; 05-25-2015 at 04:49.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-25-2015 , 04:45   Re: Origin of a parented entity
Reply With Quote #3

interestingly, if I attach entity 1 to an attachment point and entity 2 to entity 1, entity 2 appears at the origin of the entity of the attachment point, but will still follow the attachment point, just it won't be at the origin of entity 1/the attachment point.
__________________
Chdata is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-25-2015 , 04:52   Re: Origin of a parented entity
Reply With Quote #4

Does TE_ hook gives us the origin of a shoot flash? Can't we get the weapon model origin with this hook?

Last edited by kadet.89; 05-25-2015 at 04:52.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-25-2015 , 04:55   Re: Origin of a parented entity
Reply With Quote #5

That isn't necessarily what I'm trying to get the origin of. Otherwise I'd SDKCall Weapon_ShootPosition or whatever it is.
__________________
Chdata is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-25-2015 , 05:12   Re: Origin of a parented entity
Reply With Quote #6

I mean what if just attach TE to the attachment point, and get this point origin with TE hook

Last edited by kadet.89; 05-25-2015 at 05:13.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 05-25-2015 , 05:36   Re: Origin of a parented entity
Reply With Quote #7

o

That might work
__________________
Chdata is offline
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 15:32.


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