Skip to content

Conversation

@mazinskihenry
Copy link
Contributor

When merged this pull request will:

  • Allows for the conversion of player patients to AI patients, both automatically and by player choice
  • Modifies ACE State Machine to allow for AI patients to be treated as players
  • Allows for converted patients to be turned into either respawn tickets or Liberation supply

IMPORTANT

  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@mazinskihenry mazinskihenry added enhancement New feature or request kind/enhancement Release Notes: **IMPROVED:** labels Jan 12, 2025
@MiszczuZPolski MiszczuZPolski added kind/feature Release Notes: **ADDED:** and removed enhancement New feature or request labels Jan 12, 2025
@mazinskihenry mazinskihenry added this to the Ongoing milestone Jan 12, 2025
@mazinskihenry mazinskihenry restored the Role_Two branch March 12, 2025 03:01
@mazinskihenry mazinskihenry reopened this Mar 12, 2025
MiszczuZPolski pushed a commit that referenced this pull request Apr 14, 2025
…njury) (#722)

**When merged this pull request will:**
- _Add Japanese translation for 3.1.0 Update for eye injury_
- _and small fix for Simple Chinese that messed up by AI translation_

~~Do not merge before State Machine #713 and Conversion #686~~ This
skipped to [another
PR](#757)
#define DEBUG_SETTINGS DEBUG_SETTINGS_STATEMACHINE
#endif

#include "\x\kat\addons\main\script_macros.hpp" No newline at end of file
Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

@mazinskihenry mazinskihenry May 4, 2025

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

Copy link
Contributor

@LinkIsGrim LinkIsGrim May 4, 2025

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?

Copy link
Contributor Author

@mazinskihenry mazinskihenry May 4, 2025

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

@MiszczuZPolski MiszczuZPolski modified the milestones: 3.1.0, 3.1.1 Jun 5, 2025
Copy link
Contributor

@Cplhardcore Cplhardcore left a 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];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 };

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[(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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#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 };
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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[] = {""};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
items[] = {""};
items[] = {};
category = "advanced";
allowSelfTreatment = 0;
};
};

@mazinskihenry
Copy link
Contributor Author

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[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

@MiszczuZPolski MiszczuZPolski modified the milestones: 3.1.3, Ongoing Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Release Notes: **IMPROVED:** kind/feature Release Notes: **ADDED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants