Breakable Brushes

Breakable Brushes

Classname: breakable_brush
Purpose: Demolition, direct or by remote control (targetting)
H2 Code: breakabl.hc
The hcode comments and many of the spawnflags for this entity allude to a rather complex scheme of `automatic linking', whereby breaking one brush would trigger the breaking of others, but this may be broken, and at any rate Eric Biessman thinks that manual linking by means of targetting is better and easier to use.

Breakable brushes can also take a spawning field so that they will spawn mana or an artifact when broken.

Fields

thingtype Value is a number, which determines the sound it makes when hit, the kinds of chunks it makes when it breaks, and its default health. A few basic thingtypes are:
  • 0 - glass (default)
  • 1 - stone
  • 2 - wood
  • 3 - metal
  • 4 - flesh
A full list is given in thingtyp.htm . The thingtypes apply to several other types of entities.
health This is set by default from the thingtype field as follows, but can be specified independently.
  • glass - 25
  • stone - 75
  • wood - 50
  • metal - 100
  • flesh - 30
Go here a full list of default health values.
abslight A (decimal) value between 0 and 1, sets an absolute light-value for the brush.
targetname Value is a name, brush breaks when this name is triggered.
target Value is a name, when the brush breaks, all the entities having this name as their targetname are triggered. Typically, you'd want a breakable brush to target all of the brushes above it in a destructible structure, such as a tower, plus any pots, lights or other items that would look stupid hanging in space when the brush under them is destroyed.
killtarget Value is a name, when the brush breaks, all the entities having this name as their targetname will disappear.
spawnflags There are quite a lot of these described in the hcode, but the useful ones seem to be:
  • 32 - TRANSLUCENT
  • 64 - INVINCIBLE
  • 128 - INVISIBLE
So one way to make glass is as a breakable brush with a spawnflag-value of 32. An invincible breakable brush can't be broken by bashing; bombs etc. bounce off it. But it will break by triggering. An invisible invincible breakable brush might be a nice invisible barrier.

The others involve automatic linking, whose status is a bit unclear to me at the moment, anyway here they are:

  • 1 - BREAK_KILLALL
  • 2 - BREAK_HIERARCH
  • 4 - BREAK_NOLINK
  • 8 - BREAK_CHECKNAME
  • 16 - BREAK_ORDERED
The idea was that breakable brushes would link automatically if they were touching, but the last time I tried I couldn't get this to work.

Back to the list.