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

Add Switching of Weapon from gunbag. #6212

Closed
wants to merge 3 commits into from
Closed

Conversation

jokoho48
Copy link
Member

When merged this pull request will:

  • Add Action to Switch Weapons from/to gun bag
  • Add keybinding for switching Weapons from/to gun bag

@jokoho48 jokoho48 requested a review from commy2 March 26, 2018 04:03
@jokoho48 jokoho48 added the kind/enhancement Release Notes: **IMPROVED:** label Mar 26, 2018
params ["_unit", "_target"];

private _gunbag = backpackContainer _target;

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this really need a empty line after each line of script?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just combined the other 2 functions in that module and there are written the same way.

@jonpas
Copy link
Member

jonpas commented Mar 26, 2018

What is the goal of this? Switching weapon takes time anyways, and using interaction menu for that kind of plays into that.

@Cuel
Copy link
Contributor

Cuel commented Mar 26, 2018

What's the goal of this?

Seems to me that instead of having to drop your current primary weapon on the ground, use ace interact to get your gunbag weapon out, drop that on the ground, pick up the previous weapon, and put that in the gunbag, it's combined into one action.

@jonpas
Copy link
Member

jonpas commented Mar 26, 2018

Ah, there was a big discussion about that a while ago IIRC.

@jokoho48
Copy link
Member Author

Currently to "switch" a weapon with a Gunbag you need to Open your Inventory and drop your weapon, take your weapon out of your gun bag, drop the new weapon and take the other one, put it into the gun bag and then finally get the last weapon from the ground.

and I think that is currently a very tedious progress. this PR was the idea to improve that.

@jonpas
Copy link
Member

jonpas commented Mar 26, 2018

IIRC from the original PR which added this feature, it was decided against adding this specifically because you can't add a weapon in same perfect order as you had it in hands (with attachments, preset attachments and all those shenanigans). Even with CBA_fnc_removeWeaponCargo and CBA_fnc_addWeaponCargo it's not perfect due to some combinations which can't be worked around.

@commy2 probably knows more details since he was vocal about it in the original PR.
Ref. original PR: #3749

@jokoho48
Copy link
Member Author

@jonpas the weapon is not stored in the backpack as normal Arma weapon its stored as a virtual item. so there is no problem with weapons cargo.

@jonpas
Copy link
Member

jonpas commented Mar 26, 2018

I see, however that doesn't solve the problem of preset weapons. Say you have a preset weapon (that's one of those with attachments already on them without adding them yourself), and a player takes off one of those preset attachments, it will just reappear with your method if I am reading this correctly. [CBA_fnc_getNonPresetClass](https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_getNonPresetClass.sqf) does solve it for some, but there is no guarantee every weapon even has a base class without preset attachments.

@jokoho48
Copy link
Member Author

jokoho48 commented Mar 26, 2018

but then the general system also have that issue. it is then not a issue this PR introduces.

and no it first removes all attachments from the weapon that was added and then readds them. that is the same system that the other function also uses

@jonpas
Copy link
Member

jonpas commented Mar 26, 2018

but then the general system also have that issue. it is then not a issue this PR introduces.

No, it "exploits" the issues, as in introduces a way to make it happen.

@jokoho48 jokoho48 closed this May 17, 2020
@jokoho48 jokoho48 deleted the switchGunbagWeapon branch May 17, 2020 11:05
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