AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Origin of a parented entity (https://forums.alliedmods.net/showthread.php?t=263410)

Chdata 05-24-2015 19:47

Origin of a parented entity
 
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.

kadet.89 05-25-2015 04:37

Re: Origin of a parented entity
 
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

Chdata 05-25-2015 04:45

Re: Origin of a parented entity
 
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.

kadet.89 05-25-2015 04:52

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

Chdata 05-25-2015 04:55

Re: Origin of a parented entity
 
That isn't necessarily what I'm trying to get the origin of. Otherwise I'd SDKCall Weapon_ShootPosition or whatever it is.

kadet.89 05-25-2015 05:12

Re: Origin of a parented entity
 
I mean what if just attach TE to the attachment point, and get this point origin with TE hook

Chdata 05-25-2015 05:36

Re: Origin of a parented entity
 
o

That might work


All times are GMT -4. The time now is 19:17.

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