Grenade bolt: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{ent not in fgd|codeonly=1}} 100px|right {{this is a|point entity|name=grenade_bolt|game=Black Mesa}} This is crossbow bolt that appears when the...")
 
No edit summary
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TabsBar|main=Crossbow bolt}}
{{CDA|CGrenade_Bolt|CBlackMesaBaseProjectile|CBlackMesaBaseDetonator|CBaseAnimating|CBaseEntity|}}
{{ent not in fgd|codeonly=1}}
{{ent not in fgd|codeonly=1}}
[[File:Grenade_boltDEF.png|100px|right]]
[[File:Grenade_boltDEF.png|200px||thumb|right|The bolt model from [[Steam]] versions of the game.]]
{{this is a|point entity|name=grenade_bolt|game=Black Mesa}} This is crossbow bolt that appears when the player shoots from [[weapon_crossbow|crossbow]] in multiplayer. Used by mod version of the game (with no explosion abilities) for singleplayer campaign. Current [[Steam]] versions using {{ent|tracerbullet}} entity, you still can use old version of the bolts with {{command|sk_crossbow_tracer_enabled|0}}, bolts will not differ from the mod version. In singleplayer, bolts behave similarly to {{hl2|4}}, they can bounce, create sparks when hitting surfaces, can kill most enemies in one hit, it is affected by gravity (which is why you have to shoot with lead), don't have the ability to chain the body to a wall (used for {{ent|tracerbullet}}). In multiplayer, they use dynamite stick in their composition, which is why they explode instantly upon impact with a surface. Most inputs and outputs are same as [[CBaseAnimating]]. Used <code>CBlackMesaBaseProjectile</code> as a base class in Steam versions, <code>CBaseCombatCharacter</code> used in the mod version.
[[File:Grenade_boltOLD.png|200px||thumb|right|The bolt model from the mod version of the game.]]  
{{this is a|model entity|name=grenade_bolt|game=Black Mesa}} This is crossbow bolt that appears when fired from the [[weapon_crossbow|crossbow]] in multiplayer. Used by mod version of the game (with no explosion abilities) for singleplayer campaign. Current [[Steam]] versions use the {{ent|tracerbullet}} entity, you still can use the old version of the bolts with {{command|sk_crossbow_tracer_enabled|0}}, bolts will not differ from the mod version. In singleplayer, bolts behave similarly to {{hl2|4}} in that they can bounce, create sparks when hitting surfaces, and can kill most enemies in one hit, it is affected by gravity (which requires shooting with lead), and lacks the ability to chain the body to a wall (used for {{ent|tracerbullet}}). In multiplayer, they use dynamite stick in their composition, which is why they explode instantly upon impact with a surface. Most inputs and outputs are same as [[CBaseAnimating]].


{{bug|The model doesn't displays on dynamic objects (brushes and models) in Steam versions. Also doesn't create decals on such objects. {{not|{{bms12}}}}|hidetested=1}}
{{bug|hidetested=1|The model doesn't displays on dynamic objects (brushes and models) in Steam versions. Also doesn't create decals on such objects. {{not|{{bms12}}}}}}
{{bug|Creates a bullet impact decal when exploding, instead of an explosion decal.|hidetested=1}}
{{bug|hidetested=1|Creates a bullet impact decal when exploding, instead of an explosion decal.}}
{{bug|Doesn't use proper skin in multiplayer, even though it is provided and used for other entities that use bolts for model.
{{bug|hidetested=1|Doesn't use proper skin in multiplayer, even though it is provided and used for other entities that use bolts for model.
{{expand|title=Example.|
{{expand|title=Example.|
<br>
<br>
Line 14: Line 17:
}}
}}
{{workaround|You can use {{ent|trigger_weaponfire}} to set proper skin (will not affect bolts from secondary attack).}}
{{workaround|You can use {{ent|trigger_weaponfire}} to set proper skin (will not affect bolts from secondary attack).}}
|hidetested=1}}
}}
{{note|Models of this entity are different in mod and Steam versions.
{{bug|hidetested=1|This grenade entity can stuck at dynamic (not physics) objects, such as {{ent|prop_dynamic}}. In such situation, bolt will will not move until it explodes. Usually happens with objects that have a dynamic collision, or objects that are in motion.
{{tip|If you need to fix this issue, use {{ent|trigger_weaponfire}} that will kill stucked bolts, this trigger should be toggled by {{ent|logic_timer}} every 0.5-1.0 seconds.}}
{{expand|title=Example.|
{{expand|title=Example.|
<br>
<br>
<gallery mode=packed heights=210px>
<gallery mode=packed heights=310px>
File:Grenade_boltDEF.png|Model in [[Steam]] versions of the game.
File:Grenade boltbug.jpg|Example with this metal door. The door is prop_dynamic with dynamic collision (required for animations).
File:Grenade_boltOLD.png|Model in the mod version.
</gallery>
</gallery>
}}
}}
{{not|{{bms12}}}}
}}
}}
{{note|Cannot go through fence, unlike {{ent|tracerbullet}}.}}
{{note|It creates sparks and then disappears if hits [[skybox]] in the mod version. In Steam versions, it just disappears.}}
{{note|Only in the mod version you can see white beam created by this entity.}}
{{note|Only in the mod version you can see white beam created by this entity.}}


==Inputs==
==Inputs==
{{I|SetToExplode|param=void|This input forces bolt to explode upon impact with a surface. Used in multiplayer. {{tip|You can use this input for singleplayer map. Use {{ent|trigger_weaponfire}} that will fire this input for every {{ent|grenade_bolt}} entity.}}|only={{bms}}}}
{{I|SetToExplode|param=void|This input forces bolt to explode upon impact with a surface. Used in multiplayer. {{tip|You can use this input for singleplayer map. Use {{ent|trigger_weaponfire}} that will fire this input for every {{ent|grenade_bolt}} entity (make sure that {{command|sk_crossbow_tracer_enabled}} is disabled).}}|only={{bms}}}}
{{I|SetTimer|param=float|Sets amount of time before detonate. Doesn't do anything for this entity.|only={{bms12}}}}
{{I|SetTimer|param=float|Sets amount of time before detonate. Doesn't do anything for this entity.|only={{bms12}}}}
{{I|Detonate|param=void|Doesn't do anything for this entity.|only={{bms12}}}}
{{I|Detonate|param=void|Doesn't do anything for this entity.|only={{bms12}}}}
Line 38: Line 44:
{{bms|4|nt=2}}
{{bms|4|nt=2}}
{{varcom|start}}
{{varcom|start}}
{{varcom|sk_crossbow_tracer_enabled|1|[[Bool]]|Enable tracer crossbow bolts if 1. With 0, crossbow will use {{ent|grenade_bolt}}. Does not affect multiplayer mode.}}
{{varcom|sk_detenator_bolt_airspeed|5000|[[Float]]|Bolt air speed.}}
{{varcom|sk_detenator_bolt_airspeed|5000|[[Float]]|Bolt air speed.}}
{{varcom|sk_detenator_bolt_client_lifetime|30|[[Float]]|Amount of time before bolt disappear after it lands.}}
{{varcom|sk_detenator_bolt_client_lifetime|30|Float|Amount of time before bolt disappear after it lands.}}
{{varcom|sk_detenator_bolt_dot_bounce|-0.5|[[Float]]|Affects the number of bounces the bolt can make. Should be used a negative value (otherwise the bolt will remain in one point).}}
{{varcom|sk_detenator_bolt_dot_bounce|-0.5|Float|Affects the number of bounces the bolt can make. Should be used a negative value (otherwise the bolt will remain in one point).}}
{{varcom|sk_detenator_bolt_gravity|40|[[Float]]|Gravity scale, or how much gravity will affect the bolt.}}
{{varcom|sk_detenator_bolt_gravity|40|Float|Gravity scale, or how much gravity will affect the bolt.}}
{{varcom|sk_detenator_bolt_plr_dmg|115|[[Float]]|Amount of damage from bolt.}}
{{varcom|sk_detenator_bolt_plr_dmg|115|Float|Amount of damage from bolt.}}
{{varcom|sk_weapon_crossbow_bolt_advance_speed|2|[[Float]]|Acceleration during flight.}}
{{varcom|sk_weapon_crossbow_bolt_advance_speed|2|Float|Acceleration during flight.}}
{{varcom|sk_detenator_bolt_plr_xplode_direct_hit_dmg|75|[[Float]]|Amount of damage from direct hit for explondable bolt.}}
{{varcom|sk_detenator_bolt_plr_xplode_direct_hit_dmg|75|Float|Amount of damage from direct hit for explondable bolt.}}
{{varcom|sk_detenator_bolt_plr_xplode_dmg|50|[[Float]]|Amount of damage from indirect hit for explondable bolt (the damage from explosion).}}
{{varcom|sk_detenator_bolt_plr_xplode_dmg|50|Float|Amount of damage from indirect hit for explondable bolt (the damage from explosion).}}
{{varcom|sk_detenator_bolt_plr_xplode_radius|128|[[Float]]|Explosion radius for explondable bolt.}}
{{varcom|sk_detenator_bolt_plr_xplode_radius|128|Float|Explosion radius for explondable bolt.}}
{{varcom|end}}
{{varcom|end}}


{{bms12|4}} (the mod version)
{{bms12|4}}
{{varcom|start}}
{{varcom|start}}
{{varcom|sk_plr_dmg_bolt|75|[[Float]]|Amount of damage from player's bolt.}}
{{varcom|sk_plr_dmg_bolt|75|Float|Amount of damage from player's bolt.}}
{{varcom|sk_plr_dmg_bolt_sniper|0|[[Float]]|Amount of damage from player's bolt for [[npc_sniper|sniper]]. Doesn't work.}}
{{varcom|sk_plr_dmg_bolt_sniper|0|Float|Amount of damage from player's bolt for [[npc_sniper|sniper]]. Doesn't work.}}
{{varcom|sk_npc_dmg_bolt|0|[[Float]]|Amount of damage from [[NPC]]'s bolt. Doesn't work, none of the available NPCs can use crossbow. Probably should have been used for [[npc_human_assassin|female assassins]] (in the original {{hl|4}} there was an idea to use crossbow for this NPC class), you can find mention of separate crossbow's sounds for NPCs (in <code>scripts/weapon_crossbow.txt</code>).}}
{{varcom|sk_npc_dmg_bolt|0|Float|Amount of damage from [[NPC]]'s bolt. Doesn't work, none of the available NPCs can use crossbow. Probably should have been used for [[npc_human_assassin|female assassins]] (in the original {{hl|4}} there was an idea to use crossbow for this NPC class), you can find mention of separate crossbow's sounds for NPCs (in <code>scripts/weapon_crossbow.txt</code>).}}
{{varcom|end}}
{{varcom|end}}
==See Also==
*{{ent|weapon_crossbow}} - the weapon crossbow entity
*{{ent|item_weapon_crossbow}} - the pickup crossbow entity
*{{ent|item_ammo_crossbow}} - the ammo entity for weapon crossbow
*{{ent|tracerbullet}} - the tracer version of bolts
*{{ent|blackmesa_crossbow_tracer}} - the crossbow tracer entity

Latest revision as of 08:43, 21 July 2025

Source Engine ( General | Half-Life: Source | Black Mesa )
edit
C++ Class hierarchy
CGrenade_Bolt
CBlackMesaBaseProjectile
CBlackMesaBaseDetonator
CBaseAnimating
CBaseEntity
Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map because it can only be configured through code.
The bolt model from Steam versions of the game.
The bolt model from the mod version of the game.

grenade_bolt is a model entity available in Black Mesa Black Mesa. This is crossbow bolt that appears when fired from the crossbow in multiplayer. Used by mod version of the game (with no explosion abilities) for singleplayer campaign. Current Steam versions use the tracerbullet entity, you still can use the old version of the bolts with sk_crossbow_tracer_enabled 0, bolts will not differ from the mod version. In singleplayer, bolts behave similarly to Half-Life 2 Half-Life 2 in that they can bounce, create sparks when hitting surfaces, and can kill most enemies in one hit, it is affected by gravity (which requires shooting with lead), and lacks the ability to chain the body to a wall (used for tracerbullet). In multiplayer, they use dynamite stick in their composition, which is why they explode instantly upon impact with a surface. Most inputs and outputs are same as CBaseAnimating.

Icon-Bug.pngBug:The model doesn't displays on dynamic objects (brushes and models) in Steam versions. Also doesn't create decals on such objects. (not in Black Mesa (mod))
Icon-Bug.pngBug:Creates a bullet impact decal when exploding, instead of an explosion decal.
Icon-Bug.pngBug:Doesn't use proper skin in multiplayer, even though it is provided and used for other entities that use bolts for model.
Example.


PlacementTip.pngWorkaround:You can use trigger_weaponfire to set proper skin (will not affect bolts from secondary attack).
Icon-Bug.pngBug:This grenade entity can stuck at dynamic (not physics) objects, such as prop_dynamic. In such situation, bolt will will not move until it explodes. Usually happens with objects that have a dynamic collision, or objects that are in motion.
Tip.pngTip:If you need to fix this issue, use trigger_weaponfire that will kill stucked bolts, this trigger should be toggled by logic_timer every 0.5-1.0 seconds.
Example.


(not in Black Mesa (mod))

Note.pngNote:Cannot go through fence, unlike tracerbullet.
Note.pngNote:It creates sparks and then disappears if hits skybox in the mod version. In Steam versions, it just disappears.
Note.pngNote:Only in the mod version you can see white beam created by this entity.

Inputs

SetToExplode <void> (only in Black Mesa)
This input forces bolt to explode upon impact with a surface. Used in multiplayer.
Tip.pngTip:You can use this input for singleplayer map. Use trigger_weaponfire that will fire this input for every grenade_bolt entity (make sure that sk_crossbow_tracer_enabled is disabled).
SetTimer <floatRedirectInput/float> (only in Black Mesa (mod))
Sets amount of time before detonate. Doesn't do anything for this entity.
Detonate <void> (only in Black Mesa (mod))
Doesn't do anything for this entity.
SetThrower <void> (only in Black Mesa (mod))
Fired by this entity when appeared. Doesn't do anything.

Outputs

OnDetonate <void> (only in Black Mesa (mod))
Fired by this entity when detonated. This entity cannot detonate, so this output never works.

Dedicated ConVars

Black Mesa Black Mesa: Definitive Edition

Cvar/Command Parameters or default value Descriptor Effect
sk_crossbow_tracer_enabled 1 Bool Enable tracer crossbow bolts if 1. With 0, crossbow will use grenade_bolt. Does not affect multiplayer mode.
sk_detenator_bolt_airspeed 5000 Float Bolt air speed.
sk_detenator_bolt_client_lifetime 30 Float Amount of time before bolt disappear after it lands.
sk_detenator_bolt_dot_bounce -0.5 Float Affects the number of bounces the bolt can make. Should be used a negative value (otherwise the bolt will remain in one point).
sk_detenator_bolt_gravity 40 Float Gravity scale, or how much gravity will affect the bolt.
sk_detenator_bolt_plr_dmg 115 Float Amount of damage from bolt.
sk_weapon_crossbow_bolt_advance_speed 2 Float Acceleration during flight.
sk_detenator_bolt_plr_xplode_direct_hit_dmg 75 Float Amount of damage from direct hit for explondable bolt.
sk_detenator_bolt_plr_xplode_dmg 50 Float Amount of damage from indirect hit for explondable bolt (the damage from explosion).
sk_detenator_bolt_plr_xplode_radius 128 Float Explosion radius for explondable bolt.

Black Mesa (mod) Black Mesa (mod)

Cvar/Command Parameters or default value Descriptor Effect
sk_plr_dmg_bolt 75 Float Amount of damage from player's bolt.
sk_plr_dmg_bolt_sniper 0 Float Amount of damage from player's bolt for sniper. Doesn't work.
sk_npc_dmg_bolt 0 Float Amount of damage from NPC's bolt. Doesn't work, none of the available NPCs can use crossbow. Probably should have been used for female assassins (in the original Half-Life Half-Life there was an idea to use crossbow for this NPC class), you can find mention of separate crossbow's sounds for NPCs (in scripts/weapon_crossbow.txt).

See Also