Jump to content
Sign in to follow this  
redarmy

Event Handler for Handle Damage

Recommended Posts

Using this in a units init is properly calculating the damage and setting it at the correct value when its concerning small arms fire. But a unit being hit from a  .50 cal still takes the normal amount of damage.

 

Can someone help me understand this by breaking down how it is actually calculating?

 

this addEventHandler [ 
 "HandleDamage",  
 {  
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; 
 
  private _previousDamage = [_unit getHit _selection, damage _unit] select (_selection isEqualTo "");   
  private _newDamage = _damage - _previousDamage; 
 
  (_previousDamage + _newDamage * 0.1) 
 } 
];

 

Share this post


Link to post
Share on other sites

It is possible that .50 cal causes so much damage that multiplying it by 0.1 doesn't make enough difference. See this post:

You can use something like this to get a better understanding of how it's calculated:

systemChat format [
  "_selection=%1, _previousDamage=%2, _newDamage=%3, return=%4",
  _selection,
  _previousDamage toFixed 4,
  _newDamage toFixed 4,
  (_previousDamage + _newDamage * 0.1) toFixed 4
];

 

Share this post


Link to post
Share on other sites
23 minutes ago, _foley said:

It is possible that .50 cal causes so much damage that multiplying it by 0.1 doesn't make enough difference. See this post:

You can use something like this to get a better understanding of how it's calculated:


systemChat format [
  "_selection=%1, _previousDamage=%2, _newDamage=%3, return=%4",
  _selection,
  _previousDamage toFixed 4,
  _newDamage toFixed 4,
  (_previousDamage + _newDamage * 0.1) toFixed 4
];

 

Thanks for that. Yeah i was fairly sure that this was the reason,im just not sure how Arma handles damage across different munitions,fall,impacts etc. A quick look and i think what im trying to achieve would be impossible. if i modify the damage reduction to make AI resistant to a few .50 cal rounds,they will end up not taking any damage from small arms.

 

The whole point of this is to try to simulate a well trained force surviving multiple kinds of contact,as it is in Arma,an AI gunner no matter what skill,or health,will accurately one shot a guy a mile away,even with the help of Lambs turrets mod. Been looking to a solution to this for a very long time,it seems one doesnt exist.

 

Oh well

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×