TeamSpen210 / HammerAddons

Useful tweaks and content for Source Engine Games
123 stars 36 forks source link

Add "Teleport to Attachment" keyvalue to entities #80

Open vrad-exe opened 4 years ago

vrad-exe commented 4 years ago

This would go with the Attachment Point keyvalue, mirroring the behavior of SetParentAttachment when enabled (teleporting instead of maintaining offset). Internally it would create a logic_auto that fires that input on the entity.

vrad-exe commented 3 years ago

On the P2CE repo you mentioned not wanting to do this because it would break if the entity was unnamed or shared its name with another entity. A pretty simple way I just thought of to solve that would be to attach a VScript that uses EntFireByHandle with self as the target to fire the input, instead of a logic_auto. I think that would also allow it to work if the entity was spawned in from a template?

TeamSpen210 commented 3 years ago

That would work yes, although then it'll have a script scope and so take up extra memory, and not work in earlier engines. I need to figure out an interface for only applying transforms for appropriate engines.

TeamSpen210 commented 3 years ago

A potentially better alternative which I could do on all engines would be to expand my model parsing code, decode the animation keyvalues and teleport the entity to where the attachment point myself.