func_bomb_target
Class hierarchy |
---|
CBombTarget |
cstrike/func_bomb_target.cpp
|
func_bomb_target
is a brush entity available in Counter-Strike series.
It is the area inside which players can plant the bomb.
The existence of this entity makes a map a Bomb Defusal scenario.
StartDisabled
keyvalue and the Enable/Disable/Toggle
inputs. To use this entity's inherited trigger I/O (OnStartTouch
, ...), set its spawnflags
keyvalue appropriately (default is 4097). To add all of this in Hammer, see below.- On a new round entities with this classname will intentionally not reset. You can use
logic_auto
to emulate resetting it. - Killing it removes it forever, as it is not respawned on a new round.
- It cannot be spawned with a
point_template
. - Parenting this with non preserved entities may have undesirable effects.
Entity Description
Players can plant a bomb if they touch this entity.
- But at most once: Doing so "consumes" a func_bomb_target, meaning that it allows no more planting inside it. The input BombPlanted consumes it, too.
The outputs BombPlanted, BombDefused and/or BombExplode are fired either in conjunction with a C4 entity that was planted inside it, or in response to the inputs of the same name.
- When planting outside any func_bomb_target with
mp_plant_c4_anywhere 1
, there is still a func_bomb_target chosen that is consumed and that fires outputs, even if all existing func_bomb_targets are already consumed.
Bots read the bomb plant locations from the Nav Mesh and not from the actual position of func_bomb_targets in the world. Since this information is set in the analysis phase of the nav mesh generation, there is no way that bots recognize the position of a func_bomb_target if it has moved. video.
Bombsite A and B
Generally, the game assigns the label A to the func_bomb_target with the lowest entity index and B to the highest. This, however, is overridden if the closest nav area to a func_bomb_target has a place name: If that place name is one of Bombsite or BombsiteA, it will be A; Any other place name yields B.code
Therefore, the mapper can set the labelling either by adding appropriate place names to crucial areas in-game, or – if no place names interfere! – by ordering their entity IDs in the VMF (and thus the entity index in-game) using Hammer: Move all func_bomb_targets to the world using Ctrl+⇧ Shift+W and then tie them to an entity with Ctrl+T in the desired order.
When a map loads, the game creates at most one info_bomb_target_hint_A and at most one info_bomb_target_hint_B entity near the center of the corresponding func_bomb_target, if any. These preserved entities are used for the radar. It can happen that a label is missing, which is when two bombsites would get the same label due to inappropriate place names. There will be at most two labels and it can only be A or B even though there is the place name BombsiteC
and radio voicelines naming "bombsite C". Still, any number of bombsites should work technically but there may be minor bugs such as missing text since the game is programmed to assume that there are at most two.
Keyvalues
- Name
(targetname)
<string> - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Heist Mode bomb Target
(heistbomb)
<boolean> - Marks the bomb target as designated for the heist game mode. Note:Support for heist mode was never fully implemented, so this KV should usually be set to false.
- Bomb Mount Target
(bomb_mount_target)
<targetname> - Optionally, have the bomb be forced to a specific position and orientation after being planted. The position and angles are determined by the ones of a specified
info_target
.
|
Inputs
BombExplode
!FGD- Fires the
BombExplode
output.
BombDefused
!FGD- Fires the
BombDefused
output.
BombPlanted
!FGD- Fires the
BombPlanted
output and removes this entity's volume from the planting zones until next round.
|
Outputs
BombExplode
- Fires when the bomb explodes or if the
BombExplode
input is received.
BombDefused
- Fires when the bomb is defused or if the
BombDefused
input is received.Bug: Is not fired by normal gameplay, only with theBombDefused
input. [todo tested in?]
BombPlanted
- Fires when the bomb is planted or if the
BombPlanted
input is received.
Bug:Spamming crouch jumps in a trigger can randomly fire OnStartTouch . Confirm:Is it a Multiplayer issue only? [todo tested in?]
Warning:This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
Warning:
OnEndTouch can fire before OnStartTouch under certain circumstances where both are fired on the same tick and each have the same delay. Fix:Add a slight delay to OnEndTouch .Bug:Spamming crouch jump in a trigger can randomly fire OnEndTouch . Confirm:Is it a Multiplayer issue only? [todo tested in?]
|
FGD Code
Replace the corresponding lines of cstrike.fgd
or csgo.fgd
near func_bomb_target
with this.
This code
- replaces its base classes with
Trigger
which effectively adds trigger properties such as the keyvalueStartDisabled
, the inputsEnable/Disable/Toggle/OnStartTouch/...
and the trigger flags (1: Clients, ...). - adds the input
TouchTest
and the outputsOnTouching/OnNotTouching
as seen intrigger_multiple
of base.fgd. - adds the inputs
BombExplode/BombDefused/BombPlanted
with the above description. - corrects the type of
bomb_mount_target
fromstring
totarget_destination
.
@SolidClass base(Trigger) = func_bomb_target: "Bomb Target. The terrorists can place C4 explosives while standing in this zone.\n\n" + "When the bomb is planted and explodes inside this area, the BombExplode outputs are fired. The game handles " + "all of the bomb planting and scoring logic – the BombExplode outputs are provided to add visual and damage effects." [ input TouchTest(void) : "Tests if the trigger is being touched and fires an output based on whether the value is true or false." input BombExplode(void): "Fires the BombExplode output" input BombPlanted(void): "Fires the BombPlanted output and removes this entity's volume from the planting zones until next round" input BombDefused(void): "Fires the BombDefused output" output OnTouching(void) : "Fired when the TestTouch input is true (something is touching the trigger.)" output OnNotTouching(void) : "Fired when the TestTouch input is not true (nothing is touching the trigger.)" output BombExplode(void): "Fires when C4 explodes or if the BombExplode input is received" output BombPlanted(void): "Fires when a C4 is planted or if the BombPlanted input is received" output BombDefused(void): "Fires when a C4 is defused or if the BombDefused input is received; Bug: Is not fired by normal gameplay, only with the BombDefused input." heistbomb(boolean) : "Heist Mode bomb target" : 0 : "This is a Bomb Target designed for the Heist game mode." bomb_mount_target(target_destination) : "Bomb Mount Target" ]