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

Grenades - Add grenade rolling #10005

Merged
merged 9 commits into from
May 27, 2024
Merged

Grenades - Add grenade rolling #10005

merged 9 commits into from
May 27, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented May 12, 2024

When merged this pull request will:

  • Title.
  • Some grenades roll further than others, range is between 3-10 m depending on shape.
  • Tested with Vanilla fragmentation and smoke grenades, as well as ACE flashbangs.
  • Tested with 3CB BAF and RHS grenades, an overwhelming majority of grenades work well, some even better than others (e.g. stick hand grenades).
    Grenades such as rhs_mag_nspd and rhs_mag_rdg2_black are not set on their side properly and tumble instead of roll. Added a config entry for setVectorDirAndUp.
    rhsgref_mag_rkg3em just isn't meant for this type of thing and fails horribly. Don't allow grenades to be rolled which have fuse times under 1 second.
    I was thinking of adding a config entry for the rotation of the grenade (default would be 90°) for the first issue, but I'm not sure what to do about the second issue. Thoughts on both?

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

@johnb432 johnb432 added the kind/feature Release Notes: **ADDED:** label May 12, 2024
@johnb432 johnb432 added this to the 3.18.0 milestone May 12, 2024
@johnb432
Copy link
Contributor Author

vn_t67_grenade_mag and vn_chicom_grenade_mag are causing issues, because they can't simply be rotated like most other cylindrical grenades (they are thrown like an arrow, meaning they would need to be rotated along a different axis than is currently possible).
I was thinking of adding a config entry compatible with setVectorDirAndUp, but honestly I'm not looking forward to the math that needs to be done. It would be the most flexible solution however, so probably worth it. Thoughts?

@johnb432
Copy link
Contributor Author

vn_t67_grenade_mag and vn_chicom_grenade_mag are causing issues, because they can't simply be rotated like most other cylindrical grenades (they are thrown like an arrow, meaning they would need to be rotated along a different axis than is currently possible). I was thinking of adding a config entry compatible with setVectorDirAndUp, but honestly I'm not looking forward to the math that needs to be done. It would be the most flexible solution however, so probably worth it. Thoughts?

Solved easier than anticipated with setVectorDirAndUp.

Copy link
Member

@Mike-MF Mike-MF left a comment

Choose a reason for hiding this comment

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

Tested this (without RHS/SOG) and it works quite nicely, tested rolling in and out of buildings, up and down hills etc. Nicely done.

PabstMirror and others added 4 commits May 25, 2024 01:12
* Grenades - Rolling only add PFEH when needed

* Corrected minor typo, moved variable init in preInit, fixed bugs

---------

Co-authored-by: johnb432 <[email protected]>
@johnb432
Copy link
Contributor Author

Made some minor changes

  • added optimisation done by Pabst
  • prevented players from rolling grenades when in FFV
  • only force switch grenade modes when throwables are usable (= on foot or in FFV)

Copy link
Member

@Mike-MF Mike-MF left a comment

Choose a reason for hiding this comment

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

Tested FFV and same stuff I tested last time, all good.

@johnb432 johnb432 merged commit be9797d into master May 27, 2024
5 checks passed
@johnb432 johnb432 deleted the grenades-add-roll-mode branch May 27, 2024 09:19
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Add grenade rolling

* Added some safeguards

* Use `setVectorDirAndUp` instead of rotation

* Don't allow players to roll grenades when in vehicles

* Grenades - Rolling only add PFEH when needed (acemod#10015)

* Grenades - Rolling only add PFEH when needed

* Corrected minor typo, moved variable init in preInit, fixed bugs

---------

Co-authored-by: johnb432 <[email protected]>

* Don't switch modes if grenade can't be thrown

* Minor tweaks

---------

Co-authored-by: PabstMirror <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants