Combine mine: Difference between revisions
Hurricaaane (talk | contribs) |
m (Classifying as model entity) |
||
(49 intermediate revisions by 24 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{lang}} | ||
== | {{CD|CBounceBomb|file1=combine_mine.cpp}} | ||
[[ | [[File:Hl2 combine mine variants.jpg|300px|thumb|right|Combine Mine with the two painted rebel variants available only in EP2. (Unless taken from EP2 files and installed as a mod)]] | ||
[[File:Combine mine traceline.png|300px|thumb|right|Demonstration of the first bug. Once the mine has settled, it checks what is below it. Since there's a gap in the middle, the first thing the line encounters is the world.]] | |||
{{this is a|model entity|name=combine_mine|game=Half-Life 2 series}} Known as "hoppers" by citizens, these mines embed themselves into the ground and are agitated when a hostile target gets close. If the target gets too close, the mine will retract its arms and hop towards the target (similar to a bouncing betty), exploding upon contact with any surface. These mines can be carried and deployed by [[npc_clawscanner|Claw Scanners]]. | |||
Mines are friendly to most types of Combine units and attack anyone who they don't regard as a friend. If a friendly NPC/player is nearby, the mine's light will turn green and may refuse to bounce unless an enemy gets closer to it than the ally. | |||
Mines can be picked up by the [[weapon_physcannon|gravity gun]], after which they join the player's side and attack Combine units while regarding the player and their allies as friends. | |||
{{altnames|name1='''bounce_bomb'''|name2='''combine_bouncemine'''}} | |||
{{note|<code>combine_mine</code> is not actually a NPC. It's technically just a basic model entity ({{ent|CBaseAnimating}}) and doesn't use most NPC features, like [[ai_relationship|relationships]].}} | |||
{{note|To use the skins in base Half-Life 2 and Episode One, the model and its skins must be taken from the EP2 vpk files and installed like a regular mod to the game, to overwrite the model that does not support skins.<br>You can also manually add the keyvalue "Skin" in hammer or by editing the [[FGD]] file to cherry pick which exact skin you want to use, regardless of whether it's a combine or rebel mine.<br>If the mine is a rebel mine, and you want a specific skin, you must set the skin via the "skin" input after the mine spawns, else the skin is random.}} | |||
{{warning|Zombies, headcrabs, and antlions are always targeted by mines, but <code>combine_mine</code> uses a hardcoded list of Combine classes to be friendly towards by default and to be armed against while friendly to the player. Some Combine classes are missing from this list, most notably {{ent|npc_manhack}} and {{ent|npc_stalker}}, and as a result mines will mistakenly regard them as hostile to the Combine and friendly to the player. | |||
{{ModernFix|This list is located in <code>CBounceBomb::IsFriend()</code> and can be modified to accept the missing classes or even be replaced by a more robust system.|code}}}} | |||
{{ModernPlacementTip|Like all physics objects, this entity can collide with skybox brushes, so make sure your skybox has enough room for the <code>combine_mine</code> to be thrown into the sky without seemingly exploding randomly. (at least ~1024 units above the ground could work)}} | |||
{{bug|Mines determine if they are on solid ground by [[UTIL_TraceLine|drawing a line]] down from their center and checking if the line hits an entity or world geometry first. This can lead to them falsely interpreting the player's head or certain physics objects (or combinations of them) as the ground, causing them to float in the air when the player/object moves.{{ModernFix|This can be fixed in <code>CBounceBomb::SettleThink()</code> by changing the trace distance from 1024 units to something much smaller, like 8.|code}}}} | |||
{{stray ent|{{portal}}}} | |||
==Keyvalues== | ==Keyvalues== | ||
{{KV Targetname}} | |||
{{KV|Bounce|intn=bounce|bool|Whether the mine should bounce up in the air before exploding. (Normally they do, to improve their damage on infantry, but things like very soft clamping surfaces and additional attachments, may make hopping look unrealistic.)}} | |||
{{KV|Lock Silently|intn=LockSilently|bool|Whether the mine plays a sound when its clamps close.}} | |||
{{KV|Start Disarmed|intn=StartDisarmed|bool|Whether the mine begins dormant.}} | |||
{{KV|Citizen modified|intn=Modification|integer|'Normal' is default Combine behavior. 'Cavern' (used in [[This Vortal Coil]]) detonates earlier in its jump, and in Episode 2 has a different default skin.}} | |||
==Inputs== | ==Inputs== | ||
{{I|Disarm|Disarm this mine (open hooks and shut off) if not placed by player.}} | |||
==Outputs== | ==Outputs== | ||
{{O|OnPulledUp|Fired when this mine is uprooted with the gravity gun.}} | |||
[[Category:Immobile NPCs]] | |||
[[Category: | [[Category:Half-Life 2 NPCs]] | ||
[[Category:Half-Life 2 Weapons]] |
Latest revision as of 04:30, 19 May 2025
![]() |
---|
CBounceBomb |
![]() |
combine_mine
is a model entity available in Half-Life 2 series. Known as "hoppers" by citizens, these mines embed themselves into the ground and are agitated when a hostile target gets close. If the target gets too close, the mine will retract its arms and hop towards the target (similar to a bouncing betty), exploding upon contact with any surface. These mines can be carried and deployed by Claw Scanners.
Mines are friendly to most types of Combine units and attack anyone who they don't regard as a friend. If a friendly NPC/player is nearby, the mine's light will turn green and may refuse to bounce unless an enemy gets closer to it than the ally.
Mines can be picked up by the gravity gun, after which they join the player's side and attack Combine units while regarding the player and their allies as friends.

bounce_bomb
and combine_bouncemine
. 
combine_mine
is not actually a NPC. It's technically just a basic model entity (CBaseAnimating) and doesn't use most NPC features, like relationships.
You can also manually add the keyvalue "Skin" in hammer or by editing the FGD file to cherry pick which exact skin you want to use, regardless of whether it's a combine or rebel mine.
If the mine is a rebel mine, and you want a specific skin, you must set the skin via the "skin" input after the mine spawns, else the skin is random.

combine_mine
uses a hardcoded list of Combine classes to be friendly towards by default and to be armed against while friendly to the player. Some Combine classes are missing from this list, most notably npc_manhack and npc_stalker, and as a result mines will mistakenly regard them as hostile to the Combine and friendly to the player.

CBounceBomb::IsFriend()
and can be modified to accept the missing classes or even be replaced by a more robust system.
combine_mine
to be thrown into the sky without seemingly exploding randomly. (at least ~1024 units above the ground could work)

CBounceBomb::SettleThink()
by changing the trace distance from 1024 units to something much smaller, like 8.
Keyvalues
- Name (targetname) <string>[ Edit ]
- 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
- Bounce (bounce) <boolean>
- Whether the mine should bounce up in the air before exploding. (Normally they do, to improve their damage on infantry, but things like very soft clamping surfaces and additional attachments, may make hopping look unrealistic.)
- Lock Silently (LockSilently) <boolean>
- Whether the mine plays a sound when its clamps close.
- Start Disarmed (StartDisarmed) <boolean>
- Whether the mine begins dormant.
- Citizen modified (Modification) <integer>
- 'Normal' is default Combine behavior. 'Cavern' (used in This Vortal Coil) detonates earlier in its jump, and in Episode 2 has a different default skin.
Inputs
- Disarm
- Disarm this mine (open hooks and shut off) if not placed by player.
Outputs
- OnPulledUp
- Fired when this mine is uprooted with the gravity gun.