Page MenuHomeFeedback Tracker

HandleDamage is fired twice for the same bullet in two different frames.
Reviewed, WishlistPublic

Description

The event HandleDamage is fired always twice in two different frames for the same bullet.

As you can see in the log.
At 0.761 and at 0.797 the EventHandler was fired twice with exactly the same attributes. That happens with every fire.
Look at:
"T=0.761 : [B Alpha 1-1:1 (Nydi),"",0.104908,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"",0.104908,O Alpha 1-1:1,"B_65x39_Caseless_green"]" {F22593}

Details

Legacy ID
1809525827
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce

My EventHandler is programmed as function defined in CfgFunctions and added to a player.

Here is the code:

private ["_unit", "_selectionName", "_damage", "_source", "_projectile"];

_unit = _this select 0;
_selectionName = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;

diag_log format ["-------------HandleDamage-------------"];
diag_log format ["T=%1 : %2", time, _this];
diag_log format ["-------------HandleDamage End-------------"];

0;

--------

Just add that EventHandler to a player and let him shooten by a Enemy (KI or in MP a other Player). I did use the Workaround posted in http://feedback.arma3.com/view.php?id=6644 to avoid the BIS EventHandler and make the player invulnerable by returning 0. I do have the same behaviour in MP and SP.

Additional Information

Log of the EventHandler above.

"-------------HandleDamage-------------"
"T=0.761 : [B Alpha 1-1:1 (Nydi),"head",0,<NULL-object>,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.761 : [B Alpha 1-1:1 (Nydi),"",0.104908,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"",0.104908,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"head",0,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"body",0.167608,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"hands",0,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"
"-------------HandleDamage-------------"
"T=0.797 : [B Alpha 1-1:1 (Nydi),"legs",0.0568148,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"-------------HandleDamage End-------------"

Event Timeline

Nydidric edited Steps To Reproduce. (Show Details)Oct 25 2013, 5:58 AM
Nydidric edited Additional Information. (Show Details)
Nydidric set Category to Scripting.
Nydidric set Reproducibility to Always.
Nydidric set Severity to None.
Nydidric set Resolution to Open.
Nydidric set Legacy ID to 1809525827.May 7 2016, 5:13 PM

Some thoughts:

  • Similar/same as #13769
  • It could be hit vs indirectHit damage
  • With body penetration now possible in A3, this may cause multiple triggers

Ohh yes may you right, didn't found that issue sorry.

Xeno added a subscriber: Xeno.May 7 2016, 5:13 PM
Xeno added a comment.Oct 25 2013, 11:18 AM

The empty selections are the overall and diff damage (diff damage = new added damage).

But it's hard to determine which one is which as it sometimes happens that either overall or diff dam is triggered first.

A2/OA did just trigger the overall damage.

Thx Xeno for that information, but the overall and diff damage should not be the same, or do i missunderstand you?

There is a simple way to determinate double fired events. Store the last damage for every selection in variables, if the same value passes again for the same selection in less then around may 0.5 seconds it seems to be the same event fired a second time. Its very unlikly that two shoot are made within a short time with the same parameters.

Can you explain me the behaviour better. Do you mean the difference between the passed damage in the eventhandler and the already taken damage of the unit? Where is the reason to fire that event, it makes no sence to me in any case. According to Biki http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage the eventhandler could be used to create a own damagesystem, whats my goal. But in case of this behaviour it seems useless isn't it?

May I should make some more tests to get the behaviour, did you already do that and can you tell me your expirience?

Xeno added a comment.Oct 25 2013, 1:33 PM

Right, overall and diff are not the same (it's only the same if the overall damage of the object is zero, then both are obviously the same).

Currently it is not possible to create your own damage system.
Check other handleDamage tickets like for example the following one:
http://feedback.arma3.com/view.php?id=13769

Often it also fires a null object for the object which caused the damage.

Furthermore using a FAK also triggers the handleDamage event and don't forget that the BIS feedback system always adds a handleDamage EH to the player object:
http://feedback.arma3.com/view.php?id=6644

Okey thx, that brings me forward.

i could determinate, that the currently implemented damage system takes only the overall damage and only if the passed overall or diff damage is bigger then the damage of the object. As you can see in following log. The first logged array are the passed parameters to the event handler and the second is damage _unit; so the damage of the object, or already taken damage. It does not add the damage, it just overrides it if the value is bigger... as it seems. So that explains your commend, if the second fired event passes the new damage value and not the diff. i'm just confused and i get more confused if i try to calculate the damage by my self.
0.162457 + 0.0117777 + 0.0454517 + 0.0253255 + 0.0602934 = 0.3053053 and not 0.207909. But also the diff is not possible 0.162457 - (0.0117777 + 0.0454517 + 0.0253255 + 0.0602934) = 0.0196087.

"T=0.875 : [B Alpha 1-1:1 (Nydi),"head",0.0117777,<NULL-object>,"B_65x39_Caseless_green"]"
"T=0.875 : 0.162457"

"T=0.875 : [B Alpha 1-1:1 (Nydi),"",0.0454517,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.875 : 0.162457"

"T=0.875 : [B Alpha 1-1:1 (Nydi),"head",0.0253255,<NULL-object>,"B_65x39_Caseless_green"]"
"T=0.875 : 0.162457"

"T=0.875 : [B Alpha 1-1:1 (Nydi),"",0.0602934,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.875 : 0.162457"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"",0.207909,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.162457"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"head",0.0117777,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.207909"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"body",0.100372,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.207909"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"hands",0.152353,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.207909"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"",0.268202,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.207909"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"head",0.0253255,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.268202"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"body",0.196701,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.268202"

"T=0.892 : [B Alpha 1-1:1 (Nydi),"hands",0.163957,O Alpha 1-1:1,"B_65x39_Caseless_green"]"
"T=0.892 : 0.268202"

Still an issue?

Actually it's even worse on vehicles they go on being damaged after they are destroyed.

I've included a visual display of this, only one EVH is used with no loops.

It's worth watching as pictures say more than words.

Just watch the chopper AI will destroy it for you.

For full effect you may need to run it a few time as sometimes it doesn't kill the pilots and so doesn't crash.

I did a further test because I thought the spawned object could have been causing additional damage but it's not the issue.

Can you attach the pictures and a repro mission to this ticket?

Sorry I thought I had uploaded it, it is there now.
If you think this isn't related to the current topic I'll post a new thread.

No Pics as I can't use my A3 system for a day or two.

Xeno removed a subscriber: Xeno.May 29 2016, 8:03 PM