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

Added captive hotkey #5529

Merged
merged 9 commits into from
Sep 26, 2017
Merged

Added captive hotkey #5529

merged 9 commits into from
Sep 26, 2017

Conversation

klemmchr
Copy link

@klemmchr klemmchr commented Sep 18, 2017

When merged this pull request will:

  • Add a hotkey for applying handcuffs for the unit under the cursor

I was unsure about the default hotkey for this so I chose Shift+F1. Maybe we should leave out the default hotkey completely for this.

@jonpas
Copy link
Member

jonpas commented Sep 18, 2017

Finally someone does this! :D

I think you have to check distance in the action as well, interaction menu takes care of it otherwise.

I also think there is no point in having a "toggle" keybind, just having the keybind for handcuffing would be better, since that's the hard part to do with the interaction menu.

@jonpas jonpas added the kind/feature Release Notes: **ADDED:** label Sep 18, 2017
@jonpas jonpas added this to the 3.12.0 milestone Sep 18, 2017
};

if([ACE_player, cursorObject] call FUNC(canRemoveHandcuffs)) exitWith {
[cursorObject, false] call FUNC(setHandcuffed);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use cursorObject. It has really bad accuracy.

Copy link
Author

Choose a reason for hiding this comment

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

What should I use instead of cursorObject?

Copy link
Contributor

Choose a reason for hiding this comment

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

screenToWorld [0.5, 0.5] maybe?

Copy link
Member

Choose a reason for hiding this comment

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

//Add Keybind:
["ACE3 Common", QGVAR(captives), [(localize LSTRING(KeyComb)), (localize LSTRING(KeyComb_description))],
{
if !(cursorObject isKindOf "Man") exitWith {};
Copy link
Contributor

@commy2 commy2 Sep 19, 2017

Choose a reason for hiding this comment

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

CAManBase
Man includes rabbits and snakes and dogs and sheep and fish etc.

@@ -428,12 +428,12 @@
<Chinesesimp>投降或无武器状态</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_KeyComb">
<English>Toggle unit captive</English>
<German>Einheit festnehmen umschalten</German>
<English>Set unit captive</English>
Copy link
Member

Choose a reason for hiding this comment

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

You can just use the strings from above, the ones used for interaction menu.

//Add Keybind:
["ACE3 Common", QGVAR(captives), [(localize LSTRING(KeyComb)), (localize LSTRING(KeyComb_description))],
{
if !(cursorObject isKindOf "CAManBase" || {(cursorObject distance player) > getNumber (configFile >> "CfgVehicles" >> "CAManBase" >> "ACE_Actions" >> "ACE_ApplyHandcuffs" >> "distance")}) exitWith {};
Copy link
Contributor

Choose a reason for hiding this comment

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

use ace_player not player

this code should also return a bool, generally false if nothing happens, and true if it will
so false if out of range, true if we run setHandcuffed and false at the bottom

Copy link
Contributor

Choose a reason for hiding this comment

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

also add

if !([ACE_player, cursorObject, []] call EFUNC(common,canInteractWith)) exitWith {false};

player -> ace_player
interact check
stringtable adjust
jonpas
jonpas previously requested changes Sep 21, 2017
@@ -1,4 +1,5 @@
#include "script_component.hpp"
#include “\a3\editor_f\Data\Scripts\dikCodes.h”
Copy link
Member

Choose a reason for hiding this comment

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

Those are some wrong quotes.

Copy link
Author

Choose a reason for hiding this comment

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

Whoops, this happens when directly copying from the cba docu


if([ACE_player, cursorObject] call FUNC(canApplyHandcuffs)) exitWith {
[cursorObject, true] call FUNC(setHandcuffed);
if([ACE_player, _target] call FUNC(canApplyHandcuffs)) exitWith {
Copy link
Member

Choose a reason for hiding this comment

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

Space missing in if (.

@jonpas jonpas dismissed their stale review September 21, 2017 23:59

Requested changes addressed

@jonpas jonpas modified the milestones: 3.12.0, 3.11.0 Sep 22, 2017
<Key ID="STR_ACE_Captives_KeyComb_Description">
<English>Sets the unit under the cursor captive.</English>
<German>Nimmt die Einheit vor dem Cursor fest.</German>
</Key>¸¸¸¸
Copy link
Author

@klemmchr klemmchr Sep 22, 2017

Choose a reason for hiding this comment

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

This points got added with the merge, didn't them? @jonpas

Copy link
Member

Choose a reason for hiding this comment

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

Woops, remove them, yeah. 😆

@@ -35,6 +36,22 @@ if (isServer) then {

if (!hasInterface) exitWith {};

//Add Keybind:
Copy link
Member

Choose a reason for hiding this comment

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

Many spaces. This comment is kind of superfluous anyways, it's seen immediately it's a keybind thing.

@PabstMirror
Copy link
Contributor

Forgot FUNC(setHandcuffed needs to run were target is local, pushed small change to use targetEvent

@PabstMirror PabstMirror merged commit 3d340bb into acemod:master Sep 26, 2017
@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:** kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants