Grenade frag: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{CDA|CGrenade_Frag|CBlackMesaBaseGrenade|CBlackMesaBaseDetonator|CBaseAnimating|CBaseEntity|}}
{{ent not in fgd|nolink=1|because=it can only be configured through code in [[Steam]] versions of the game. In the mod version, you still use it for rare cases, but it's more easy to use an exploadable prop}}
{{ent not in fgd|nolink=1|because=it can only be configured through code in [[Steam]] versions of the game. In the mod version, you still use it for rare cases, but it's more easy to use an exploadable prop}}
[[File:Granede_frag.png|100px|right]]
[[File: Granede_frag.png | right | 110px|thumb|The frag grenade world model from [[Steam]] versions of the game.]]
{{this is a|point entity|name=grenade_frag|game=Black Mesa}} The grenade entity that used by {{ent|weapon_frag}} and [[HECU]] soldiers. It is a frag grenade that explodes after a certain amount of time, it also uses [[VPhysics]], so you can pick it up and throw it like any other physical object. In multiplayer, used [[QPhysics]] (similar to {{hl|4}} and {{cs2|4}}), so you can't pick up it, but it has a predictable throw path. [[Steam]] versions use console variables to configure this entity, the mod version provides exclusive inputs and outputs that are cut in Steam versions of the game. Other inputs and outputs are same as [[CBaseAnimating]]. Used <code>CBlackMesaBaseGrenade</code> as a base class in Steam versions, <code>CBaseCombatCharacter</code> used in the mod version.
[[File: item_weapon_frag_bms12.png | right | 110px|thumb|The frag grenade world model from the mod version of the game.]]
{{this is a|model entity|name=grenade_frag|game=Black Mesa}} The grenade entity that used by {{ent|weapon_frag}} and [[HECU]] soldiers. It is a frag grenade that explodes after a certain amount of time, it also uses [[VPhysics]], so you can pick it up and throw it like any other physical object. In multiplayer, used [[QPhysics]] (similar to {{hl|4}} and {{cs2|4}}), so you can't pick up it, but it has a predictable throw path. [[Steam]] versions use console variables to configure this entity, the mod version provides exclusive inputs and outputs that are cut in Steam versions of the game.


 
{{bug|hidetested=1|[[Level Transitions|Level transition]] will break the detonation timer, causing this entity to never explode.}}
{{bug|[[Level Transitions|Level transition]] will break the detonation timer, causing this entity to never explode.|hidetested=1}}
{{bug|hidetested=1|In multiplayer, if a player dies while cooking frag and before throwing it, it will create a frag that will never disappear, it will also collide with other players.}}
{{bug|In multiplayer, if a player dies while cooking frag and before throwing it, it will create a frag that will never disappear, it will also collide with other players.|hidetested=1}}
{{bug|hidetested=1|Particles disappear after save loading.}}
{{bug|Particles disappear after save loading.|hidetested=1}}
{{bug|hidetested=1|This entity will never explode if spawned via {{hammer|4}} or {{command|ent_create grenade_frag}} {{not|{{bms12}}}}.}}
{{bug|This entity will never explode if spawned via {{hammer|4}} or {{command|ent_create grenade_frag}} {{not|{{bms12}}}}.|hidetested=1}}
{{note|Particles from this entity are different in mod and Steam versions.
{{note|Particles from this entity are different in mod and Steam versions.
{{expand|title=Example.|
{{expand|title=Example.|
Line 26: Line 27:


==Dedicated [[ConVars]]==
==Dedicated [[ConVars]]==
{{bms|4}}
{{varcom|start}}
{{varcom|start}}
{{varcom|sk_detenator_frag_fuse_time|3|[[Float]]|Amount of time before before detonate.}}
{{varcom|sk_detenator_frag_fuse_time|3|[[Float]]|Amount of time before before detonate.}}
{{varcom|sk_detenator_frag_throw_forward_speed_primary|750|[[Float]]|Throw forward speed for primary attack.}}
{{varcom|sk_detenator_frag_throw_forward_speed_primary|750|Float|Throw forward speed for primary attack.}}
{{varcom|sk_detenator_frag_throw_up_speed_primary|255|[[Float]]|Throw up speed for primary attack.}}
{{varcom|sk_detenator_frag_throw_up_speed_primary|255|Float|Throw up speed for primary attack.}}
{{varcom|sk_detenator_frag_throw_forward_speed_secondary|500|[[Float]]|Throw forward speed for secondary attack.}}
{{varcom|sk_detenator_frag_throw_forward_speed_secondary|500|Float|Throw forward speed for secondary attack.}}
{{varcom|sk_detenator_frag_throw_up_speed_secondary|100|[[Float]]|Throw up speed for secondary attack.}}
{{varcom|sk_detenator_frag_throw_up_speed_secondary|100|Float|Throw up speed for secondary attack.}}
{{varcom|sk_detenator_frag_plr_dmg|100|[[Float]]|Amount of damage from player's frag.}}
{{varcom|sk_detenator_frag_plr_dmg|100|Float|Amount of damage from player's frag.}}
{{varcom|sk_detenator_frag_plr_dmg_radius|250|[[Float]]|Damage radius from player's frag.}}
{{varcom|sk_detenator_frag_plr_dmg_radius|250|Float|Damage radius from player's frag.}}
{{varcom|sk_detenator_frag_npc_dmg|60|[[Float]]|Amount of damage from [[NPC]]'s frag.}}
{{varcom|sk_detenator_frag_npc_dmg|60|Float|Amount of damage from [[NPC]]'s frag.}}
{{varcom|sk_detenator_frag_npc_dmg_radius|200|[[Float]]|Damage radius from NPC's frag.}}
{{varcom|sk_detenator_frag_npc_dmg_radius|200|Float|Damage radius from NPC's frag.}}
{{varcom|sk_detenator_frag_elasticity|0.45|[[Float]]|Frag's elasticity or how hard does it bounce. Multiplayer only.}}
{{varcom|sk_detenator_frag_elasticity|0.45|Float|Frag's elasticity or how hard does it bounce. Multiplayer only.}}
{{varcom|sk_detenator_frag_gravity|400|[[Float]]|Gravity scale for frag. Multiplayer only.}}
{{varcom|sk_detenator_frag_gravity|400|Float|Gravity scale for frag. Multiplayer only.}}
{{varcom|sk_detenator_frag_friction|0.2|[[Float]]|Friction scale for frag. Doesn't work.}}
{{varcom|sk_detenator_frag_friction|0.2|Float|Friction scale for frag. Doesn't work.}}
{{varcom|end}}
{{varcom|end}}
{{note|All these console commands are not available in the mod version.}}
 
{{bms12|4}}
{{varcom|start}}
{{varcom|sk_plr_dmg_grenade_frag|100|Float|Amount of damage from player's frag.}}
{{varcom|sk_npc_dmg_grenade_frag|50|Float|Amount of damage from [[NPC]]'s frag.}}
{{varcom|end}}
 
==See Also==
*{{ent|weapon_frag}} - the weapon frag entity
*{{ent|item_weapon_frag}} - the pickup frag entity
*{{ent|npc_human_commander}} - one of NPCs that can use this entity (commander)
*{{ent|npc_human_medic}} - one of NPCs that can use this entity (medic)
*{{ent|npc_human_grunt}} - one of NPCs that can use this entity (grunt)
*{{ent|npc_human_grenadier}} - one of NPCs that can use this entity (grenadier)

Latest revision as of 09:29, 21 July 2025

C++ Class hierarchy
CGrenade_Frag
CBlackMesaBaseGrenade
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 in Steam versions of the game. In the mod version, you still use it for rare cases, but it's more easy to use an exploadable prop.
The frag grenade world model from Steam versions of the game.
The frag grenade world model from the mod version of the game.

grenade_frag is a model entity available in Black Mesa Black Mesa. The grenade entity that used by weapon_frag and HECU soldiers. It is a frag grenade that explodes after a certain amount of time, it also uses VPhysics, so you can pick it up and throw it like any other physical object. In multiplayer, used QPhysics (similar to Half-Life Half-Life and Counter-Strike 2 Counter-Strike 2), so you can't pick up it, but it has a predictable throw path. Steam versions use console variables to configure this entity, the mod version provides exclusive inputs and outputs that are cut in Steam versions of the game.

Icon-Bug.pngBug:Level transition will break the detonation timer, causing this entity to never explode.
Icon-Bug.pngBug:In multiplayer, if a player dies while cooking frag and before throwing it, it will create a frag that will never disappear, it will also collide with other players.
Icon-Bug.pngBug:Particles disappear after save loading.
Icon-Bug.pngBug:This entity will never explode if spawned via Hammer Hammer or ent_create grenade_frag (not in Black Mesa (mod)).
Note.pngNote:Particles from this entity are different in mod and Steam versions.
Example.


Inputs

SetTimer <floatRedirectInput/float> (only in Black Mesa (mod))
Sets amount of time before detonate. Fires with 2.985 value when a player throw a frag.
Detonate <void> (only in Black Mesa (mod))
Detonates frag.
SetThrower <void> (only in Black Mesa (mod))
Fired by this entity when throwed. Doesn't do anything.

Outputs

OnDetonate <void> (only in Black Mesa (mod))
Fired by this entity when detonated.

Dedicated ConVars

Black Mesa Black Mesa

Cvar/Command Parameters or default value Descriptor Effect
sk_detenator_frag_fuse_time 3 Float Amount of time before before detonate.
sk_detenator_frag_throw_forward_speed_primary 750 Float Throw forward speed for primary attack.
sk_detenator_frag_throw_up_speed_primary 255 Float Throw up speed for primary attack.
sk_detenator_frag_throw_forward_speed_secondary 500 Float Throw forward speed for secondary attack.
sk_detenator_frag_throw_up_speed_secondary 100 Float Throw up speed for secondary attack.
sk_detenator_frag_plr_dmg 100 Float Amount of damage from player's frag.
sk_detenator_frag_plr_dmg_radius 250 Float Damage radius from player's frag.
sk_detenator_frag_npc_dmg 60 Float Amount of damage from NPC's frag.
sk_detenator_frag_npc_dmg_radius 200 Float Damage radius from NPC's frag.
sk_detenator_frag_elasticity 0.45 Float Frag's elasticity or how hard does it bounce. Multiplayer only.
sk_detenator_frag_gravity 400 Float Gravity scale for frag. Multiplayer only.
sk_detenator_frag_friction 0.2 Float Friction scale for frag. Doesn't work.

Black Mesa (mod) Black Mesa (mod)

Cvar/Command Parameters or default value Descriptor Effect
sk_plr_dmg_grenade_frag 100 Float Amount of damage from player's frag.
sk_npc_dmg_grenade_frag 50 Float Amount of damage from NPC's frag.

See Also