Func healthcharger: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 Important:Unlike its Half-Life: Source counterpart, this entity has no visual indication of when it is depleted.
Important:Unlike its Half-Life: Source counterpart, this entity has no visual indication of when it is depleted.
 Code Fix:Do both of the following:
Code Fix:Do both of the following:
 Bug:Killing a charger while it is being used will make the charging sound loop indefintely.
Bug:Killing a charger while it is being used will make the charging sound loop indefintely.
 Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
		
	
| SirYodaJedi (talk | contribs) mNo edit summary | Le Glaconus (talk | contribs)   (charging sound bug) | ||
| (One intermediate revision by one other user not shown) | |||
| Line 10: | Line 10: | ||
| # Add {{code|[[SetTextureFrameIndex]](1)}} to {{mono|CWallHealth::Off()}}   | # Add {{code|[[SetTextureFrameIndex]](1)}} to {{mono|CWallHealth::Off()}}   | ||
| This will make all textures on the brush with the [[List Of Material Proxies#Entity integration|ToggleTexture]] material proxy use frame 0 when charge is remaining, and frame 1 when the charger is depleted.}}}} | This will make all textures on the brush with the [[List Of Material Proxies#Entity integration|ToggleTexture]] material proxy use frame 0 when charge is remaining, and frame 1 when the charger is depleted.}}}} | ||
| {{Bug|[[Kill|Killing]] a charger while it is being used will make the charging sound loop indefintely.|hidetested=1}} | |||
| ==Keyvalues== | ==Keyvalues== | ||
| Line 17: | Line 19: | ||
| ==Outputs== | ==Outputs== | ||
| {{ | {{O|OutRemainingCharge|param=float|Fires once for ''every single'' point of health given to the player. That means it will not fire when the charger is depleted or when the player is at full health. {{outadd|the amount of points remaining in the charger{{confirm}}}}}} | ||
| {{ | {{O|OnPlayerUse|Fired when the player tries to {{ent|+use}} the healthcharger.}} | ||
| ==See also== | ==See also== | ||
| *{{ent|func_recharge}}, a brush-based recharger meant for suit power. | *{{ent|func_recharge}}, a brush-based recharger meant for suit power. | ||
Latest revision as of 14:37, 16 May 2025
|  Class hierarchy | 
|---|
| CWallHealth | 
|  item_healthkit.cpp | 
This article is about the brush entity. For the point entity, see item_healthcharger.
func_healthcharger  is a   brush entity  available in  Half-Life 2 series. A brush-based version of item_healthcharger.
 Half-Life 2 series. A brush-based version of item_healthcharger.
 Important:Unlike its Half-Life: Source counterpart, this entity has no visual indication of when it is depleted.
Important:Unlike its Half-Life: Source counterpart, this entity has no visual indication of when it is depleted.
 Code Fix:Do both of the following:
Code Fix:Do both of the following:
- Add SetTextureFrameIndex(0)to CWallHealth::Recharge() and CWallHealth::Spawn()
- Add SetTextureFrameIndex(1)to CWallHealth::Off()
 Bug:Killing a charger while it is being used will make the charging sound loop indefintely.
Bug:Killing a charger while it is being used will make the charging sound loop indefintely.Keyvalues
 Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentnameortarget).
 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) <integer>
Outputs
- OutRemainingCharge <float>
- Fires once for every single point of health given to the player. That means it will not fire when the charger is depleted or when the player is at full health. This output automatically puts the amount of points remaining in the charger[confirm] into the parameter box for inputs, if the mapper does not override the parameter with something else.
- OnPlayerUse
- Fired when the player tries to +use the healthcharger.
See also
- func_recharge, a brush-based recharger meant for suit power.
