Func bomb target: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 
 Note: The
Note: The 
 Note: This entity's trigger properties are !FGD but can be used, such as the
Note: This entity's trigger properties are !FGD but can be used, such as the 
 Important:This is a preserved entity in.
Important:This is a preserved entity in.
If the game has round restart mechanics this entity may not behave as expected:
		
	
|  (Moved notes from Creating a Bomb Defusal Map here and added back-button to that page. Added FGD code to fix missing EnableDisable, missing Bomb[...] inputs and value type of bomb_mount_target.) |  (Replaced PreservedEnt note. Improved FGD code. Replaced <source> with <pre>.) | ||
| Line 4: | Line 4: | ||
| <br> | <br> | ||
| {{base brush multi|func_bomb_target|game1=Counter-Strike: Source|game2=Counter-Strike: Global Offensive}} | {{base brush multi|func_bomb_target|game1=Counter-Strike: Source|game2=Counter-Strike: Global Offensive}} | ||
| {{Note | The <code>Heist Mode bomb Target</code> keyvalue (<code>heistbomb</code>) is an unused value and should be ignored.}} | {{Note | The <code>Heist Mode bomb Target</code> keyvalue (<code>heistbomb</code>) is an unused value and should be ignored.}} | ||
| {{Note |  | {{Note | This entity's trigger properties are {{not in FGD}} but can be used, such as the <code>StartDisabled</code> keyvalue and the <code>Enable/Disable/Toggle</code> inputs. To use this entity's inherited trigger I/O (<code>OnStartTouch</code>, ...), set its <code>spawnflags</code> keyvalue appropriately (default is 4097). To add all of this in [[Hammer]], see [[#FGD Code|below]].}} | ||
| {{preservedEnt|0}} | |||
| {{code class|CBombTarget|func_bomb_target.cpp}} | {{code class|CBombTarget|func_bomb_target.cpp}} | ||
| Line 45: | Line 44: | ||
| ==Outputs== | ==Outputs== | ||
| {{IO|BombExplode|Fires when the bomb explodes.}} | {{IO|BombExplode|Fires when the bomb explodes or if the <code>BombExplode</code> input is received.}} | ||
| {{IO|BombDefused|Fires when the bomb is defused. {{Bug | Is not fired by normal gameplay, only with the '''<code>BombDefused</code>''' input.}} }} | {{IO|BombDefused|Fires when the bomb is defused or if the <code>BombDefused</code> input is received. {{Bug | Is not fired by normal gameplay, only with the '''<code>BombDefused</code>''' input.}} }} | ||
| {{IO|BombPlanted|Fires when the bomb is planted.}} | {{IO|BombPlanted|Fires when the bomb is planted or if the <code>BombPlanted</code> input is received.}} | ||
| {{O BaseTrigger}} | {{O BaseTrigger}} | ||
| {{O BaseEntity}} | {{O BaseEntity}} | ||
| Line 53: | Line 52: | ||
| ==[[FGD]] Code== | ==[[FGD]] Code== | ||
| This code | This code | ||
| *  | * replaces its base classes with <code>Trigger</code> which effectively adds trigger properties such as the keyvalue <code>StartDisabled</code>, the inputs <code>Enable/Disable/Toggle/OnStartTouch/...</code> and the [[Trigger_once#Flags|trigger flags]] (1: Clients, ...). | ||
| * adds the input <code>TouchTest</code> and the outputs <code>OnTouching/OnNotTouching</code> as seen in <code>trigger_multiple</code> of [[base.fgd]]. | |||
| * adds the inputs <code>BombExplode/BombDefused/BombPlanted</code> with the above description. | * adds the inputs <code>BombExplode/BombDefused/BombPlanted</code> with the above description. | ||
| * corrects the type of <code>bomb_mount_target</code> from <code>string</code> to <code>target_destination</code>. | * corrects the type of <code>bomb_mount_target</code> from <code>string</code> to <code>target_destination</code>. | ||
| Replace the corresponding lines of {{ent|cstrike.fgd}} or {{ent|csgo.fgd}} with this. | Replace the corresponding lines of {{ent|cstrike.fgd}} or {{ent|csgo.fgd}} near <code>func_bomb_target</code> with this. | ||
| < | <pre> | ||
| @SolidClass base( | @SolidClass base(Trigger) = func_bomb_target:    | ||
| 	"Bomb Target. The terrorists can place C4 explosives while standing in this zone.\n\n" + | 	"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 " + | 	"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." | 	"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 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 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" | 	input BombDefused(void): "Fires the BombDefused output" | ||
| 	output BombExplode(void): "Fires when C4 explodes" | 	output OnTouching(void) : "Fired when the TestTouch input is true (something is touching the trigger.)" | ||
| 	output BombPlanted(void): "Fires when a C4 is planted" | 	output OnNotTouching(void) : "Fired when the TestTouch input is not true (nothing is touching the trigger.)" | ||
| 	output BombDefused(void): "Fires when a C4 is defused" | 	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." | 	heistbomb(boolean) : "Heist Mode bomb target" : 0 : "This is a Bomb Target designed for the Heist game mode." | ||
| Line 75: | Line 78: | ||
| 	bomb_mount_target(target_destination) : "Bomb Mount Target"   | 	bomb_mount_target(target_destination) : "Bomb Mount Target"   | ||
| ] | ] | ||
| </ | </pre> | ||
Revision as of 12:00, 29 August 2021

 
 Note: The
Note: The Heist Mode bomb Target keyvalue (heistbomb) is an unused value and should be ignored. Note: This entity's trigger properties are !FGD but can be used, such as the
Note: This entity's trigger properties are !FGD but can be used, such as the 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. Important:This is a preserved entity in.
Important:This is a preserved entity in.If the game has round restart mechanics this entity may not behave as expected:
| 
 | 
Entity Description
The existence of this entity makes a map a bomb defusal scenario. It marks where C4 entities can be planted.
- Players must touch the volume of any func_bomb_target in order to plant a C4 entity.
 As soon as a C4 entity is planted inside this entity's volume or as soon as it receives the input As soon as a C4 entity is planted inside this entity's volume or as soon as it receives the input- BombPlanted, this entity will no longer allow players to plant a C4 entity inside it.
- If a C4 entity is planted inside this entity's volume, this entity fires the outputs BombPlanted,BombDefusedand/orBombExplodein response to this specific C4 entity. Bug: The Bug: The- BombDefusedoutput is NOT fired when a bomb is defused. [todo tested in ?]
 When planting outside any func_bomb_target with mp_plant_c4_anywhere 1, there is still a func_bomb_target entity chosen that does the above, even if all existing func_bomb_targets are already consumed. When planting outside any func_bomb_target with mp_plant_c4_anywhere 1, there is still a func_bomb_target entity chosen that does the above, even if all existing func_bomb_targets are already consumed.
 
Bombsite A and B
The bombsites are assigned A and B in the order in which their brush(es) were tied to an entity (!). The order in which their classname is changed to func_bomb_target does not affect the labelling! If there are more than two of these entities, only two of them will be labelled with A and B.
To swap A and B, you can
- move the corresponding brushes of the func_bomb_targets manually.
- move both func_bomb_targets to the world by selecting them and pressing Crtl+⇧ Shift+W. Then, tie the brush(es) for A to an entity using Ctrl+T and after that, do the same for B. Finally, change the entity classnames.
Keyvalues
- Heist Mode bomb Target (heistbomb) <boolean>
- Tells the bomb target that it's designed for the Heist game mode.
- 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 BombExplodeoutput.
- BombDefused !FGD
- Fires the BombDefusedoutput.
- BombPlanted !FGD
- Fires the BombPlantedoutput and removes this entity's volume from the planting zones until next round.
| 
 
 
 
 | 
Outputs
- BombExplode
- Fires when the bomb explodes or if the BombExplodeinput is received.
- BombDefused
- Fires when the bomb is defused or if the BombDefusedinput is received. Bug: Is not fired by normal gameplay, only with the Bug: Is not fired by normal gameplay, only with theBombDefusedinput. [todo tested in ?]
- BombPlanted
- Fires when the bomb is planted or if the BombPlantedinput is received.
| 
 
 
 
 
 
 | 
FGD Code
This code
- replaces its base classes with Triggerwhich effectively adds trigger properties such as the keyvalueStartDisabled, the inputsEnable/Disable/Toggle/OnStartTouch/...and the trigger flags (1: Clients, ...).
- adds the input TouchTestand the outputsOnTouching/OnNotTouchingas seen intrigger_multipleof base.fgd.
- adds the inputs BombExplode/BombDefused/BombPlantedwith the above description.
- corrects the type of bomb_mount_targetfromstringtotarget_destination.
Replace the corresponding lines of cstrike.fgd or csgo.fgd near func_bomb_target with this.
@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" ]






























