Medical Statemachine - Optimize medical handling for uninjured AI units#11101
Medical Statemachine - Optimize medical handling for uninjured AI units#11101PabstMirror merged 15 commits intomasterfrom
Conversation
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
|
How well does this handle medical API functions? I imagine |
| }, _this] call CBA_fnc_addEventHandlerArgs; | ||
| }; | ||
|
|
||
| if (!IS_MEDICAL_ACTIVITY(_unit)) then { [QGVAR(activateMedical), _unit] call CBA_fnc_localEvent; }; |
There was a problem hiding this comment.
Maybe medical activity could only be enabled if state if the serialized state also had activity (check when serializing and output some magic value maybe)?
Thinking about a persistent mission with spawned but untouched AI in some far-off corner of the map, if they get serialized indiscriminately, this'd make them active after a restart
There was a problem hiding this comment.
fixed by adding ace_medical_engine_fnc_checkForMedicalActivity
this also handles manually scripted medical changes
like mission maker doing this setVariable ["ace_medical_bloodVolume", 4] to make a medical training dummy
|
|
addons/medical_engine/functions/fnc_checkForMedicalActivity.sqf
Outdated
Show resolved
Hide resolved
johnb432
left a comment
There was a problem hiding this comment.
Would like to have my comment addressed, otherwise LGTM
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Skip running unit vital calculations and network activity for
AI units that have not been wounded or treated
The default values for things like heart rate are very close to the value they reach over time,
so I think this should not even be noticeable in most cases.
Possible edge case would be something like a AI unit with scripted reduce blood volume, HR/Pressure wouldn't update
But it's very easy to add a setVar to force the vital to always run