-
Notifications
You must be signed in to change notification settings - Fork 737
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
Added captive hotkey #5529
Conversation
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. |
addons/captives/XEH_postInit.sqf
Outdated
}; | ||
|
||
if([ACE_player, cursorObject] call FUNC(canRemoveHandcuffs)) exitWith { | ||
[cursorObject, false] call FUNC(setHandcuffed); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@commy2 ?
addons/captives/XEH_postInit.sqf
Outdated
//Add Keybind: | ||
["ACE3 Common", QGVAR(captives), [(localize LSTRING(KeyComb)), (localize LSTRING(KeyComb_description))], | ||
{ | ||
if !(cursorObject isKindOf "Man") exitWith {}; |
There was a problem hiding this comment.
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.
addons/captives/stringtable.xml
Outdated
@@ -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> |
There was a problem hiding this comment.
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.
addons/captives/XEH_postInit.sqf
Outdated
//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 {}; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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};
addons/captives/XEH_postInit.sqf
Outdated
@@ -1,4 +1,5 @@ | |||
#include "script_component.hpp" | |||
#include “\a3\editor_f\Data\Scripts\dikCodes.h” |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
addons/captives/XEH_postInit.sqf
Outdated
|
||
if([ACE_player, cursorObject] call FUNC(canApplyHandcuffs)) exitWith { | ||
[cursorObject, true] call FUNC(setHandcuffed); | ||
if([ACE_player, _target] call FUNC(canApplyHandcuffs)) exitWith { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing in if (
.
addons/captives/stringtable.xml
Outdated
<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>¸¸¸¸ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, remove them, yeah. 😆
addons/captives/XEH_postInit.sqf
Outdated
@@ -35,6 +36,22 @@ if (isServer) then { | |||
|
|||
if (!hasInterface) exitWith {}; | |||
|
|||
//Add Keybind: |
There was a problem hiding this comment.
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.
Forgot FUNC(setHandcuffed needs to run were target is local, pushed small change to use targetEvent |
When merged this pull request will:
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.