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

Reload Launcher - Improve various aspects #9335

Merged
merged 12 commits into from
Aug 28, 2023

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Aug 19, 2023

When merged this pull request will:

  • Added reload launcher support to the RPG 7 from APEX.
  • Removed reloading of captive units' launchers.
  • Added proper support for launchers with magazines that contain more than 1 rocket/missile. The magazine with the highest amount of ammo is selected for reloading.
  • In some cases the reload process fails, e.g. AI don't switch to a launcher, despite the use of selectWeapon or action ["switchWeapon"] commands, or perhaps the launcher had been reloaded by someone else whilst you were interacting.
    If one of the cases described happened, the missile is deleted, but never given back.
    This PR fixes that:
    • If the unit to be reloaded is AI (excluding remote-controlled AI), it will no longer check if the unit has its secondary weapon selected. It will just reload the unit. The unit to be reloaded no longer requires to have their launcher selected for the launcher to be reloadable.
    • If the reloading failed, the magazine will be returned to the unit initiating the reload. If that unit has a full inventory, the magazine will be dropped on the ground.
  • 72bf07f makes it so it checks if the launcher can be reloaded both before the progressbar has started and after the progressbar has finished (in both cases FUNC(canLoad) is used). If it's possible, it tries to remove the magazine.
    If it's not possible to load the launcher or the magazine couldn't be removed, it stops and notifies the unit that the reloading has failed.
    However, if everything is valid, it will reload the launcher and notifies the unit that the reloading has succeeded.
  • Includes Reload/ReloadLauncher - Add notifications when buddy loading or linking #9202.

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

Drofseh and others added 5 commits May 16, 2023 19:53
- Add notifications to reloadLauncher
- Also set _reloadTime to `magazineReloadTime min 2.5` instead of just 2.5 if there is no `buddyReloadTime` set
@LinkIsGrim
Copy link
Contributor

LinkIsGrim commented Aug 19, 2023

Added reload launcher support to the RPG 7 from APEX.

It's not a breech-loaded launcher, doesn't make a lot of sense to allow buddy-loading.

@johnb432
Copy link
Contributor Author

Added reload launcher support to the RPG 7 from APEX.

It's not a breech-loaded launcher, doesn't make a lot of sense to allow buddy-loading.

Is that what reload launcher is for only?

@LinkIsGrim
Copy link
Contributor

Added reload launcher support to the RPG 7 from APEX.

It's not a breech-loaded launcher, doesn't make a lot of sense to allow buddy-loading.

Is that what reload launcher is for only?

I'm not familiar with the design intention, but we've only enabled it for breech-loaded AT until now.

@Drofseh
Copy link
Contributor

Drofseh commented Aug 20, 2023

Added reload launcher support to the RPG 7 from APEX.

It's not a breech-loaded launcher, doesn't make a lot of sense to allow buddy-loading.

Is that what reload launcher is for only?

It's definitely possible to buddy reload an RPG-7, and CUP's RPG-7 is already buddy reloadable, so I'd prefer to keep the ability to reload the apex one.

if (currentMagazine _target != "") exitWith {};
// AI don't select launchers with selectWeapon/switchWeapon
if (_checkSelectedWeapon) then {
_target selectWeapon _weapon;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can reload a launcher that isn't actively selected
so it's a bit weird if someone reloads a launcher on your back and if forces you to select it suddenly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm aware of that behaviour, but I kept it in as it was like that before, as I wasn't quite sure how to handle it. Should it be changed so it doesn't select the weapon?
As it is now, the launcher only needs to be in the secondary slot, but not actually equipped. I could make it so that FUNC(canLoad) checks if the launcher is selected.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's ok to allow reload just if the weapon exists, and it shouldn't matter if selected

Copy link
Contributor Author

@johnb432 johnb432 Aug 20, 2023

Choose a reason for hiding this comment

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

@PabstMirror I have just changed the code.
72bf07f makes it so it checks if the launcher can be reloaded both before the progressbar has started and after the progressbar has finished (in both cases FUNC(canLoad) is used). If it's possible, it tries to remove the magazine.
If it's not possible to load the launcher or the magazine couldn't be removed, it stops and notifies the unit that the reloading has failed.
However, if everything is valid, it will reload the launcher and notifies the unit that the reloading has succeeded.

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@PabstMirror PabstMirror added this to the 3.16.0 milestone Aug 20, 2023
@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Aug 20, 2023
QGVAR(displayStatusText),
"CHECKBOX",
[LSTRING(SettingDisplayStatusTextName), LSTRING(SettingDisplayStatusTextDesc)],
ELSTRING(common,ACEKeybindCategoryWeapons),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Atm, this will create another category also named "ACE Weapons". If #9343 is merged, it should results in 1 category.

@LinkIsGrim LinkIsGrim merged commit b90d037 into acemod:master Aug 28, 2023
5 checks passed
@johnb432
Copy link
Contributor Author

@LinkIsGrim Ah shit, you were too fast xD
I wanted to push some header fixes - how should I go about that? Create a new PR?

@LinkIsGrim
Copy link
Contributor

Yeah.

@johnb432 johnb432 deleted the reloadlaunchers-additions branch January 14, 2024 22:19
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.

4 participants