func_mortar_field

Modified

12-Jul-2023

This entity serves as a spawnzone for mortars, which cause a sound effect, shortly followed by an explosion on the ground straight below where they were spawned. This entity can be hooked up to momentary_rot_buttons to do aimed mortar strikes.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of func_mortar_field so other entities can trigger it to call a mortar strike. Every trigger use-type works uniformly. Can be kill-targeted.

ZHLT Template Model Target zhlt_usemodel : For Brush entities: sets brush model template of this entity. Set it to the name of other brush entity (now called a template) and it's brush model will be used instead. Templates might save server resources by "copying" single brush entity (template identified by name) and using it in multiple places (can be used for entities like tables, columns, barrels, cars e.t.c.). Also one template occupies only one entity slot when compiling a map, no matter how many entities refers to it. For model-based point entities: copy display model of specified entity, to use it's model instead. Using "Custom model" is more appropriate in most cases, however, when it's not possible, use "ZHLT Copy Lighting From Target".

ZHLT Copy Lighting From Target zhlt_copylight : For Brush entities: copies light info from specified entity. This can be useful when we want this entity to be light up in a similar way the other entity of the map is, e.g. we have few func_pushables on map, and they are lit differently, tough they can be moved (and lightning is not updated on dynamic entities), it may looks shabby. With this keyvalue we can prevent this making all func_pushables received light in a same way. Another example: we have few windows in corridor (e.g. func_breakables), all of them receive a light in acceptable way, but the last window receive part of the light from another room and breaking whole atmosphere. We can set this window "Copy Lightning From Target" to any other window to fix this. Note that this can be also used for completely different entities, so we copy lightning from func_door to func_breakable as well. For model-based point entities: if model lightning does not satisfy you (e.g. it's too dark) you can specify a name of entity here to copy it's lightning values- it can be other model-based entity or simply info_target.

ZHLT Disable Clipping zhlt_noclip : Enable or disable collision of entity.

  • 0 : Default : Keep default collision.
  • 1 : Always non-solid : This makes entity non-solid- all collision info from this entity will be ignored. Use it in case when entity have no build-in collision disabling ability (e.g. by selecting "Passable" flag in func_door) and you much desire to disable collision for this entity.

ZHLT Invisible zhlt_invisible : Brush entities only. Determines if entity should be visible.

  • 0 : Visible (default)
  • 1 : Invisible

ZHLT Custom Shadow (when opaque) zhlt_customshadow : Opaque brush entities only. If "ZHLT Ligth Flags" of this entity uses any of the option with 'Opaque' word, this will allow to customize shadow dropped by this entity. Value format: [0 - 1.0] [0 - 1.0] [0 - 1.0], use three values for color or only one for transparency.

ZHLT Embed Light Map (when translucent) zhlt_embedlightmap : Transparent brush entities only. Set it to 'Yes' and this transparent entity will take a light from environment making it looks much more natural. Use it when entities (e.g. glass represented by func_wall) omits lightning from surrounding. Note that this is expensive so shouldn't be used too often, but resolution of those lightmaps can be controlled by keyvalue explained below.

  • 0 : No (default)
  • 1 : Yes

ZHLT Embed Light Map Resolution zhlt_embedlightmapresolution : Value of power of two that controls the resolution of embedded lightmaps of transparent textures (see keyvalue above). Higher value for better optimization. Default and recommended value is 4.

Spread Radius m_flSpread : Mortars spreading radius, bombs will spawn randomly within specified radius.

Repeat Count m_iCount : Amount of mortars to spawn each airstrike call.

Targeting m_fControl : Controls area of airstrike.

  • 0 : Random : Makes mortars spawn randomly within volume of func_mortar_field.
  • 1 : Activator : Option simply force mortars to strike at '!activator' (activator of the script) e.g. when player pushed a button which fires func_mortar_field, and the 'Activator' option is selected, the mortars spawns above the player. Note that bombs will be called at '!activator' location in a moment of firing func_mortar_field, what means the '!activator' have a time to escape from within airstrike area. Another think about 'Activator' option is that '!activator' location is not important- the bombs will strike '!activator' even if it's out of volume of the func_mortar_field- the location, placement and size of this entity does not matter.
  • 2 : Table : This variant seen in Half Life single player campaign- Gordon controls the airstrike area by two momentary button, first button controls X position of mortarts, and the second button controls it's Y position. This option enables "X Controller" and "Y Controller" keyvalues. When func_mortar_field is triggered, the entity picks percentage of X and Y position (from left/top to right/bottom) of func_rot_buttons hooked to it, and converts those to X and Y sizes of this entity volume, e.g. when the left/right momentary button (X Controller) is in the far left side, and the top/bottom momentary button (Y Controlled) is in the center of the whole movement distance, the airstrike will be called at 0% X and 50% Y position of func_mortar_field.

X Controller m_iszXController : The name of momentary_rot_button or func_rot_button to control X coordinates of mortar spawnpoint. Requires 'Table' value in "Targeting" key (see above).

Y Controller m_iszYController : The name of momentary_rot_button or func_rot_button to control Y coordinates of mortar spawnpoint. Requires 'Table' value in "Targeting" key (see above).