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

FastRoping - Add rope items which deploy at lengths #6498

Merged
merged 14 commits into from
Jan 12, 2019
53 changes: 49 additions & 4 deletions addons/fastroping/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,40 @@ class CfgVehicles {
statement = QUOTE([vehicle _player] call FUNC(stowFRIES));
showDisabled = 0;
};
class ACE_deployRopes {
displayName = CSTRING(Interaction_deployRopes);
condition = QUOTE([ARR_2(_player, vehicle _player)] call FUNC(canDeployRopes));
statement = QUOTE([ARR_2(QUOTE(QGVAR(deployRopes)), [vehicle _player])] call CBA_fnc_serverEvent);
class ACE_deployRopes12 {
displayName = CSTRING(Interaction_deployRopes12);
condition = QUOTE([_player, vehicle _player] call FUNC(canDeployRopes) && (('ACE_rope12' in (backpackItems _player)) || ('ACE_rope12' in (ItemCargo vehicle _player))));
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
statement = QUOTE([QGVAR(deployRopes), [vehicle _player, 12]] call CBA_fnc_serverEvent);
showDisabled = 0;
priority = 1;
};
class ACE_deployRopes15 {
displayName = CSTRING(Interaction_deployRopes15);
condition = QUOTE([_player, vehicle _player] call FUNC(canDeployRopes) && (('ACE_rope15' in (backpackItems _player)) || ('ACE_rope15' in (ItemCargo vehicle _player))));
statement = QUOTE([QGVAR(deployRopes), [vehicle _player, 15]] call CBA_fnc_serverEvent);
showDisabled = 0;
priority = 1;
};
class ACE_deployRopes18 {
displayName = CSTRING(Interaction_deployRopes18);
condition = QUOTE([_player, vehicle _player] call FUNC(canDeployRopes) && (('ACE_rope18' in (backpackItems _player)) || ('ACE_rope18' in (ItemCargo vehicle _player))));
statement = QUOTE([QGVAR(deployRopes), [vehicle _player, 18]] call CBA_fnc_serverEvent);
showDisabled = 0;
priority = 1;
};
class ACE_deployRopes27 {
displayName = CSTRING(Interaction_deployRopes27);
condition = QUOTE([_player, vehicle _player] call FUNC(canDeployRopes) && (('ACE_rope27' in (backpackItems _player)) || ('ACE_rope27' in (ItemCargo vehicle _player))));
statement = QUOTE([QGVAR(deployRopes), [vehicle _player, 27]] call CBA_fnc_serverEvent);
showDisabled = 0;
priority = 1;
};
class ACE_deployRopes36 {
displayName = CSTRING(Interaction_deployRopes36);
condition = QUOTE([_player, vehicle _player] call FUNC(canDeployRopes) && (('ACE_rope36' in (backpackItems _player)) || ('ACE_rope36' in (ItemCargo vehicle _player))));
statement = QUOTE([QGVAR(deployRopes), [vehicle _player, 36]] call CBA_fnc_serverEvent);
showDisabled = 0;
priority = 1;
};
class ACE_cutRopes {
displayName = CSTRING(Interaction_cutRopes);
Expand Down Expand Up @@ -252,4 +281,20 @@ class CfgVehicles {
};
};
};
class NATO_Box_Base;
class ACE_fastropingSupplyCrate: NATO_Box_Base {
scope = 2;
scopeCurator = 2;
accuracy = 1000;
displayName = CSTRING(Ropesupply);
model = "\A3\Weapons_F\AmmoBoxes\Box_NATO_AmmoVeh_F.p3d";
author = "Pokertour";
class TransportItems {
MACRO_ADDITEM(ACE_rope12,15);
MACRO_ADDITEM(ACE_rope15,15);
MACRO_ADDITEM(ACE_rope18,15);
MACRO_ADDITEM(ACE_rope27,15);
MACRO_ADDITEM(ACE_rope36,15);
};
};
};
60 changes: 60 additions & 0 deletions addons/fastroping/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
class CfgWeapons {
class InventoryItem_Base_F;
class ACE_ItemCore;

class ACE_rope12: ACE_ItemCore {
scope = 2;
picture = QPATHTOF(data\m_rope_ca);
model = "\A3\Structures_F_Heli\Items\Tools\Rope_01_F.p3d";
displayName = CSTRING(Rope_12_Display);
descriptionShort = CSTRING(Rope_12_Desc_Short);
descriptionUse = CSTRING(Rope_12_Desc_Use);
class ItemInfo: InventoryItem_Base_F {
mass = 36;
};
};
class ACE_rope15: ACE_ItemCore {
scope = 2;
picture = QPATHTOF(data\m_rope_ca);
model = "\A3\Structures_F_Heli\Items\Tools\Rope_01_F.p3d";
displayName = CSTRING(Rope_15_Display);
descriptionShort = CSTRING(Rope_15_Desc_Short);
descriptionUse = CSTRING(Rope_15_Desc_Use);
class ItemInfo: InventoryItem_Base_F {
mass = 45;
};
};
class ACE_rope18: ACE_ItemCore {
scope = 2;
picture = QPATHTOF(data\m_rope_ca);
model = "\A3\Structures_F_Heli\Items\Tools\Rope_01_F.p3d";
displayName = CSTRING(Rope_18_Display);
descriptionShort = CSTRING(Rope_18_Desc_Short);
descriptionUse = CSTRING(Rope_18_Desc_Use);
class ItemInfo: InventoryItem_Base_F {
mass = 54;
};
};
class ACE_rope27: ACE_ItemCore {
scope = 2;
picture = QPATHTOF(data\m_rope_ca);
model = "\A3\Structures_F_Heli\Items\Tools\Rope_01_F.p3d";
displayName = CSTRING(Rope_27_Display);
descriptionShort = CSTRING(Rope_27_Desc_Short);
descriptionUse = CSTRING(Rope_27_Desc_Use);
class ItemInfo: InventoryItem_Base_F {
mass = 81;
};
};
class ACE_rope36: ACE_ItemCore {
scope = 2;
picture = QPATHTOF(data\m_rope_ca);
model = "\A3\Structures_F_Heli\Items\Tools\Rope_01_F.p3d";
displayName = CSTRING(Rope_36_Display);
descriptionShort = CSTRING(Rope_36_Desc_Short);
descriptionUse = CSTRING(Rope_36_Desc_Use);
class ItemInfo: InventoryItem_Base_F {
mass = 108;
};
};
};
3 changes: 2 additions & 1 deletion addons/fastroping/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CfgPatches {
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author = ECSTRING(common,ACETeam);
authors[] = {"KoffeinFlummi", "BaerMitUmlaut"};
authors[] = {"KoffeinFlummi", "BaerMitUmlaut", "Pokertour"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
Expand All @@ -19,3 +19,4 @@ class CfgPatches {
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"
#include "CfgWaypoints.hpp"
#include "CfgWeapons.hpp"
52 changes: 49 additions & 3 deletions addons/fastroping/functions/fnc_deployRopes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
* None
*
* Example:
* [_vehicle] call ace_fastroping_fnc_deployRopes
* [_vehicle, _ropelength] call ace_fastroping_fnc_deployRopes
*
* Public: No
*/
params ["_vehicle"];
params ["_vehicle", "_ropelength"];

private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;

Expand All @@ -24,6 +24,52 @@ private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
{
private _ropeOrigin = _x;
private _hook = QGVAR(helper) createVehicle [0, 0, 0];
switch (_ropelength) do {
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
case 12: {
_ropelength = 12.2;
if ("ACE_rope12" in (backpackItems ACE_player)) then {
ACE_player removeItemFromBackpack "ACE_rope12";
} else {
_vehicle removeItem "ACE_rope12";
};
};
case 15:{
_ropelength = 15.2;
if ("ACE_rope15" in (backpackitems ACE_player)) then {
ACE_player removeItemFromBackpack "ACE_rope15";
} else {
_vehicle removeItem "ACE_rope15";
};
};
case 18: {
_ropelength = 18.3;
if ("ACE_rope18" in (backpackItems ACE_player)) then {
ACE_player removeItemFromBackpack "ACE_rope18";
} else {
_vehicle removeItem "ACE_rope18";
};
};
case 27: {
_ropelength = 27.4;
if ("ACE_rope27" in (backpackItems ACE_player)) then {
ACE_player removeItemFromBackpack "ACE_rope27";
} else {
_vehicle removeItem "ACE_rope27";
};
};
case 36: {
_ropelength = 36.6;
if ("ACE_rope36" in (backpackitems ACE_player)) then {
ACE_player removeItemFromBackpack "ACE_rope36";
} else {
_vehicle removeItem "ACE_rope36";
};
};

default {

};
};
_hook allowDamage false;
if (_ropeOrigin isEqualType []) then {
_hook attachTo [_hookAttachment, _ropeOrigin];
Expand All @@ -39,7 +85,7 @@ private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];

private _ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
private _ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1];
ropeUnwind [_ropeBottom, 30, 34.5, false];
ropeUnwind [_ropeBottom, 30, _ropelength, false];

_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
Expand Down
84 changes: 84 additions & 0 deletions addons/fastroping/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,89 @@
<Chinese>讓單位快速繩降</Chinese>
<Korean>패스트 로프를 놓음</Korean>
</Key>
<Key ID="STR_ACE_Fastroping_Interaction_deployRopes12">
<English>Deploy 12m ropes</English>
<French>Déployer les cordes 12m</French>
</Key>
<Key ID="STR_ACE_Fastroping_Interaction_deployRopes15">
<English>Deploy 15m ropes</English>
<French>Déployer les cordes 15m</French>
</Key>
<Key ID="STR_ACE_Fastroping_Interaction_deployRopes18">
<English>Deploy 18m ropes</English>
<French>Déployer les cordes 18m</French>
</Key>
<Key ID="STR_ACE_Fastroping_Interaction_deployRopes27">
<English>Deploy 27m ropes</English>
<French>Déployer les cordes 27m</French>
</Key>
<Key ID="STR_ACE_Fastroping_Interaction_deployRopes36">
<English>Deploy 36m ropes</English>
<French>Déployer les cordes 36m</French>
</Key>
<Key ID="STR_ACE_Fastroping_Ropesupply">
<English>[ACE] Ropes Supply crate</English>
<French>[ACE] Caisse de Cordes</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_12_Display">
<English>Rope 12.2 meters</English>
<French>Corde 12.2 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_12_Desc_Short">
<English>Fastroping Rope 12.2 meters</English>
<French>Corde Fastrope 12.2 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_12_Desc_Use">
<English>Used to do a 12.2 meters fastroping.</English>
<French>Utilisé pour faire une fastrope de 12.2 mètres.</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_15_Display">
<English>Rope 15.2 meters</English>
<French>Corde 15.2 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_15_Desc_Short">
<English>Fastroping Rope 15.2 meters</English>
<French>Corde Fastrope 15.2 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_15_Desc_Use">
<English>Used to do a 15.2 meters fastroping.</English>
<French>Utilisé pour faire une fastrope de 15.2 mètres.</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_18_Display">
<English>Rope 18.3 meters</English>
<French>Corde 18.3 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_18_Desc_Short">
<English>Fastroping Rope 18.3 meters</English>
<French>Corde Fastrope 18.3 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_18_Desc_Use">
<English>Used to do a 18.3 meters fastroping.</English>
<French>Utilisé pour faire une fastrope de 18.3 mètres.</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_27_Display">
<English>Rope 27.4 meters</English>
<French>Corde 27.4 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_27_Desc_Short">
<English>Fastroping Rope 27.4 meters</English>
<French>Corde Fastrope 27.4 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_27_Desc_Use">
<English>Used to do a 27.4 meters fastroping.</English>
<French>Utilisé pour faire une fastrope de 27.4 mètres.</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_36_Display">
<English>Rope 36.6 meters</English>
<French>Corde 36.6 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_36_Desc_Short">
<English>Fastroping Rope 36.6 meters</English>
<French>Corde Fastrope 36.6 mètres</French>
</Key>
<Key ID="STR_ACE_Fastroping_Rope_36_Desc_Use">
<English>Used to do a 36.6 meters fastroping.</English>
<French>Utilisé pour faire une fastrope de 36.6 mètres.</French>
</Key>
</Package>
</Project>