-
Notifications
You must be signed in to change notification settings - Fork 108
Conversion - Allows for Conversion of Player Patients to AI Patients #686
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
base: dev-Tomcat
Are you sure you want to change the base?
Conversion - Allows for Conversion of Player Patients to AI Patients #686
Conversation
| #define DEBUG_SETTINGS DEBUG_SETTINGS_STATEMACHINE | ||
| #endif | ||
|
|
||
| #include "\x\kat\addons\main\script_macros.hpp" No newline at end of file |
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.
newline at EOF, everywhere.
| params ["_patient"]; | ||
|
|
||
| private _storageAreas = (([getPos _patient] call KPLIB_fnc_getNearestFob) nearObjects (GRLIB_fob_range)) select {(_x getVariable ["KP_liberation_storage_type",-1]) == 0}; | ||
| private _crate = [KP_liberation_supplyCrate, GVAR(enableLiberationConversionGain), [(position _patient) select 0, (position _patient) select 1, 10000]] call KPLIB_fnc_createCrate; |
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? no. raise an event and handle in a separate component or something. what is this spaghetti sauce
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.
This is even more tightly coupled to Liberation than I thought.
What the fuck? Does this even work without Liberation? Why are you allergic to event handlers?
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.
It does work without liberation, it is just that liberation is one of the biggest use cases and the hardest to build out for, so everything is written around liberation
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.
Then raise events and handle them in Liberation code instead of coupling a medical mod's code to the workings of a CTI gamemode that doesn't have a defined API and barely gets maintained.}
What happens if Liberation completely does away with the concept of FOBs and becomes a laser tag simulator tomorrow?
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.
Then the "GRLIB_fob_range" variable becomes -1, libConversionDistance returns as true, and everything else can run as is
Cplhardcore
left a comment
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.
My two cents follow what Grim said. i genuinely don't get why this is so tightly tied to liberation, especially when it is actively breaking this PR when not being run
IMO, ditch it, and if you want it tied into liberation, use events, don't tie it directly
|
|
||
| [QGVAR(convertCasualty), { | ||
| private _type = typeOf player; | ||
| private _group = createGroup [(side player), true]; |
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.
| private _group = createGroup [(side player), true]; | |
| private _group = createGroup [(side group player), true]; |
side player on an uncon player returns CIV, not the original side
|
|
||
| [QGVAR(unitTransfer), { | ||
| params ["_previousUnit"]; | ||
| private _group2 = createGroup [(side _previousUnit), true]; |
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.
| private _group2 = createGroup [(side _previousUnit), true]; | |
| private _group2 = createGroup [(side group _previousUnit), true]; |
Same as above
|
|
||
| if !(IS_UNCONSCIOUS(_patient)) exitWith { false }; | ||
| if !(GVAR(allowManualConversion)) exitWith { false }; | ||
|
|
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.
Add a check for if they are already are converted
|
|
||
| params ["_patient"]; | ||
|
|
||
| [(side _patient), GVAR(ticketConversionGain)] call BIS_fnc_respawnTickets; |
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.
| [(side _patient), GVAR(ticketConversionGain)] call BIS_fnc_respawnTickets; | |
| [(side group _patient), GVAR(ticketConversionGain)] call BIS_fnc_respawnTickets; |
| #define GET_BLOODPRESSURE_CHANGE(unit) (unit getVariable [VAR_BLOODPRESSURE_CHANGE, [0,0]]) | ||
|
|
||
| // Conversion | ||
| #define UNIT_CONVERT QEGVAR(conversion,convert) |
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.
| #define UNIT_CONVERT QEGVAR(conversion,convert) | |
| #define UNIT_CONVERT QEGVAR(conversion,currentConverted) |
| if (_unit getVariable [QEGVAR(surgery,sedated), false]) exitWith { false }; | ||
| if (_unit getVariable [QEGVAR(surgery,reboa), false]) exitWith { false }; | ||
|
|
||
| if (_unit getVariable [QEGVAR(conversion,convert), false]) exitWith { false }; |
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.
Why is this even here? this breaks a bunch of things, not to mention external mods that use this
If you want to prevent units from waking up when converted, just check the variable inside those functions, dont do it in here
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.
... this is the hasStableVitals function, this is the only place where waking up is checked. If waking isn't blocked here, then it isn't blocked
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.
There are three other places, in reorientation, carbonate, and setUncon
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.
Which all check hasStableVitals to see if they can work
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 am aware, but other units and mods use hasStableVitals for checks, and putting something that explicitly breaks that doesn't make sense to me
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.
But this doesnt break it. That is like saying that the surgery stuff shouldn't be in hasStableVitals because it breaks it for other units and mods. If conversion is disabled, then its fine and the function runs as 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.
If conversion is enabled, and a casualty is converted, then hasStableVitals will return false, even if the unit is completely fine
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.
Which is exactly how it should work, converted casualties are just there to either recover tickets or Lib supply, they aren't meant to be woken back up again
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 don't get why these are ace actions, just make them medical menu actions like manual conversion.
| treatmentLocations = QGVAR(manualConversionLocation); | ||
| treatmentTime = QGVAR(manualConversionTime); | ||
| allowedSelections[] = {"All"}; | ||
| items[] = {""}; |
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.
| items[] = {""}; | |
| items[] = {}; | |
| category = "advanced"; | |
| allowSelfTreatment = 0; | |
| }; | |
| }; |
This is tied to Liberation because its one of the most used mission frameworks in the A3 community. The issue currently is a locality problem, not that it breaks when Liberation isnt loaded. |
|
|
||
| params ["_medic", "_patient"]; | ||
|
|
||
| [QGVAR(convertCasualty), _patient] call CBA_fnc_localEvent; No newline at end of file |
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.
| [QGVAR(convertCasualty), _patient] call CBA_fnc_localEvent; | |
| [QGVAR(convertCasualty), [_patient], _patient] call CBA_fnc_targetEvent; |
If its local, it will cause the medic to die
When merged this pull request will:
IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}.