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

Interaction - Add Interaction to take another players launcher #10541

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Cplhardcore
Copy link
Contributor

When merged this pull request will:

  • Allow players to take launchers off others backs, without needing to go through the inventory

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

addons/interaction/functions/fnc_canTakeLauncher.sqf Outdated Show resolved Hide resolved
addons/interaction/functions/fnc_canTakeLauncher.sqf Outdated Show resolved Hide resolved
addons/interaction/functions/fnc_takeLauncher.sqf Outdated Show resolved Hide resolved
addons/interaction/functions/fnc_takeLauncher.sqf Outdated Show resolved Hide resolved
@Cplhardcore
Copy link
Contributor Author

Right now this PR is on hold, as support for multiple muzzles breaks disposables

@Cplhardcore
Copy link
Contributor Author

thanks to johnb, this PR should be good to go

@Cplhardcore Cplhardcore marked this pull request as ready for review January 5, 2025 14:41
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.

Only thing i can see. LGTM otherwise.

addons/interaction/functions/fnc_takeLauncher.sqf Outdated Show resolved Hide resolved
Comment on lines +22 to +28
if (GVAR(enableLauncherTaking) &&
secondaryWeapon _target != "" &&
secondaryWeapon _player == "" &&
isNull objectParent _target &&
isNull objectParent _player &&
side _target == side _player) exitWith {true};
false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (GVAR(enableLauncherTaking) &&
secondaryWeapon _target != "" &&
secondaryWeapon _player == "" &&
isNull objectParent _target &&
isNull objectParent _player &&
side _target == side _player) exitWith {true};
false
GVAR(enableLauncherTaking) &&
secondaryWeapon _target != "" &&
secondaryWeapon _player == "" &&
isNull objectParent _target &&
isNull objectParent _player &&
side _target == side _player

I'd personally also wrap every single statement in a lazy eval, but I haven't tested the performance impact.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this would work when the target is unconscious, as side changes. Imo would be better to check if the sides have friendly relations (using the sides of the group).

Copy link
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

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

Still not a huge fan of this tbh. There's no way you can object to having your launcher taken.
I'd much prefer if you need to confirm that you want someone to take your launcher (uncon would automatically confirm).

private _playerName = [_player] call EFUNC(common,getName);
private _cfgWeapons = configFile >> "CfgWeapons" >> _launcher;
private _displayName = getText (_cfgWeapons >> "displayName");
[QEGVAR(common,displayTextStructured), [[LSTRING(TakingLauncherHint), _playerName, _displayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[QEGVAR(common,displayTextStructured), [[LSTRING(TakingLauncherHint), _playerName, _displayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[LSTRING(TakingLauncherHint), _playerName, _displayName], 1.5, _target], _target] call CBA_fnc_targetEvent;

Comment on lines +55 to +56
[QEGVAR(common,displayTextStructured), [[LSTRING(GaveLauncherHint), _playerName, _displayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[LSTRING(TookLauncherHint), _targetName, _displayName], 1.5, _player], [_player]] call CBA_fnc_targetEvent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[QEGVAR(common,displayTextStructured), [[LSTRING(GaveLauncherHint), _playerName, _displayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[LSTRING(TookLauncherHint), _targetName, _displayName], 1.5, _player], [_player]] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[LSTRING(GaveLauncherHint), _playerName, _displayName], 1.5, _target], _target] call CBA_fnc_targetEvent;
[QEGVAR(common,displayTextStructured), [[LSTRING(TookLauncherHint), _targetName, _displayName], 1.5, _player], _player] call CBA_fnc_targetEvent;

Comment on lines +90 to +91
QGVAR(launcherTime),
"SLIDER",
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though I prefer this variant, imo it's better to keep consistent styling within the same file when possible.

Suggested change
QGVAR(launcherTime),
"SLIDER",
QGVAR(launcherTime), "SLIDER",

LSTRING(takeLauncherTime),
format ["ACE %1", LLSTRING(DisplayName)],
[1, 20, 5, 0],
true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
true
1

QGVAR(enableLauncherTaking), "CHECKBOX",
LSTRING(takeLauncherSetting),
format ["ACE %1", LLSTRING(DisplayName)],
true
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Not a fan of the default value, imo it should be off.
  2. This should be a synced setting imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants