Jump to content
celery

HandleDamage EH explained (+poor man's getHit)

Recommended Posts

HandleDamage event handler explained

There has been little documentation about how the "HandleDamage" event handler exactly works and as a consequence its use has been scarce and its potential untapped. I myself understood it properly only recently while perfecting the damage model for an upcoming zombie mission. So here goes.

The passed array

_this select 0: Unit the EH is assigned to

_this select 1: Selection (=body part) that was hit

_this select 2: Damage to the above selection (sum of dealt and prior damage)

_this select 3: Source of damage (returns the unit if no source)

_this select 4: Ammo classname of the projectile that dealt the damage (returns "" if no projectile)

Infantry selections

"": The overall damage that determines the damage value of the unit. Unit dies at damage over 0.9.

"head_hit": Unit dies at damage over 0.9.

"body": Unit dies at damage over 0.9.

"hands": Unit doesn't die with damage to this part.

"legs": Unit doesn't die with damage to this part.

The "" part is the reason why consecutive leg hits are fatal. Whenever the unit is hit, "" gets damage based on the power of the hit with no other modifiers. Wherever you hit the unit, it will die when this overall damage quota is up. You will notice that when shooting at a unit's feet (with e.g. a Makarov) it will almost always die after the same amount of rounds.

How the EH fires

The event handler fires multiple times at the same time when the unit is damaged, once for each selection. The sequence is always the same, the sequence for infantry being the same as in the selection list above. Only the current selection and its damage are remembered during each activation unless you assign variables to them. If a selection is not damaged at all and there are no damaged selections after it in the sequence (e.g. a shot in the head without damage to legs), the EH doesn't fire for that selection.

Manipulating damage

The last value given in the EH's code is the damage that it gives for the current selection. For example, this addEventHandler ["HandleDamage", {_this select 2}] will have a unit receive damage as if it didn't have the event handler at all. Changing _this select 2 to 1 will make the unit die however minor the original damage was, while this addEventHandler ["HandleDamage", {}] makes the unit invulnerable to all damage. You can allow damage to specific selections by passing a damage value if the selection is of a certain type: this addEventHandler ["HandleDamage", {if (_this select 1 in ["head_hit", "legs"]) then {_this select 2}}] will pass only the damage that the head and legs were dealt. If the code is too complex to be written into the EH itself, only callable scripts should be used for the purpose of determining damage because the damage has to be given in the EH's code.

Poor man's getHit

Until BI is kind enough to give us a command to return the damage of individual selections, HandleDamage is the best workaround. This EH will assign the "gethit" variable to a unit. As a bonus, there's a damage modifier included free of charge, just change the blue value!

Add this to a unit:

_unit setVariable ["selections", []];
_unit setVariable ["gethit", []];
_unit addEventHandler
[
"HandleDamage",
{
	_unit = _this select 0;
	_selections = _unit getVariable ["selections", []];
	_gethit = _unit getVariable ["gethit", []];
	_selection = _this select 1;
	if !(_selection in _selections) then
	{
		_selections set [count _selections, _selection];
		_gethit set [count _gethit, 0];
	};
	_i = _selections find _selection;
	_olddamage = _gethit select _i;
	_damage = _olddamage + ((_this select 2) - _olddamage) * [b][color="#0000FF"]1[/color][/b];
	_gethit set [_i, _damage];
	_damage;
}
];

To get the damage of a selection:

_index = _unit getVariable ["selections", []] find [color="#B22222"]"nameofselection"[/color];
_damage = if (_index >= 0) then
{
_unit getVariable "gethit" select _index;
}
else
{
0;
};

Remember that event handlers will carry on to respawned units as do setVariables, so the "selections" and "gethit" variables should be set to [] again at respawn as well as when the unit gets healed or repaired.

Edited by Celery
  • Like 2

Share this post


Link to post
Share on other sites

Celery, I want to have your babies. No homo.

(By that I mean to say: thank you for this awesome explanation and script snippet! :D)

Share this post


Link to post
Share on other sites

I have found one exception to using HandleDamage that bothers me a bit. Maybe you or someone knows a solution.

Add a HandleDamage event handler to a unit in the player's group, and don't apply any damage. Something like this:

dude addeventhandler ["HandleDamage",{ player globalChat format ["T=%1 : %2", time, _this]; } ];

Normally this will prevent any damage to that unit.

Now sync the First Aid Simulation module to any member of the group. Then shoot the unit that was given the event handler. The unit will typically max out at 0.899 damage, and if you keep shooting, the unit will die.

If the unit is not part of the group with the first aid module, then the unit takes no damage. Or if First Aid Sim is not used, no damage. Obviously it has something with the way that module works, just trying to figure out if there's a workaround. :D

Share this post


Link to post
Share on other sites
I have found one exception to using HandleDamage that bothers me a bit. Maybe you or someone knows a solution.

Add a HandleDamage event handler to a unit in the player's group, and don't apply any damage. Something like this:

dude addeventhandler ["HandleDamage",{ player globalChat format ["T=%1 : %2", time, _this]; } ];

Normally this will prevent any damage to that unit.

Now sync the First Aid Simulation module to any member of the group. Then shoot the unit that was given the event handler. The unit will typically max out at 0.899 damage, and if you keep shooting, the unit will die.

If the unit is not part of the group with the first aid module, then the unit takes no damage. Or if First Aid Sim is not used, no damage. Obviously it has something with the way that module works, just trying to figure out if there's a workaround. :D

The module itself seems to add a HandleDamage EH to every group member, and the non-damage EH can't stop that one from passing damage. If you want a unit to receive no damage, allowDamage might be the thing you want, or in another case you might try having the unit join the group afterwards.

Share this post


Link to post
Share on other sites

That is totally awesome, thanks Celery. When I have a unit joinSilent, as opposed to being grouped in the editor, he remains invincible.

I have a mission where I want one soldier to survive, and I wrote a script that handles his damage, and simulates injury and recovery on him. It's fairly simple, but keeps him from looking like a god. So it looks like he can joinSilent after the fact and it should work. Thanks.

Share this post


Link to post
Share on other sites

Its an old thread, but the subject is very specific ......

Problem;

The damage value delivered (by the EH) with each hit seems to be somewhat disconnected from the weapon used.

From some testing on vehicles with custom HitPoints, all standardised to armor = 1, I find a 9mm pistol will do more damage than a 50cal sniper rifle ! (1 hit = approx 0.1 vs 0.04)

With a variety of large and small weapons (including static) it seems to take almost exactly the same number of shots & hits to reach a predetermined total damage (eg 1.0) .

The exception being a few weapons like the 9mm pistol.

Looking at Ammo hit and indirect hit values would suggest the EH output should vary a LOT more.

Does anyone know whats actually determining this somewhat insular per-hit value?

Share this post


Link to post
Share on other sites

Oddly, if I pass the damage value back to the unit (ie Return to the EH the damage (select 2), adds to total "base" damage ) I seem to get far more amplified hit damage (values). But I can't see why I get amplified damage because the custom handledamage SQF is not running any more often, and the "base" damage thats being clocked up now (via the return) is not any larger.

Some developer guidance would be nice :D pretty please

Share this post


Link to post
Share on other sites

Hi

I too would like to know about this event handler, as I am using a respawn script to respawn a vehicle where it has been destroyed, ok this works fine, I setdammage 0.9 but the vehicle still drives, I would like to set the damage to say the wheels/tracks so the vehicle needs repair before it can be driven again.

I have searched and this is the nearest I have gotten to finding some information on this subject.

I am thinking that this script clipping by celery

this setVariable ["gethitlegs",0,false];this addEventHandler ["HandleDamage",{if (_this select 1=="legs") then {_this select 0 setVariable ["gethitlegs",_this select 2,false]};_this select 2}]

would this work for a vehicle are the legs the wheels/tracks or is this just specific to troops??

RK

---------- Post added at 03:20 AM ---------- Previous post was at 03:03 AM ----------

Me again, I was barking up the wrong tree just found a variable "sethit" this will do the job I want.

thanks anyway :)

RK

Share this post


Link to post
Share on other sites

Updated the first post with a superior getHit.

Share this post


Link to post
Share on other sites

Hi, I would still consider myself a scripting noob, and I have been trying to fool around with this with no avail. I Have this running for a unit.

_unit = _this select 0;
_unit addEventHandler
[
"HandleDamage",
{
	_unit = _this select 0;
	_vanilla = _this select 2;
	_damage = _vanilla/2;
	_damage;
}
];

I figured this would apply half as much damage to the hit unit but it seems to make the unit totally invincible instead. Why is that, and what am I doing wrong?

Also, in the gethit example, what exactly are the variables (gethit and selections) for. I have a feeling I am totally misunderstanding how this thing works. Thanks for any help and patience.

Share this post


Link to post
Share on other sites

I used setHit on a unit's init to give him a bloody face / body and now I'm trying to deal with the changed damage.

hndlDmg={
_unit = _this;
_unit removeAllEventhandlers "handleDamage";
{
	_unit setVariable [_x,0,false];
}forEach ["CUEL_legDamage","CUEL_legDamage","CUEL_totalDamage"];
{
	_unit setVariable [_x,-0.6,false];
}forEach ["CUEL_handDamage","CUEL_headDamage","CUEL_bodyDamage"];

sleep 0.1;
_unit addEventHandler
[
	"HandleDamage",
	{
		_unit = _this select 0;
		_hitLocation = _this select 1;
		_damage = _this select 2;
		_dead = false;
		if(_damage <= 0.1) exitWith {};  
		switch (_hitLocation) do {
			case "legs": {_totalDamage = (_unit getVariable "CUEL_legDamage") + _damage/20; _unit setVariable ["CUEL_legDamage", _totalDamage, false];};
			case "hands": {	_totalDamage = (_unit getVariable "CUEL_handDamage") + _damage/40; _unit setVariable ["CUEL_handDamage", _totalDamage, false];};
			case "head_hit": {_totalDamage = (_unit getVariable "CUEL_headDamage") + _damage;  _unit setVariable ["CUEL_headDamage", _totalDamage, false];};
			case "body": {_totalDamage = (_unit getVariable "CUEL_bodyDamage") + _damage; _unit setVariable ["CUEL_bodyDamage", _totalDamage, false];};
			default{_totalDamage = 0.01+((_unit getVariable "CUEL_totalDamage")+(_damage*0.05));_unit setVariable ["CUEL_totalDamage",_totalDamage,false];}
		};
		_overallDamage = ((_unit getVariable "CUEL_legDamage") + (_unit getVariable "CUEL_handDamage") + (_unit getVariable "CUEL_headDamage") + (_unit getVariable "CUEL_bodyDamage"));
		_unit setVariable ["CUEL_totalDamage", _overallDamage, false];
		{
			if ((_unit getVariable _x) > 0.2) then {player sidechat format ["HIT: %1 -- DMG : %2",_x,(_unit getVariable _x)]};
		}forEach ["CUEL_handDamage","CUEL_headDamage","CUEL_bodyDamage","CUEL_legDamage","CUEL_legDamage","CUEL_totalDamage"];

		if (((_unit getVariable "CUEL_headDamage")> 1.2) ||((_unit getVariable "CUEL_bodyDamage")> 3) || (_overallDamage > 10))  then {_dead = true;};
		if _dead then {_unit removeAllEventHandlers "handleDamage";_unit setDamage 1;};
		0
	}
];
};

This works but it's very hard to get it "good". It seems very random and it will also trigger at least twice per shot, my guess is one time per hit selection.

If I shoot the guy in the body it will also add damage to "head_hit" from time to time which I find very weird.

Any ideas?

Share this post


Link to post
Share on other sites

Where you mentioned...

"": The overall damage that determines the damage value of the unit. Unit dies at damage over 0.9.

Is there any way to block the overall damage, but still allow the player to take damage to the parts of the body?

It seems like a strange questions to be asking, but I am using your script and set it so the player damage is reduced to 0.5, but the overall damage is causing the unit to die before the selections damage reaches >9. I've even tried setting the damage to 0.1 just to test it and used hint messages to report the players health, but the overall damage still kills the player before the damage hints show the damage being low enough to kill the player.

This is how I applied the hint messages. It simply displays a hint that says "Health: 100" through "Health: 0" (dead). The word "Health:" changes color as the player takes more damage.

_unit addEventHandler 
[
"Hit",
{
	_dam = getDammage _unit;
	_hp = 1;
	_dif = _hp - _dam;
	_total = _dif * 100;
	_total_rounded = round _total;

	if ((_total_rounded <100) && (_total_rounded >80)) then {
		// Green "Health:"
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#00FF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <80) && (_total_rounded >60)) then {
		// YellowGreen "Health:"	
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#CCFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	}; 
	if ((_total_rounded <60) && (_total_rounded >40)) then {
		// Yellow "Health:"
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FFFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <40) && (_total_rounded >20)) then {
		//Orange "Health:"
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF9900'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <20) && (_total_rounded >0)) then {
		// Red "Health:"
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if (!alive _unit) then {
		// Red "Health:"
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> 0</t>"]];
	};       
}
];

// this part is for if you want a cool head_hit sound to play. I made my own "DING" sound for it
//_unit addEventHandler ["Dammaged",{if (_this select 1 == "head_hit") then {_unit say3D "headhit"};}];

//In my medkit script I use this to reset the damage:
//	_unit setVariable ["selections", []];
//      _unit setVariable ["gethit", []];

Share this post


Link to post
Share on other sites
Is there any way to block the overall damage, but still allow the player to take damage to the parts of the body?

if (_this select 1 != "")

Share this post


Link to post
Share on other sites

Sorry, I really am trying to learn how to do this correctly. I tried adding it a few different ways, but it didn't work for me. Where would I add that exactly?

---------- Post added at 08:20 PM ---------- Previous post was at 07:57 PM ----------

Here's my sample mission. Everything is working except I need to add the part that blocks the overall damage. In the sample mission you can see how my health hints appear and change in color as more damage is taken, and you can also hear your head go "DING" when the enemy shoots you in the head, lol, but best of all the health hints that I made work great, which I am kind of proud of since I never used "round" before in a script and with it I was able to figure out how to flip the damage taken - into health remaining hints starting from 100.

SAMPLE MISSION

If I can get it to block the overall damage, I can then apply this sample mission to the mission I am currently working that is near completion and expand it to work for all 14 coop players. I was thinking of maybe setting it so the players take a damage of 0.33, which I am guessing would be 1/3 the amount of damage they would normally take.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Place the if statement to the very beginning of the EH's code, that way it doesn't execute if the selection is "".

Share this post


Link to post
Share on other sites

I'm not having any luck. I feel like a pain it the ass, but could you show me where it goes? This is the script for player s1:

s1 setVariable ["selections", []];
s1 setVariable ["gethit", []];

s1 addEventHandler 
[
"HandleDamage",
{

	s1 = _this select 0;
	_selections = s1 getVariable ["selections", []];
	_gethit = s1 getVariable ["gethit", []];
	_selection = _this select 1;
	if !(_selection in _selections) then
	{
		_selections set [count _selections, _selection];
		_gethit set [count _gethit, 0];
	};    
	_i = _selections find _selection;
	_olddamage = _gethit select _i;
	_damage = _olddamage + ((_this select 2) - _olddamage) * 0.1;
	_gethit set [_i, _damage];
	_damage;
}
];

* 0.1; ...is just for testing purposes

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites
s1 setVariable ["selections", []];
s1 setVariable ["gethit", []];

s1 addEventHandler 
[
"HandleDamage",
{
	if (_this select 1 != "") then
	{
		_unit = _this select 0;
		_selections = _unit getVariable ["selections", []];
		_gethit = _unit getVariable ["gethit", []];
		_selection = _this select 1;
		if !(_selection in _selections) then
		{
			_selections set [count _selections, _selection];
			_gethit set [count _gethit, 0];
		};    
		_i = _selections find _selection;
		_olddamage = _gethit select _i;
		_damage = _olddamage + ((_this select 2) - _olddamage) * 0.1;
		_gethit set [_i, _damage];
		_damage;
	};
}
];

Share this post


Link to post
Share on other sites

That's exactly how I did try to add it, but it doesn't work for some reason. I did copy and paste the script you posted above just to make sure. I seem to die pretty fast and none of my hint messages appear except for the hint I get when I die that says "Health: 0". Hmm. I really appreciate the help you are giving me. Is there maybe some other way to block it?

---------- Post added at 09:07 PM ---------- Previous post was at 09:01 PM ----------

I'm not positive, but I think I got it working. Now I don't die until the health hints reach 0.

I changed

if (_this select 1 != "")

to be

 if (_this select 1 == "")

Share this post


Link to post
Share on other sites

Nice that you got what you wanted, but it seems that you wanted to block everything except overall damage.

Share this post


Link to post
Share on other sites

Ok, so this is what I have right now with the

if (_this select 1 == "")

The result is that all head, body, hands and legs seem to be blocked and only the overall damage is calculated. This causes my head_hit sound not to play at all and the player s1 never looks bloody, but otherwise it seems to work, but not the way I want it to. If I change it to be

if (_this select 1 != "")

then the script breaks some how and the player dies very fast and none of the hint messages appear except for when I die.

player named s1

Trigger:

Radius: 0

Activation: None

Condition: alive s1;

On Act: null = [s1] execVM "s1_damage.sqf"

s1_damage.sqf:

s1 setVariable ["selections", []];
s1 setVariable ["gethit", []];

s1 addEventHandler ["Dammaged",{if (_this select 1 == "head_hit") then {s1 say3D "headhit"};}];

s1 addEventHandler 
[
"HandleDamage",
{
	[color=red]if (_this select 1 != "") then[/color] // Not working correctly
	{
		_unit = _this select 0;
		_selections = _unit getVariable ["selections", []];
		_gethit = _unit getVariable ["gethit", []];
		_selection = _this select 1;
		if !(_selection in _selections) then
		{
			_selections set [count _selections, _selection];
			_gethit set [count _gethit, 0];
		};    
		_i = _selections find _selection;
		_olddamage = _gethit select _i;
		_damage = _olddamage + ((_this select 2) - _olddamage) * 0.1;
		_gethit set [_i, _damage];
		_damage;
	};
}
];

s1 addEventHandler 
[
"Hit",
{
	_dam = getDammage s1;
	_hp = 1;
	_dif = _hp - _dam;
	_total = _dif * 100;
	_total_rounded = round _total;

	if ((_total_rounded <100) && (_total_rounded >80)) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#00FF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <80) && (_total_rounded >60)) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#CCFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	}; 
	if ((_total_rounded <60) && (_total_rounded >40)) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FFFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <40) && (_total_rounded >20)) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF9900'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <20) && (_total_rounded >0)) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if (!alive s1) then {
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> 0</t>"]];
	};       
}
];

* 0.1; ...is just for testing purposes.

I don't know what to do now. I just want to block the overall damage and have everything else work correctly.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Play as another unit and shoot your guy in the leg. If he can take countless hits without dying, the EH is working exactly as it should: block overall damage. More than 0.9 damage to the head or body still kills you, and the head is very sensitive to damage in the first place, which is why the AI kills you in seconds.

Share this post


Link to post
Share on other sites

For now, I went back to adding the script directly into the player init just to test the important part of the script.

So I added just this into the player init of s1:

this setVariable ["selections", []];
this setVariable ["gethit", []];
this addEventHandler 
[
"HandleDamage",
{
	if (_this select 1 != "") then
	{
		_unit = _this select 0;
		_selections = _unit getVariable ["selections", []];
		_gethit = _unit getVariable ["gethit", []];
		_selection = _this select 1;
		if !(_selection in _selections) then
		{
			_selections set [count _selections, _selection];
			_gethit set [count _gethit, 0];
		};    
		_i = _selections find _selection;
		_olddamage = _gethit select _i;
		_damage = _olddamage + ((_this select 2) - _olddamage) * 0.1;
		_gethit set [_i, _damage];
		_damage;
	};
}
];

And like you said, it does work correctly, but... then I run into a problem where the script conflicts with my health hint messages script.

