|
|
|
|
All use of my digital work is covered by this
Creative Commons Deed.
Please do not use any of my work for commercial purposes, thank you. |
|
|
|
Breakables
|
|
|
The breakables system is a way to create interactive environments by opening up
alternative routes, having sudden destructible monster ambushes and encouraging
plenty of rewarding player exploration moments.
func_breakable - is the primary entity of the breakable system
func_breakable_spawner - is a point entity clone of func_breakable
func_breakable_wall - used to fill in the gaps or reveal the details
trigger_monsterbreak - will trigger a breakable and monster together
The breakable system starts with the style key which defines all the defaults
based on material types. Each style has default rubble bmodels, unique
break/impact sounds, particle effects and different rubble velocity values.
If a different style of breakable is required there are plenty of extra types which
can be specified by the brkobjects key (10-12=rocks, 20-22=woods, 30-32=glass,
40-42=metals, 50-54=brick) and more will be added over time.
To create your own custom rubble the new bmodels should be setup in sets of 4
(roughly 8/16/24/32 units in size) and specified with the brkobj1-4 keys.
There are plenty of example map files under the 'maps/brk' directory which
can be re-painted to suit your needs. Always create any custom bmodels in
the map directory so that they can be grouped together with the map files.
It is recommended that all new bmodels be compiled with minimum lighting
using the following command line (tycompiler\light -light 150 %1) The light
value (150) should be changed to suit the location of the breakable.
The breakable system will randomly pick a rubble bmodel from the defined set
and if something is required to be picked more frequently then duplicate the
required bmodel across several of the brkobj keys.
When a breakable is triggered or the health reaches zero the initial bmodel is
removed and any targets are fired. This is to make sure that any broken detail
is present before any rubble is generated. The system will then try
(up to 4 times) to spawn rubble inside of the original bmodel volume.
When a monster is pursuing the player and finds a breakable in the way they
will try to destroy it using either melee or range attacks. If the breakble
is for scripted events only then add the extra spawnflags noshoot and nomonster
to prevent any unscripted interactions.
When a breakable is damaged and not destroyed the system shows feedback to the
player with specially coloured particles instead of the default white ones
used for world geometry. All of the default material styles have particle
colours setup and this can be fine tuned with the entity key pos1.
Breakables inside of liquids (underwater) will break apart at the same velocity
as anywhere else in the map and can be fine tuned either by changing the
velocity keys (brkvelbase, brkveladd) or by changing the gravity (brkgravity)
of rubble so that it falls slower.
The default velocity for the rubble is a directional force and this is based on
the angle of impact or the triggering entity. The angle of velocity can be
changed by moving around the trigger so that the rubble can fall in more visually
impressive ways. The system also supports the angle key on the original bmodel and
this will override any directional force. The angle key set to 1-360 will produce
a flat (XY) velocity, an up direction is like a fountain from the center and a
downward angle is without any XY movement. Depending on where the player is in
relation to the breakble when it falls apart, a special angle key setup might
produce better visual results.
There are plenty of monsters that have jumping abilities and their collision
detection does not always produce perfect results. It is possible to setup
breakables with an extra touch function that will detect jumping monsters and
break apart if a flying monster hits them and the (brktrigjump) key active.
|
|
|
|