Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Hammer: Allow targeting entities in instances

Open vrad-exe opened this issue 2 years ago • 1 comments

Which component should be improved?

Hammer

Describe your feature suggestion in more detail

Hammer should be aware of individual entities within instances, allowing them to be properly targeted by outputs and keyvalues, and not show as invalid. The entities within instances in the map should be added to the list of targetable entities based on the configured fixup settings for each func_instance:

  • If fixup_style is set to 0 (Prefix) and a fixup name is set, the entities will be targetable by their original names prepended with the fixup name separated by a dash (e.g. fixup-originalname)
  • If fixup_style is set to 1 (Postfix) and a fixup name is set, the entities will be targetable by their original names followed by the fixup name separated by a dash (e.g. originalname-fixup)
  • If fixup_style is set to 0 or 1 but no fixup name is set, entities whose names do not start with @ will not be targetable, as they do not have predictable names (VBSP will auto-generate a fixup name)
  • If fixup_style is set to 2 (None), the entities will be targetable by their original names
  • Regardless of the above settings, entities with names starting with @ will always be targetable by their original names

(All of this is basically the same as what VBSP does, but I'm just putting it here for easy reference)

Names of instance entities targeted this way would appear light blue, a behavior which already somewhat exists in Hammer but seems unfinished - it doesn't account for instance fixups, the entity names still won't auto-complete, and are still considered invalid by Check for Problems. These issues should all be fixed.

vrad-exe avatar Aug 17 '23 00:08 vrad-exe

Thinking about this a bit more, I'm not sure if the first 3 points here really make sense to do by default, though it would still be nice to have as an advanced option you can turn on. Entities starting with @ should still show up though because those are usually intended to be targeted from outside the instance.

vrad-exe avatar Mar 29 '24 21:03 vrad-exe