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

Medical AI - Add tourniquet support #10158

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Medical AI - Add tourniquet support #10158

merged 1 commit into from
Aug 5, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Jul 30, 2024

When merged this pull request will:

  • AI can now apply and remove tourniquets.
    • Tourniquets are applied when a limb is bleeding profusely.
    • Tourniquets are removed if a unit has all of its limbs tourniqueted and if it requires IVs or drugs. The medic will first try to bandage the least damaged limb before removing the tourniquet.
  • ace_medical_treatment_fnc_tourniquetRemove has been adapted to accommodate AI medics.
  • Fixed AI medics getting stuck during treatment because of being moved too far away from patient: medical animations move the medic backwards, which move the medic gradually away from the patient. If the medic is more than 2.5 m away from the patient, it gets the order to move in closer. However, at the start of the treatment we ordered both the medic and patient to not move, which blocks the medic in a loop of being able to do nothing.
  • Fix IVs not being correctly reported in the triage card.
  • Reverted two minor changes done in Medical AI - Give blood in Cardiac Arrest before doing CPR #10154, where I thought I had added prevention for going into CA because of too high/low HR due to drugs. In reality these changes were superfluous, the existing logic already handled these.

There are several loops in which the AI can remain stuck in:

  • AI Medic will stop moving/refuse orders when it has no Splints in Inventar #9970
  • If the patient is bleeding and the medic doesn't have the supplies, the medic won't do anything, but will remain at the patient and still try to treat it.
  • If the medic can't give IVs (either none left or the medic doesn't have the medic status), it will do CPR continuously if the patient is in cardiac arrest, and it will just wait otherwise.
  • If the patient needs a non-tourniqueted limb, but the medic doesn't have the supplies to bandage a limb fully, the medic will wait until a tourniquet has been removed (would have to be a player, because an AI medic won't remove a tourniquet unless limb is fully bandaged), another medic AI bandaged the limb or the medic got more bandages).
  • If the patient has too many drugs in their system.
  • If the patient's HR is too high/low for drugs.

I want to address all of these loops eventually in a PR meant to fix 9970. The idea would be to be able to reassign the medic to another patient if the medic is unable to treat the current patient.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@johnb432 johnb432 added the kind/enhancement Release Notes: **IMPROVED:** label Jul 30, 2024
@johnb432 johnb432 added this to the 3.18.0 milestone Jul 30, 2024
} else {
// If the medic is AI, only return tourniquet if enabled
if (missionNamespace getVariable [QEGVAR(medical_ai,requireItems), 0] > 0) then {
[_medic, "ACE_tourniquet"] call EFUNC(common,addToInventory);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if an AI medic removes a player-applied tourniquet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends only the GVAR(requireItems) setting. If items aren't required, the tourniquets vanishes.
I know it's not ideal, but I don't think we have a way of tracking who applied what (without going through the log/triage card).

@johnb432 johnb432 merged commit cd678c5 into master Aug 5, 2024
5 checks passed
@johnb432 johnb432 deleted the medical-ai-tourniquet branch August 5, 2024 09:39
johnb432 added a commit that referenced this pull request Aug 10, 2024
johnb432 added a commit that referenced this pull request Aug 10, 2024
Fix treatment items not being removed

Bug introduced in #10158
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
Add tourniquet support for Medical AI
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants