Item healthcharger: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Classifying as model entity)
 
(17 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Language subpage|item healthcharger}}[[File: item_healthcharger.png | right | 200px]]
{{LanguageBar}}
{{entity|type=e0|series=Half-Life 2|item_healthcharger}} This is the [[health]] charger which gradually replenishes player health on use, until empty or the player is at full health. A charger normally holds 50 health points, regardless of the difficulty setting.
{{tabsBar |main=Item_healthcharger}}
{{for|about=the point entity|the brush entity|<tt>[[func_healthcharger]]</tt>}}
{{this is a|model entity|name=item_healthcharger|game=Half-Life 2 series}}
{{CD|CNewWallHealth|file1=hl2/item_healthkit.cpp}}
[[File: item_healthcharger.png | right | 200px]]
This is the [[health]] charger which gradually replenishes player health on use, until empty or the player is at full health. A charger normally holds 50 health points, regardless of the difficulty setting.


{{ModernPlacementTip|{{clr}}
{{ModernPlacementTip|{{clr}}
Line 6: Line 11:
*To ensure that the player will gain health rather than lose it, place them in areas occluded from immediate danger, like constant enemy fire from helicopters or tanks. Consider however that, since the player is required to stare at the wall while they are using the charger, they can be used to create tension by placing them where an enemy might still reach the player. Note that chargers could also add good or bad stress to the player if they have to exterminate a load of enemies in a room which a health charger is placed before using it.}}
*To ensure that the player will gain health rather than lose it, place them in areas occluded from immediate danger, like constant enemy fire from helicopters or tanks. Consider however that, since the player is required to stare at the wall while they are using the charger, they can be used to create tension by placing them where an enemy might still reach the player. Note that chargers could also add good or bad stress to the player if they have to exterminate a load of enemies in a room which a health charger is placed before using it.}}


{{code class|CNewWallHealth|item_healthkit.cpp}}
{{Note|{{clr}}
__TOC__
* Players can't use it past the limit or maximum health points.
{{clr}}
* Player can use health chargers without suit.
* Default model: <code>models/props_combine/health_charger001.mdl</code>
}}
 
{{Bug|[[Kill|Killing]] a charger while it is being used will make the charging sound loop indefinitely.|hidetested=1}}
 
==Keyvalues==
{{KV Targetname}}
{{KV|Deathmatch recharge delay|intn=dmdelay|float|{{todo}}}}


== Notes ==
==Outputs==
* Players can't use it past the limit or maximum health points. ''Deny.'' Confirmed with {{hl2|4}}.
{{O|OutRemainingHealth|Remaining Health.}}
* Player can use health chargers without suit.
{{O|OnPlayerUse|Fired when the player tries to {{ent|+use}} the charger.}}


==ConVars/Commands==
==ConVars/Commands==
{{varcom|start}}
{{varcom|start}}
{{varcom|sk_healthcharger|50|Arbitrary number|Amount of health that can be gained from a single charger.}}
{{varcom|sk_healthcharger|50|Arbitrary number|Amount of health that can be gained from a single charger.}}
{{varcom|cl_hpcharg_light_col_r|255 {{Bms|4}}|Arbitrary number|Red color value for dynamic light from health chargers.}}
{{varcom|cl_hpcharg_light_col_g|0 {{Bms|4}}|Arbitrary number|Green color value for dynamic light from health chargers.}}
{{varcom|cl_hpcharg_light_col_b|0 {{Bms|4}}|Arbitrary number|Blue color value for dynamic light from health chargers.}}
{{varcom|cl_hpcharg_light_intensity|32 {{Bms|4}}|Arbitrary number|Intensity value for dynamic light from health chargers.}}
{{varcom|cl_hpcharg_light_on|1 {{Bms|4}}|Arbitrary number|Sets state of dynamic light spawn by health chargers. 0 - disallow to spawn, 1 - allow to spawn.}}
{{varcom|cl_hpcharg_light_range|64 {{Bms|4}}|Arbitrary number|Range value for dynamic light from health chargers.}}
{{varcom|cl_hpcharg_light_debug|0 {{Bms|4}}|Arbitrary number|Sets debug state of health chargers light.}}
{{varcom|sk_charger_health_rate|1 {{Bms|4}}|Arbitrary number|Sets treatment speed from health chargers.}}
{{varcom|sk_charger_refill_delay |15 {{Bms|4}}|Arbitrary number|Delay before refill for suit and health chargers in seconds. Multiplayer only.}}
{{varcom|end}}
{{varcom|end}}
==Keyvalues==
{{KV BaseAnimating|base=1}}
{{KV BaseEntity|base=1}}
==Inputs==
{{IO|Enable|param=void|Allows to use, sets skin 0, turns light on.|only=BMS}}
{{IO|Disable|param=void|Prevents to use, sets skin 1, turns light off.|only=BMS}}
{{IO|Fill|param=float|nofgd=1|Fills the charger with specified number if the charger is empty.|only=BMS}}
{{I BaseAnimating}}
{{I BaseEntity|base=1|prel4d=1}}
==Outputs==
{{IO|OutRemainingHealth|Remaining Health. Cut in {{Bms|4}}.}}
{{IO|OnPlayerUse|Fired when the player tries to {{ent|+use}} the charger. Cut in {{Bms|4}}.}}
{{IO|OnEmpty|Fired when the charger is empty.|only=BMS}}
{{IO|OnUse|Fired when the player tries to {{ent|+use}} the charger.|only=BMS}}
{{IO|OnTurnOff|nofgd=1|Fires on disable.|only=BMS}}
{{IO|OnTurnOn|nofgd=1|Fires on enable.|only=BMS}}
{{O BaseAnimating}}
{{O BaseEntity}}


==See also==
==See also==

Latest revision as of 04:32, 19 May 2025

English (en)Translate (Translate)
edit
This article is about the point entity. For the brush entity, see func_healthcharger.

item_healthcharger is a model entity available in Half-Life 2 series Half-Life 2 series.

C++ Class hierarchy
CNewWallHealth
CBaseAnimating
CBaseEntity
C++ item_healthkit.cpp
Item healthcharger.png

This is the health charger which gradually replenishes player health on use, until empty or the player is at full health. A charger normally holds 50 health points, regardless of the difficulty setting.

PlacementTip.gifPlacement Tip:
  • Rechargers are best placed with a height of around 48 units between the floor and the center of the recharger entity.
  • To ensure that the player will gain health rather than lose it, place them in areas occluded from immediate danger, like constant enemy fire from helicopters or tanks. Consider however that, since the player is required to stare at the wall while they are using the charger, they can be used to create tension by placing them where an enemy might still reach the player. Note that chargers could also add good or bad stress to the player if they have to exterminate a load of enemies in a room which a health charger is placed before using it.
Note.pngNote:
  • Players can't use it past the limit or maximum health points.
  • Player can use health chargers without suit.
  • Default model: models/props_combine/health_charger001.mdl
Icon-Bug.pngBug:Killing a charger while it is being used will make the charging sound loop indefinitely.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Deathmatch recharge delay (dmdelay) <float>
[Todo]

Outputs

OutRemainingHealth
Remaining Health.
OnPlayerUse
Fired when the player tries to +use the charger.

ConVars/Commands

Cvar/Command Parameters or default value Descriptor Effect
sk_healthcharger 50 Arbitrary number Amount of health that can be gained from a single charger.

See also