func_breakable

health 
noise 
noise1 – noise4 
modelpath 
count 
dmg
rsize 
t_width 
ritem

The func_breakable entity allows you to create destructable objects in your map, which throw out chunks of debris as they are destroyed. The objects can either have a health value which must be depleted before they are destroyed, or can be destroyed by a trigger.
The info_rubble entity will spawn rubble in exactly the same way as a func_breakable when triggered, but have no corresponding brush model.

The rubble which is thrown can be customised in a number of ways: by setting the fields above you can specify a custom rubble model, randomly select a range of frames within that model, choose the skin that the model should display, and pick the sounds to play when the entity first breaks and when the rubble bounces. For simplicity, we also offer a number of preset templates for rock, brick, wood, glass and more, which set all of these fields for you. The presets can be selectively overridden: if you choose a template and custom-set some of the other fields, the preset’s values are only applied to the fields you did not customise. This lets you select the glass preset to get the Quoth glass sounds but provide a custom model for the chunks of glass etc.

spawnflag 1 
Makes the func_breakable display the standard rocket/grenade explosion effect at the same time as it dies and spawns the rubble. Useful when making computers or machines.

preset
Select the preset template to use for the rubble. Automatically fills in any values of “noise”, “noise1”-“noise4” and “modelpath” that have not been custom set, according to the following values:

0 = Rock ( default )
1 = Wood
2 = Flesh
3 = Machine
4 = Glass *
5 = Brick ( 8 units ) *
6 = Brick ( 16 units ) *
7 = Brick ( 32 units ) *
8 = Metal *
9 = Circuitboards *

There are multiple different skins available on the models for each of these presets to cover the variety of textures and themes maps might use. Make sure to check out the available options and select one using the ritem option.

ritem
The skin to use for debris models with multiple skins.

health 
When set, the object will take damage and break when killed. If no targetname is given, the object defaults to 1 health. If targetname is given but health is not set, then the object will not take damage and only breaks when triggered.

noise 
Custom break sound to play when destroyed.

noise1 – noise4 
Randomised bounce sounds for the thrown debris. Any you do not set will be replaced with default sounds from the preset. Use “misc/null.wav” for any or all four to eliminate bounce noises.

modelpath 
Specifies the model to throw when killed.

count 
The number of pieces of rubble to spawn. Default is 0 ( no debris, just remove and play break sound ).

dmg
The amount of damage each chunk of rubble should inflict when it hits. Default is no damage (as of Quoth 2.1).

rsize 
Sets the frame of the debris model being thrown, but see also “t_width”.

t_width 
Turns on random frame selection. When set, “t_width” specifies the maximum frame you want generated, and “rsize” gets reintepreted as the minimum frame number. So “rsize” “5” and “t_width” “10” will choose each of the frames 5, 6, 7, 8, 9 and 10 from the selected model with equal probability. The frame is randomised on a per gib basis.

To view them easily in-game we have provided breakable.bsp, a map that demonstrates each preset in a separate gallery in numerical order from left to right. The galleries display examples of the skins of the model also in numerical order from left to right, except flesh, machinery, and glass whose skins generally get mixed together when used. The different sizes of bricks are displayed in the same gallery, since the skins are the same regardless of size.
The map is a fun showcase for the sorts of structures and flavours of breakable scenery you can now create in Quoth. It is also a warning of how quickly packet overflows can be encountered using breakable features.
Go smash some stuff. We’ll wait for you.

Customising Presets
There is a lot of work required to set up all the customisable elements of a func_breakable, so it’s worth understanding how the presets can save you time. You can override any property that a preset has by setting it directly. For example, you can set the wood preset, but then set modelpath to equal “progs/metal.mdl”. The first frame and skins 0-1 of the metal model actually produce a wooden crate panel, and the wooden sounds are more appropriate.

Whenever using the presets, setting the “frame fields” ritem and t_width is highly recommended. The wood preset, for example, doesn’t use any of the extra frames in plank.mdl by default – set ritem 3 and t_width 5 to generate the irregular splinter shapes. The wreckage preset comes with 4 different machine parts, so pick the most apt one with ritem.

Setting appropriate frame fields for a custom model is equally important, but beware! The presets marked with asterisks above already set ritem and t_width. You can override the values as normal, unless you want to set them to zero. Quoth can’t distinguish between a field which hasn’t been set and one which is set to zero, so you end up with the preset value. To get round this in Quoth 2.2, you can set the fields to -1 instead, which is treated as “override preset with zero”. In versions before 2.2 you have to do things the long way round – forgo the preset and set all the fields manually.

<-Back to the tutorial

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s