Page MenuHomeFeedback Tracker

getHit command
Closed, ResolvedPublic

Description

It would be great to have a <b>getHit</b> command to retrieve the damage of specific selections, in order to work in tandem with selection names returned in the <b>HandleDamage</b> event handler.

getHitPointDamage is NOT appropriate for that, as it only works with config hitpoints and not raw selection names.

This command has been requested for many years, but has never been implemented so far.

Details

Legacy ID
1689259237
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Feature Request

Event Timeline

AgentRev edited Steps To Reproduce. (Show Details)Apr 3 2014, 3:31 PM
AgentRev edited Additional Information. (Show Details)
AgentRev set Category to Feature Request.
AgentRev set Reproducibility to Always.
AgentRev set Severity to None.
AgentRev set Resolution to Fixed.
AgentRev set Legacy ID to 1689259237.May 7 2016, 6:20 PM

Indeed, such command would be extremely useful. At the moment you have to parse entire vehicle config for hitpoints as well as hitpoints of all parent classes but it still doesn't tell you the full picture as for instance human vehicles have special cases like:
HitLegs changes\returns damage for "leg_l"
HitHands changes\returns damage for "hand_l"
even though config has "legs" for "HitLegs" and "hands" for "HitHands"

This command is absolutely needed to work with HandleDamage EH.

EDIT : I see some people making their own "gethit" implementation using set/getVariable on the unit.
But we still need the command !

can the getHitPointDamage command be simply modified to read selections instead of hitpoints if modifying VBS source is a problem?

The get/setVariable method for storing selection damage isn't even viable, since the values become incorrect if someone repairs the vehicle using a toolkit, or if setDamage is called on the vehicle, not to mention you have to "setVariable true" them in case the locality of the vehicle changes.

Unfortunately, you are absolutely right :(
This is not a viable solution.

Bumping this ticket. This essential command is still missing!

It works good. Thanks.

It if can help, here is how to ignore damage on a specific condition.
When selection is empty, we need to use the command "damage.

_unit addEventHandler ["HandleDamage",
{
private ["_unit", "_selection", "_damage", "_source"];

_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
_source = _this select 3;

if (<CONDITION WHEN NOT TAKE INTO ACCOUNT DAMAGE>) then
{

		if (_selection == "") then
		{
			damage _unit // No selection, return previous damage value
		}
		else
		{
			_unit getHit _selection // Return previous getHit value
		};

}; // No "else", returning no value will let other event handlers handle the damage
}];

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.