Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adv. Medical] Heal hitpoints doesn't work #2498

Closed
Magirot opened this issue Sep 18, 2015 · 11 comments
Closed

[Adv. Medical] Heal hitpoints doesn't work #2498

Magirot opened this issue Sep 18, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@Magirot
Copy link

Magirot commented Sep 18, 2015

ACE3 Version: 3.3.1.2

Mods:

  • @CBA_A3
  • @ace

Placed ACE3 Modules:

  • Medical Settings (ACE) [Medical Level: Advanced, Medics setting: Advanced]
  • Advanced Medical Settings (ACE) [Heal hitpoints: Yes]

Description:
With the heal hitpoints parameter, bandaging wounds should heal the damage taken as well. This doesn't seem to work in the newest version.
Here's a video if it helps: https://youtu.be/5Xi2AGv3uCs

Steps to reproduce:

  1. Add the aforementioned modules (or use an userconfig with the parameters).
  2. Get shot and bandage yourself.
  3. Still bloodied. :(
@Pergor
Copy link

Pergor commented Sep 19, 2015

Additionally you still can't run after bandaging up some leg hits with ace_medical_healHitPointAfterAdvBandage == 1.

If I can recall it right, it's the third time this was supposed to be fixed.

@Magirot
Copy link
Author

Magirot commented Sep 19, 2015

Do you mean it didn't work in previous versions either? At least for us the damage got healed like it's supposed to in 3.2.1.

@Pergor
Copy link

Pergor commented Sep 19, 2015

No, the leg damage remained and you could naught but walk after bandaging up the third leg wound, even in 3.2.1.

@thojkooi thojkooi added this to the 3.4.0 milestone Sep 20, 2015
@thojkooi
Copy link
Contributor

Interesting. When I last tried this everything worked fine. I guess we need to take another look.

@Pergor
Copy link

Pergor commented Sep 20, 2015

These are the settings I currently use:
http://pastebin.com/vbWBFGWg

@jokoho48
Copy link
Member

@Pergor please use pastbin or other text pasting pages thanks

@thojkooi thojkooi self-assigned this Sep 25, 2015
@DerekSauer
Copy link
Contributor

Looking at the code in "fnc_treatmentAdvanced_bandageLocal.sqf" starting at line 97, ACE is checking to see if all wounds on a particular part have been treated and then setting that part to undamaged on Arma's end of things with the setHitPointDamage command.

ACE is removing damage from HitLeftArm, HitRightArm, HitLeftLeg and HitRightLeg but these parts do nothing in Arma's damage model. I think they're just bone locations for the animation system. Arma's damage system is much simpler and combines arms and legs into one aggregate limb so it only tracks damage to "HitHands" and "HitLegs", not each limb individually. "HitHead" and "HitBody" are correct and function as expected.

You can test this yourself in game with the debug console. Apply damage to a limb with setHitPointDamage while you have ACE enabled (E.g.: player setHitPointDamage ["HitLeftLeg", 1.0];) and your player will continue to run around without issue and show no blood. Do the same with "HitLegs" and you will begin to walk around slowly and your pants will be bloody. Heal it with player setHitPointDamage ["HitLegs", 0.0]; and now your player will run around as normal and the blood will be gone.

I believe that ACE needs to check to see if all wounds to both legs or both arms has been treated and then use the correct setHitPointDamage (HitHands or HitLegs) to remove blood and arma engine injuries.

@DerekSauer
Copy link
Contributor

I was thinking something like the following as an unsexy brute force fix:

// If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore.
if (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {((_x select 4) * (_x select 3)) > 0}}count _openWounds == 0}) then {
    _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
    _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
    _point = _hitPoints select (_hitSelections find _selectionName);
    _target setHitPointDamage [_point, 0];

    // Fix for "Arma-Injury" and bloody uniform
    // If both arms have been fully bandaged set Arma's aggregate arms to undamaged
    // The aggregate limb for your arms are actually your hands.
    if ((_target getHitPointDamage "HitLeftArm" == 0) && (_target getHitPointDamage "HitRightArm" == 0)) then
    {
        _target setHitPointDamage ["HitHands", 0];
    };

    // If both legs have been fully bandaged set Arma's aggregate legs to undamaged
    if ((_target getHitPointDamage "HitLeftLeg" == 0) && (_target getHitPointDamage "HitRightLeg" == 0)) then
    {
        _target setHitPointDamage ["HitLegs", 0];
    };
};

@DerekSauer
Copy link
Contributor

After testing this some more in game it looks like ACE never actually applies any damage to HitRightArm, HitRightLeg, etc... so having them healed by the code in healHitPointAfterAdvBandage wasn't doing anything in the first place, aside from those HitPoints not having any actual function. To that effect the code I posted above will always fully heal the Arma aggregate limbs when bandaged since HitRightArm, etc... always have no damage so getHitPointDamage will always return 0.

The best solution is likely to count the number of open wounds on the left and right limb and when both limbs have no wounds use setHitPointDamage with the appropriate aggregate limb (HitHands, HitLegs). That will remove blood from arms and legs and prevent players from being stuck slow walking or having their aim wobbled all over the place.

@DerekSauer
Copy link
Contributor

Also have to correct myself. The aggregate for arms is not HitArms it is HitHands. I've corrected my above comments. In Arma your arms are actually hands.

@commy2 commy2 mentioned this issue Sep 30, 2015
8 tasks
thojkooi added a commit that referenced this issue Oct 4, 2015
Fix healHitPointAfterAdvBandage - Issue #2498.
@thojkooi thojkooi closed this as completed Oct 4, 2015
@thojkooi
Copy link
Contributor

thojkooi commented Oct 4, 2015

Fixed in #2646 by @DerekSauer 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants