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

Cargo - Add alternative unloading item from vehicle cargo #8827

Merged
merged 25 commits into from
Feb 7, 2024

Conversation

smitt14ua
Copy link
Contributor

@smitt14ua smitt14ua commented Feb 21, 2022

When merged this pull request will:

  • New button in cargo menu to select place for unloading

YouTube presentation:

Open/close .

Arma 3 acemod item placement

Arma 3 acemod item placement 2

@smitt14ua smitt14ua changed the title Cargo - Add alternative unloading item from vehicle cargo WIP: Cargo - Add alternative unloading item from vehicle cargo Feb 21, 2022
@veteran29 veteran29 added the kind/enhancement Release Notes: **IMPROVED:** label Feb 21, 2022
@veteran29 veteran29 added this to the Ongoing milestone Feb 21, 2022
@smitt14ua smitt14ua changed the title WIP: Cargo - Add alternative unloading item from vehicle cargo Cargo - Add alternative unloading item from vehicle cargo Feb 21, 2022
@veteran29 veteran29 self-requested a review February 21, 2022 22:08
@severgun
Copy link
Contributor

severgun commented Feb 22, 2022

Duplicate?🤔 #8797

@smitt14ua
Copy link
Contributor Author

Duplicate?🤔 #8797

If player cannot carry unloaded object, it will be placed randomly. My solution is for big (not-carried) objects and prevents collision bugs after unloading.

@smitt14ua smitt14ua requested a review from commy2 February 22, 2022 18:26
@johnb432
Copy link
Contributor

johnb432 commented Aug 5, 2023

What needs to be finished or looked at for this to be pulled?

@smitt14ua
Copy link
Contributor Author

What needs to be finished or looked at for this to be pulled?

Nothing, I think. commy2 didn't respond me

@LinkIsGrim
Copy link
Contributor

What needs to be finished or looked at for this to be pulled?

General testing, MP, and code review.

@LinkIsGrim LinkIsGrim requested review from LinkIsGrim and removed request for commy2 August 7, 2023 15:03
@johnb432
Copy link
Contributor

johnb432 commented Nov 4, 2023

I've taken the liberty to implement some fixes and improvements directly:

  • Combined handle functions into a single function FUNC(handleDeployInterrupt).
  • Implemented FUNC(handleDeployInterrupt) being called (on opening the interact menu, vehicle and weapon switching, being killed and captured, surrendering, going unconscious and feature cameras changing.)
  • Made sure that setDir is called before any position setting commands. Wiki suggests this is necessary and I did not verify this.
  • Added authors from functions that were used as basis for the newly written ones. I assume they came from sandbag, as the comments are exactly the same. If I'm wrong, we can easily correct that.
  • Removed 1 second delay after placing. This, in my opinion, does not make any sense and I will update sandbag's code accordingly.

I have tested this both in SP and self-hosted MP, works in both cases.

My suggestion is to merge #9617 first (if it's accepted), then this PR could be updated to accommodate the changes.

@smitt14ua
Copy link
Contributor Author

Thx, @johnb432 ❤️

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

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

LGTM other than comment above

addons/cargo/functions/fnc_unloadItem.sqf Show resolved Hide resolved
@LinkIsGrim
Copy link
Contributor

I've removed hiding the object when deployment is blocked since it's less confusing that way IMO.

Tweaked object radius to use firegeometry bounding box as that's closer to the real thing.

You can place objects inside other objects up to a certain point. If we want to prevent that, the intersection checks need to be changed to lineIntersectsSurfaces and begPos needs to be moved further along the line between eye/vehiclePos and the model's position. Guesstimation says half of the object radius should be good.

Also fixed menu staying open in death
@johnb432
Copy link
Contributor

johnb432 commented Feb 6, 2024

If we want to prevent that, the intersection checks need to be changed to lineIntersectsSurfaces and begPos needs to be moved further along the line between eye/vehiclePos and the model's position. Guesstimation says half of the object radius should be good.

You'll need to run that by me again chief, I don't get it.

@LinkIsGrim
Copy link
Contributor

Math

@johnb432
Copy link
Contributor

johnb432 commented Feb 7, 2024

I went ahead and simplified the deployment method, by essentially copying what carrying does. I feel it's more robust and allows for greater flexibility.
We can improve the deployment method later, but imo it's better if we use something simple for now.

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

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

LGTM

ArmA.3_2024.02.07-08.25.mp4

@LinkIsGrim LinkIsGrim modified the milestones: Ongoing, 3.17.0 Feb 7, 2024
@LinkIsGrim LinkIsGrim merged commit 8731bcc into acemod:master Feb 7, 2024
5 checks passed
@jonpas jonpas modified the milestones: 3.17.0, 3.16.4 Feb 28, 2024
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.

7 participants