Skip to content
Spencer Brown edited this page Mar 14, 2024 · 3 revisions

Tweaks

In addition to new pseudo-entities, Hammer Addons' postcompiler has several features that improve existing entities.

Attachment Points

The parent name keyvalue allows additionally specifying an attachment point to attach to on spawn (maintaining offset), by setting the name to ent_name,attachment. This is not particularly obvious, and Hammer does not understand the notation (causing I/O completions to fail). Instead a new keyvalue was added to specify the attachment point independently.

Damage Type improvements

Damage type values allow controlling a number of different behaviours, by setting various bits in the type number. To make this easier, additional keyvalues have been added to separate these flags from the main damage type. During compilation these will all be combined.

Inverted Booleans

Boolean keyvalues (yes/no) which have been set to !0/!1 will have their values inverted to 1/0 respectively. This allows for setting the keyvalue to !$var to invert the behaviour of this variable. This can be especially useful if two entities should be configured together, but their keyvalues are opposite to each other.


Entity-Specific Changes

func_physbox Mass Override

Physboxes use a mass computed from the brush geometry, which often ends up being incredibly high. The entity provides a mass scale, but this is rather inconvenient. With the postcompiler, you can now set a mass directly to entirely override the computed mass.

game_text

This entity has the ability to display multiple lines of text, but this isn't normally specifiable in Hammer, because it converts \ to / whenever saving. The postcompiler will reverse /n to allow newlines to function.

Instance Proxies

Due to the way func_instance_io_proxy was implemented, each instance can only have a total of 30 inputs or outputs. Additional ones will be routed to non-existent inputs/outputs on the proxy entity, causing them to silently fail to function. By default, the postcompiler will redirect these outputs to additional proxy entities, allowing the instance to function normally. Alternatively, setting the following config option will remove the proxy entities entirely, collapsing the outputs into the calling entity:

"transform_opts"
    {
    "func_instance_io_proxy"
        {
        "collapse" "1"
        }
    }

logic_branch_listener Changes

With the postcompiler installed, logic_branch_listener gains a set of UniqueStateXXX inputs designed to make it easier to assemble logic setups. The way these inputs work is that for each entity that fires inputs to the listener, a new logic_branch is created, named and added to the listener. The outputs then get redirected to that new branch.

material_modify_control

  • This entity requires entering the name of the shader parameter to modify. Since these usually start with $, this means material_modify_controls placed in instances will cause Hammer to treat this as a fixup variable. To allow control over this, the postcompiler will automatically prepend the $ if the variable omits it (and doesn't set a %var instead).
  • Due to the way the entity is setup, each material_modify_control can only control one material on one parent. If multiple entities or variant materials need to be controlled, this can be time-consuming to setup. To assist, a new option can be enabled to allow the postcompiler to search for parent entities. For each parent it looks for MaterialModify[Animated] proxies in the materials the model/brush uses, then duplicates the material_modify_control so it affects all of these. In this mode the "Material Name" field acts as a filter instead.