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 - Add 'Open (Backpack)' action to dead units #9239

Merged
merged 12 commits into from
Sep 4, 2023

Conversation

LinkIsGrim
Copy link
Contributor

@LinkIsGrim LinkIsGrim commented Jul 2, 2023

When merged this pull request will:

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}.

_unit addAction ["OpenBag", {
params ["_target", "_caller"];

_caller action ["OpenBag", _target];
Copy link
Contributor

Choose a reason for hiding this comment

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

it does seem to work on dead people, but I also see this note

            // 26.8.2013 HOTFIX CardA: ATOpenBag can be processed with a live soldier's bag only
            // because some actions between bag and other containers(like ground,...)
            // needs unit->Brain() which is invalid for a dead soldier(dead soldier has no brain)

@PabstMirror
Copy link
Contributor

I really don't think we can disable those vanilla actions
but still might be able to add the open backpack action assuming it doesn't cause something to explode

@LinkIsGrim LinkIsGrim added the kind/enhancement Release Notes: **IMPROVED:** label Jul 9, 2023
@PabstMirror
Copy link
Contributor

noticed actions don't get re-added when unit respawns,
also effects the previous unconscious-gear action

@johnb432
Copy link
Contributor

Why not add something similar to this instead?
It adds the backpack interaction, regardless if unit is alive or dead.

@LinkIsGrim
Copy link
Contributor Author

This is for scroll wheel actions specifically.

@johnb432
Copy link
Contributor

This is for scroll wheel actions specifically.

Sorry, I don't know how, but I missed that part.

Nonetheless, the condition checking of what I linked might be worth using here (part of FUNC(hasInventory)):

!lockedInventory _this && {maxLoad _this > 0} && {getNumber (configOf _this >> "disableInventory") != 1} // _this being backpackContainer

(I added it above, beneath an already existing suggestion)

@johnb432
Copy link
Contributor

johnb432 commented Jul 23, 2023

This should resolve the dead unit and respawning issues mentioned.
Not entirely sure about the CBA event register placement (should it be in preInit or postInit?).

Edit: Forgot to remove some test code, so the commit after the one mentioned above resolves those issues.

@LinkIsGrim
Copy link
Contributor Author

This should resolve the dead unit and respawning issues mentioned. Not entirely sure about the CBA event register placement (should it be in preInit or postInit?).

Edit: Forgot to remove some test code, so the commit after the one mentioned above resolves those issues.

LGTM. Moved to postInit.

@PabstMirror
Copy link
Contributor

PabstMirror commented Jul 27, 2023

getting double backpack actions for dead units
and the open bag doesn't seem to work on dead units

edit: this is for a unit that I put health at 0 in 3den

openbag.mp4

@johnb432
Copy link
Contributor

johnb432 commented Jul 27, 2023

getting double backpack actions for dead units and the open bag doesn't seem to work on dead units

I assume it's because the EH and the allDeadMen code are executed at the same time.
I guess we could add a variable to the unit telling us the action has been added?

So in FUNC(addInventoryActions):

if (_unit getVariable [QGVAR(actions), false]) exitWith {};

_unit setVariable [QGVAR(actions), true];

@johnb432
Copy link
Contributor

johnb432 commented Aug 1, 2023

getting double backpack actions for dead units and the open bag doesn't seem to work on dead units

edit: this is for a unit that I put health at 0 in 3den
openbag.mp4

The doubling of the actions should be fixed now.

However, I could not replicate the open bag not working on dead units, even ones killed in the editor.
I was testing in self-hosted MP, regardless of being the server of the client I can't replicate the issue you describe.

@PabstMirror
Copy link
Contributor

mission showing backpack action not working on dead units
testBackpacks.Stratis.zip

@johnb432
Copy link
Contributor

johnb432 commented Aug 3, 2023

mission showing backpack action not working on dead units testBackpacks.Stratis.zip

I'm not sure if this will be fixed. It might be related to https://feedback.bistudio.com/T126030#2482353 in part, so it might be fixed if KK decides to look into units set to 0 health in the editor.

@jonpas jonpas changed the title Medical - Add 'Open (Backpack)' action to dead units. Medical - Add 'Open (Backpack)' action to dead units Aug 3, 2023
@PabstMirror
Copy link
Contributor

fixed double actions by

  • add to allUnits + allDeadMen
  • add class init EH without retro flag

LinkIsGrim and others added 2 commits August 22, 2023 18:55
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@PabstMirror
Copy link
Contributor

We can just keep an eye out if the old notes about OpenBag action actually cause problems

@PabstMirror PabstMirror added this to the 3.16.0 milestone Aug 29, 2023
@LinkIsGrim LinkIsGrim merged commit 36f34ec into acemod:master Sep 4, 2023
5 checks passed
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.

Medical - Hide/Reimplement "Open Bag (Backpack)" action on unconscious units.
3 participants