-
Notifications
You must be signed in to change notification settings - Fork 737
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 - Add more API getters #10514
base: master
Are you sure you want to change the base?
Conversation
|
||
if !(alive _unit) exitWith {false}; | ||
|
||
_unit call EFUNC(medical_ai,isInjured) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EFUNC(medical_ai,isInjured)
only checks if the unit has broken legs, it doesn't check for broken arms. It also returns true
if the unit is unconscious.
What purpose should this new function serve?
As it is atm, imo you are asking it to do too much, making it not very useful in my eyes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What purpose should this new function serve?
For my use-case, it was checking for "non-normal" medical state. I.e. true
if uncon, has wounds, etc.
It was for a medevac script and I only wanted the action to show if the unit was actually injured.
I could've checked all of the variables myself, but I figured an API function would be more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EFUNC(medical_ai,isInjured)
only checks if the unit has broken legs, it doesn't check for broken arms. It also returnstrue
if the unit is unconscious.
Should the medical_ai function check for broken arms as well?
I included it just in the API function for now, but I can just update the AI function if desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the medical_ai function check for broken arms as well?
No, it was intentionally done like that for (to me unknown) reason, although my guess would be that 1) AI don't have a lot of splints, 2) AI don't suffer from AI sway as players do (so don't waste them) and 3) might have simplified the AI medic state machine by not having to add a priority system for which limbs to splint (is now a moot point, because I revamped the state machine quite a bit).
What is the AI function completely omits is blood level and HR checking. I'll need to check whether this is intentional or not, but regardless the API function needs to check for the blood level at the very least. I'd imagine that having a high/low HR should also make the API return true
, but then there might be certain scenarios where you simply don't care.
That leads me to: what's the formal definition of "non-normal"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd define "non-normal" as a state differing from the state set by initUnit
/ fullHeal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!(lifeState unit in ["HEALTHY", "somethingElseIForgot"])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting that should be added in the check as well?
Ah, I thought IS_UNCON
was updated to use common's isAwake
function. I'll update that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!(lifeState unit in ["HEALTHY", "somethingElseIForgot"])
"INJURED"
, and I opted to just use common_fnc_isAwake
. Unless it should explicity check lifeState instead of the common function?
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Making a checklist of things for
|
SPO2, Heart Rate, Blood Pressure and Oxygen Demand can't just be checked against default as they can vary with fatigue and altitude if SPO2 simulation is enabled. |
I just added those to have them listed, I don't think any of them should be considered IMO |
{GET_BLOOD_VOLUME(_unit) != DEFAULT_BLOOD_VOLUME} || | ||
{!(_unit call EFUNC(common,isAwake))} || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily an indication of injury. Maybe stable condition, but not injury.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood your comment (#10514 (comment)) then, I thought you were suggesting to check that as well
When merged this pull request will:
medical_ai
'sisInjured
functionmedical_status
'sgetBloodLoss
functionIMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.