Open vrad-exe opened 4 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?
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.
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.
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.