---------- Post added at 11:35 PM ---------- Previous post was at 11:27 PM ----------

This part just shows hint messages for the remaining health of the player and can also be added directly into the players init and it works fine, but it will not work if it is used in conjunction with the script above. Separately they both work great. I need to find out a way were they can both work together. Do you have any idea why they conflict? What I would like to do is have them both be executed from 1 sqf file and not have to insert the script directly into the players init, but anyway I can get this to work would be fine.

this addEventHandler 
[
"Hit",
{
	_unit = _this select 0;
	_dam = getDammage _unit;
	_hp = 1;
	_dif = _hp - _dam;
	_total = _dif * 100;
	_total_rounded = round _total;
	if ((_total_rounded <100) && (_total_rounded >80)) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#00FF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <80) && (_total_rounded >60)) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#CCFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	}; 
	if ((_total_rounded <60) && (_total_rounded >40)) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FFFF00'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <40) && (_total_rounded >20)) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF9900'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if ((_total_rounded <20) && (_total_rounded >0)) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> %1</t>", _total_rounded]];
	};
	if (!alive _unit) then 
	{
		hintSilent composeText [parsetext format["<t size='1.2' align='center' color='#FF0000'>Health:</t><t size='1.2' align='center' color='#FFFFFF'> 0</t>"]];
	};       
}
];

---------- Post added at 11:48 PM ---------- Previous post was at 11:40 PM ----------

Then, lastly, there is my headshot sound "ding" that I also want to have play when the player gets hit in the head. Which also seems to conflict with the first EH script. For testing purposes the "say3D" part could simply be replaced with some title text on the screen or globalchat message. But if you can figure out how to get all 3 of these scripts to work together, from 1 sqf file if possible, I will name my firstborn child "Lord Celery".

this addEventHandler 
[
"Dammaged",
{
               _unit = _this select 0;
	if (_this select 1 == "head_hit") then
	{
		_unit say3D "headhit";
	};
}
];

I also need to figure out how to make the hints private.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

hints are local, so just run then on clients you want to see them, ie not from a trigger. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×