StrataSource / Portal-2-Community-Edition

Task tracker for Portal 2: Community Edition
https://www.portal2communityedition.com
146 stars 3 forks source link

Add attachment point keyvalue #150

Open StefanH-AT opened 3 years ago

StefanH-AT commented 3 years ago

You can already set the attachment point directly by using the , syntax, but a dedicated keyvalue for this will be 👌

vrad-exe commented 3 years ago

A "teleport to attachment" boolean should also be added that, when enabled, makes it behave like SetParentAttachment (teleporting instead of maintaining offset). That's something that's not currently possible with the comma syntax, or even with TeamSpen's addons.

StefanH-AT commented 3 years ago

I'm not sure how to implement this. The teleport to attachment should not be added as a spawnflag because parenting exists on a baseentity level. I was going to add a attachment,maintainoffset syntax, but can't that just be added to the postcompiler?

TeamSpen210 commented 3 years ago

It can't as easily, since I'd need to generate a logic_auto or something to fire the command at the entity - then dealing with problems like if other entities have the same name, what happens if it doesn't have a name, if it's in a template (so I need to put the logic_auto in that too.....

StefanH-AT commented 3 years ago

OnSpawn !self SetParentAttachment ?

TeamSpen210 commented 3 years ago

Unless you added it, that’s not an output I’m aware of. I suppose I could spawn a logic_relay and parent though that, but it’d be real inefficient.

StefanH-AT commented 3 years ago

I'm just going to add the attachment keyvalue only to prop_dynamic and not baseclass

vrad-exe commented 3 years ago

Seems like that'd kind of defeat the purpose, since you'd mainly want to use it to attach things to a prop_dynamic...

vrad-exe commented 2 years ago

TeamSpen210/HammerAddons#80 already exists for this, not sure if we also want to have this implemented in code?