Closed ghost closed 4 years ago
So I dug around the code but couldn't find any point where using the FAK is handled. From as far as I could gather information FAK healing only to 75% is ArmA vanilla, although I still don't know how this triggers the update of damage in the database, maybe this is just a side-effect of some other function or handler. I came up with an idea about adding a new event handler for the HandleHeal event, but as it's doc says it's a) somewhat broken (don't know what this means) and b) is triggered when healing (FAK or even Medkit maybe) starts, not when it's finished. There seem to be a way to handle healing with a custom script instead of let the engine do it's vanilla thing, but I guess it's a bit overkill to handle healing (in maybe several different ways) in a script just to trigger a hudupdate afterwards. Anyone any other ideas?
So the handleHeal EVH is a bit weird, with it firing on the start of a heal action - however it does show an example which could be utilised with waiting for the original damage to be not equal to the new damage, then running the HUD update.
My concern about the HandleHeal EVH is this: Both the FirstAidKit and the Medkit and their mechanics are vanilla - so "breaking" them by replicating their actions within a custom EVH (although I don't see a way to get what type of item is used - maybe there's a way to get the used item by inspecting the _healer object - but the BI wiki doesn't give any further explanation about the inner structure of the specific subtype) and return "true" (which has to be done as otherwise the engine would perform a second heal) this would break other custom EVH added at a later point (as I guess they won't be run when some previous EVH returns true and hence stops further propagating of the event). So, I guess it's up to whoever is in charge of decide about breaking changes when the framework is pushed from current v5.x to next major v6.x. I'll give it a try when I'm back home (as said: currently wedding of my sister) to test what may can be done. I also have to investigate further how to check an objects subtype and get informations of its structure to see if there's even a way to get any information about the used item. If there isn't this idea is dead already as there would be no way to distinguish between the two items and by this no way to determine wether a unit should get healed only up to 0.25 damage or all the way to 0.
// edit: I was just looking through the stores - but couldn't find any where one could buy a Medkit. Config_Weapons.hpp only contains FAKs. So, as in vanilla noone can even buy a Medkit but only FAKs this makes it even more complicated: When a custom EVH only handle FAKs cause Medkits can't be legit aquired it would heal a player only to 75% even when using a Medkit - which is supposed to heal a player all the way to 100% - when someone decide to add a way to get Medkits.
Next update: As I'm in a test session with two friends we tested my fix - and it only works if one heals himself - if one heals others it doesn't get triggered on the healed one - gues back to the drawing board it is then ...
As I expected, you can remoteExec the hudUpdate onto the healed person.
As I expected, you can remoteExec the hudUpdate onto the healed person.
updated #672 using remoteExecCall - seem to work fine now as far as I read the difference between remoteExec and remoteExecCall there should be no difference as hudUpdate is called after the wait and doesn't contain any wait itself - please suggest if change to remoteExec is needed here
Well, seems as remoteExecCall doesn'T do the trick as it's not updating on my friends screen when I heal them, it still only updates on mine when I heal myself just like using call or spawn. Maybe I have to use remoteExec? Also: Did I understand the doc correctly about how to target a specific client? I just pass in the _injured which is the civ healed, and it has at least to do something as it does trigger on my screen if I heal myself. Really weird.
After quite some exhaustive testing I have to finally give up as fixing this issue is just not possible with the current broken engine implementation of HandleHeal trigger:
Triggers only on PC where EH is added and unit is local.
Although others may figured it out it took some testing for me to realize that this means the event handler only triggers on local (your own PC) when one use a FAK on itself to self-heal. It simply does not trigger at all when local unit is healed by another player, neither on local player nor on remote player. This makes fixing this issue just impossible without the engine implementation gets changed so that HandleHeal also fires at least on some unit when one player is healed by another player.
hence finally closing it
fn_survival.sqf
!
As I obvious not getting what you want to tell me I ask this one last polite time (prepare to get some more not so nice replies as I start to lose my patience with you guys):
Would you please tell me what kind of change do have in mind for fn_survival other than just moving the hudUpdate from line 133 to 119 to get it triggered every frame? I removed all the stuff from #688 so it can finally get merged (also: you wanted a fix for 5.x.x - I provided - why still no merge?) to fix up all those issues noone seem to care about.
Rephrase: The main issue is that my hud is not update when I get healed by another player. From about a day worth of constantly testing over and over and over again it gets down to this:
Triggers only on PC where EH is added and unit is local.
Which unfortunately is a weird way to say: "HandleHeal is only triggered local when self-healing.". End of story - there's no way to get it triggered if one gets healed by another player - it just doesn't. That's a flaw in the current engine implementation and needs to be fixed by BI - which I highly doubt will ever happen - but hey, at least I can try to file a bug report for something their official wiki states it's bugged - that'll be good ...
TLDR: For now it's closed - it's an engine issue not able to be fixed by this framework or any scripting ... if you still want to re-open it again please provide a real solution instead of just throwing in some random function name.
Expected behaviour
hud update to reflect new damag set to 0.25
Actual behaviour
"nothin"
Steps to reproduce the behaviour
RPT and/or extDB3 logs (if applicable)
N/A
Mission version: master branch commit a5a5821
Launcher version: N/A
Game version: N/A
Branch: see above
This is realted to #663 but as FirstAidKit and its function is vanilla ArmA I guess to set the virtual damage to 0.25 is a hook somewhere - but I wasn't able to find it yet. Fix would be similar to #664 as if when healing is done and damage value is set to 0.25 the hud gets updated.