ACE2 concertina wire port.

This commit is contained in:
ulteq 2015-06-04 17:11:09 +02:00
parent b5544ad390
commit 39a6c29e3e
26 changed files with 969 additions and 0 deletions

View File

@ -0,0 +1,80 @@
ambient[]={1.000000,1.000000,1.000000,1.000000};
diffuse[]={1.000000,1.000000,1.000000,1.000000};
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
emmisive[]={0.000000,0.000000,0.000000,1.000000};
specular[]={1.000000,1.000000,1.000000,1.000000};
specularPower=83.900002;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="z\ace\addons\apl\data\jezek_texture_NOHQ.tga";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource="tex";
class uvTransform
{
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage4 {
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource="tex";
class uvTransform
{
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage5 {
texture="z\ace\addons\apl\data\jezek_texture_SMDI.tga";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage6 {
texture="#(ai,32,128,1)fresnel(1.85,0.64)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage7 {
texture="a3\data_f\env_land_co.paa";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,78 @@
ambient[]={1.000000,1.000000,1.000000,1.000000};
diffuse[]={1.000000,1.000000,1.000000,1.000000};
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
emmisive[]={0.000000,0.000000,0.000000,1.000000};
specular[]={1.000000,1.000000,1.000000,0.000000};
specularPower=16.000000;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="z\ace\addons\apl\data\BarbWire_A_NOHQ.tga";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage4 {
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage5 {
texture="#(argb,8,8,3)color(0,0,1,1,SMDI)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage6 {
texture="#(ai,32,128,1)fresnel(0.01,0.01)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};
class Stage7 {
texture="#(argb,8,8,3)color(0,0,0,1,CO)";
uvSource="tex";
class uvTransform {
aside[]={1.000000,0.000000,0.000000};
up[]={0.000000,1.000000,0.000000};
dir[]={0.000000,0.000000,0.000000};
pos[]={0.000000,0.000000,0.000000};
};
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
z\ace\addons\concertina_wire

View File

@ -0,0 +1,34 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
};
};
class Extended_Killed_EventHandlers {
// TODO: Probably needs handledamage eh for better tracking what killed the wire
// Also disallow wire becoming destroyed by small explosives e.g. 40mm
class ACE_ConcertinaWire {
class ADDON {
killed = QUOTE(call FUNC(handleKilled));
};
};
class Land_Razorwire_F {
class ADDON {
killed = QUOTE(call FUNC(handleKilled));
};
};
};
class Extended_Init_EventHandlers {
class ACE_ConcertinaWireCoil {
class ADDON {
init = QUOTE(_this call DEFUNC(dragging,initObject));
};
};
};

View File

@ -0,0 +1,139 @@
class CfgVehicles {
class Fence;
class thingX;
class NonStrategic;
class ACE_ConcertinaWireNoGeo: Fence {
XEH_ENABLED;
scope = 1;
displayName = "";
model = PATHTOF(data\ACE_ConcertinaWireNoGeo.p3d);
destrType = "DestructTent";
accuracy = 0.3;
mapSize = 2.8;
animated = 1;
autocenter = 0;
armor = 200;
class AnimationSources {
class fix1 {
source = "user";
animPeriod = 1e-007;
initPhase = 0;
};
class fix2: fix1 {};
class fix3: fix1 {};
class fix4: fix1 {};
class rotate {
source = "user";
animPeriod = 1e-007;
};
class wire_2 {
source = "user";
animPeriod = 1e-007;
};
class wire_3: wire_2{};
class wire_4: wire_2{};
class wire_5: wire_2{};
class wire_6: wire_2{};
class wire_7: wire_2{};
class wire_8: wire_2{};
class wire_9: wire_2{};
class wire_10: wire_2{};
class wire_11: wire_2{};
class wire_12: wire_2{};
class wire_13: wire_2{};
class wire_14: wire_2{};
class wire_15: wire_2{};
class wire_16: wire_2{};
class wire_17: wire_2{};
class wire_18: wire_2{};
class wire_2_1: wire_2 {
animPeriod = 8;
};
class wire_3_1: wire_2_1 {};
class wire_4_1: wire_2_1 {};
class wire_5_1: wire_2_1 {};
class wire_6_1: wire_2_1 {};
class wire_7_1: wire_2_1 {};
class wire_8_1: wire_2_1 {};
class wire_9_1: wire_2_1 {};
class wire_10_1: wire_2_1 {};
class wire_11_1: wire_2_1 {};
class wire_12_1: wire_2_1 {};
class wire_13_1: wire_2_1 {};
class wire_14_1: wire_2_1 {};
class wire_15_1: wire_2_1 {};
class wire_16_1: wire_2_1 {};
class wire_17_1: wire_2_1 {};
class wire_18_1: wire_2_1 {};
};
};
class ACE_ConcertinaWire: ACE_ConcertinaWireNoGeo {
scope = 2;
displayName = $STR_ACE_CONCERTINA_WIRE;
model = PATHTOF(data\ACE_ConcertinaWire.p3d);
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 5;
condition = "true";
class ACE_Dismount {
selection = "";
displayName = "$STR_ACE_UNROLLWIRE";
distance = 5;
condition = "true";
statement = QUOTE([ARR_2(_target,_player)] call FUNC(dismount));
showDisabled = 0;
exceptions[] = {};
priority = 5;
icon = PATHTOF(UI\icon_sandbag_ca.paa);
};
};
};
};
class ACE_ConcertinaWireCoil: thingX {
XEH_ENABLED;
scope = 2;
displayName = $STR_ACE_CONCERTINA_WIRECOIL;
model = PATHTOF(data\ACE_ConcertinaWireCoil.p3d);
mapsize = 0.5;
animated = 0;
nameSound = "fence";
typicalCargo[] = {};
transportAmmo = 0;
transportRepair = 0;
transportFuel = 0;
cost = 0;
armor = 1000;
destrType = "DestructNo";
accuracy = 1000;
autocenter = 0;
EGVAR(dragging,canDrag) = 1;
EGVAR(dragging,dragPosition[]) = {0,0.5,0.5};
EGVAR(dragging,dragDirection) = 0;
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 4;
condition = "true";
class ACE_Deploy {
selection = "";
displayName = "$STR_ACE_ROLLWIRE";
distance = 4;
condition = "true";
statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy));
showDisabled = 0;
exceptions[] = {};
priority = 5;
icon = PATHTOF(UI\icon_sandbag_ca.paa);
};
};
};
};
class Land_Razorwire_F: NonStrategic {
XEH_ENABLED;
};
};

View File

@ -0,0 +1,10 @@
ace_concertina_wire
===============
Adds concertina wire.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [Ruthberg] (http://github.com/Ulteq)

Binary file not shown.

View File

@ -0,0 +1,11 @@
#include "script_component.hpp"
GVAR(placer) = objNull;
GVAR(deployPFH) = -1;
// Deploy concertina wire if interact menu is opened
["interactMenuOpened", {
if (GVAR(deployPFH) != -1) then {
GVAR(placer) setVariable [QGVAR(wireDeployed), true];
};
}] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
ADDON = false;
PREP(deploy);
PREP(dismount);
PREP(dismountSuccess);
PREP(handleKilled);
ADDON = true;

View File

@ -0,0 +1,15 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author[] = {"Rocko", "Ruthberg"};
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,290 @@
class CfgSkeletons {
class Default {
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class ACE_SB_Skeleton: Default {};
class ACE_ConcertinaSkeleton {
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] = {
"1","",
"2","1",
"3","2",
"4","3",
"5","4",
"6","5",
"7","6",
"8","7",
"9","8",
"10","9",
"11","10",
"12","11",
"13","12",
"14","13",
"15","14",
"16","15",
"17","16",
"18","17",
"fix1","",
"fix2","",
"fix3","",
"fix4",""
};
};
class ace_tacticalladder_skeleton: Default {
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] = {
"base","",
"1","base",
"2","1",
"3","2",
"4","3",
"5","4",
"6","5",
"7","6",
"8","7",
"9","8",
"10","9",
"11","10",
"step","11"
};
};
};
class CfgModels {
class Default {
sectionsInherit="";
sections[] = {""};
skeletonName = "";
};
class ace_sandbag_build {
sectionsInherit = "Default";
sections[] = {"zbytek"};
skeletonName = "ACE_SB_Skeleton";
};
class ACE_ConcertinaWire {
skeletonName = "ACE_ConcertinaSkeleton";
sections[] = {};
sectionsInherit = "";
class Animations {
class fix1 {
type="hide";
source="user";
selection="fix1";
minValue = 0;
maxValue = 1;
minPhase = 0;
maxPhase = 1;
hideValue = 1;
};
class fix2: fix1 {
selection="fix2";
};
class fix3: fix1 {
selection="fix3";
};
class fix4: fix1 {
selection="fix4";
};
class rotate {
type = "rotation";
source = "";
sourceAddress = "loop";
selection = "1";
axis = "rotate_axis";
minValue = 0;
maxValue = 360;
angle0="rad -360";
angle1="rad +360";
};
class wire_2 {
type = "translation";
source = "";
selection = "2";
axis = "2_axis";
animPeriod = 0;
minValue = 0;
maxValue = 1;
minPhase = 0;
maxPhase = 1;
offset0 = 0;
offset1 = -1;
};
class wire_3: wire_2 {
selection = "3"; axis = "3_axis";
};
class wire_4: wire_2 {
selection = "4"; axis = "4_axis";
};
class wire_5: wire_2 {
selection = "5"; axis = "5_axis";
};
class wire_6: wire_2 {
selection = "6"; axis = "6_axis";
};
class wire_7: wire_2 {
selection = "7"; axis = "7_axis";
};
class wire_8: wire_2 {
selection = "8"; axis = "8_axis";
};
class wire_9: wire_2 {
selection = "9"; axis = "9_axis";
};
class wire_10: wire_2 {
selection = "10"; axis = "10_axis";
};
class wire_11: wire_2 {
selection = "11"; axis = "11_axis";
};
class wire_12: wire_2 {
selection = "12"; axis = "12_axis";
};
class wire_13: wire_2 {
selection = "13"; axis = "13_axis";
};
class wire_14: wire_2 {
selection = "14"; axis = "14_axis";
};
class wire_15: wire_2 {
selection = "15"; axis = "15_axis";
};
class wire_16: wire_2 {
selection = "16"; axis = "16_axis";
};
class wire_17: wire_2 {
selection = "17"; axis = "17_axis";
};
class wire_18: wire_2 {
selection = "18"; axis = "18_axis";
};
class wire_2_1: wire_2 {
selection = "2";axis = "2_axis";offset1 = -1;
};
class wire_3_1: wire_2_1 {
selection = "3"; axis = "3_axis";
};
class wire_4_1: wire_2_1 {
selection = "4"; axis = "4_axis";
};
class wire_5_1: wire_2_1 {
selection = "5"; axis = "5_axis";
};
class wire_6_1: wire_2_1 {
selection = "6"; axis = "6_axis";
};
class wire_7_1: wire_2_1 {
selection = "7"; axis = "7_axis";
};
class wire_8_1: wire_2_1 {
selection = "8"; axis = "8_axis";
};
class wire_9_1: wire_2_1 {
selection = "9"; axis = "9_axis";
};
class wire_10_1: wire_2_1 {
selection = "10"; axis = "10_axis";
};
class wire_11_1: wire_2_1 {
selection = "11"; axis = "11_axis";
};
class wire_12_1: wire_2_1 {
selection = "12"; axis = "12_axis";
};
class wire_13_1: wire_2_1 {
selection = "13"; axis = "13_axis";
};
class wire_14_1: wire_2_1 {
selection = "14"; axis = "14_axis";
};
class wire_15_1: wire_2_1 {
selection = "15"; axis = "15_axis";
};
class wire_16_1: wire_2_1 {
selection = "16"; axis = "16_axis";
};
class wire_17_1: wire_2_1 {
selection = "17"; axis = "17_axis";
};
class wire_18_1: wire_2_1 {
selection = "18"; axis = "18_axis";
};
};
};
class ACE_ConcertinaWireNoGeo: ACE_ConcertinaWire {};
class ace_tacticalladder {
skeletonName = "ace_tacticalladder_skeleton";
sections[] = { "roadway" };
sectionsInherit = "";
class Animations {
class rotate {
type = "rotation";
source = "";
sourceAddress = "clamp";
selection = "base";
axis = "axis_rotate";
minValue = 0;
maxValue = 90;
angle0="rad 0";
angle1="rad +90";
};
class extract_1 {
type = "translation";
source = "";
selection = "1";
axis = "axis_1";
animPeriod = 0;
minValue = 0;
maxValue = 1;
minPhase = 0;
maxPhase = 1;
offset0 = 0;
offset1 = 0.82;
};
class extract_2: extract_1 {
selection = "2";
axis = "axis_2";
};
class extract_3: extract_1 {
selection = "3";
axis = "axis_3";
};
class extract_4: extract_1 {
selection = "4";
axis = "axis_4";
};
class extract_5: extract_1 {
selection = "5";
axis = "axis_5";
};
class extract_6: extract_1 {
selection = "6";
axis = "axis_6";
};
class extract_7: extract_1 {
selection = "7";
axis = "axis_7";
};
class extract_8: extract_1 {
selection = "8";
axis = "axis_8";
};
class extract_9: extract_1 {
selection = "9";
axis = "axis_9";
};
class extract_10: extract_1 {
selection = "10";
axis = "axis_10";
};
class extract_11: extract_1 {
selection = "11";
axis = "axis_11";
};
};
};
};

View File

@ -0,0 +1,69 @@
#include "script_component.hpp"
PARAMS_2(_wirecoil,_unit);
private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"];
_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{
_wireNoGeo animate [_x, 1];
} foreach WIRE_FAST;
GVAR(placer) = _unit;
_dir = getDir _unit;
_pos = getPosASL _unit;
_wireNoGeoPos = _pos vectorAdd [1.1 * sin(_dir), 1.1 * cos(_dir), 0];
_wireNoGeo setDir _dir;
_wireNoGeo setPosASL _wireNoGeoPos;
deleteVehicle _wirecoil;
_unit setVariable [QGVAR(wireDeployed), false];
GVAR(deployPFH) = [{
EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action);
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
_posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit);
_dirVect = _posStart vectorDiff _posEnd;
_dir = _dirVect call CBA_fnc_vectDir;
_range = vectorMagnitude _dirVect;
_anim = 0 max (1 - (_range / 12));
if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith {
_wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0];
{
_wire animate [_x, _anim];
} foreach WIRE_FAST;
[{
EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos);
if (_wire animationPhase "wire_2" == _anim) then {
deleteVehicle _wireNoGeo;
_wire setDir _dir;
_wire setPosASL _wireNoGeoPos;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler;
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_wireNoGeo setDir _dir;
{
_wireNoGeo animate [_x, _anim];
} foreach WIRE_FAST;
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler;
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
GVAR(placer) setVariable [QGVAR(Deploy),
[GVAR(placer), "DefaultAction",
{GVAR(deployPFH) != -1},
{GVAR(placer) setVariable [QGVAR(wireDeployed), true]}
] call EFUNC(common,AddActionEventHandler)];

View File

@ -0,0 +1,26 @@
#include "script_component.hpp"
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith {
[{
_this call FUNC(dismount);
}, _this] call EFUNC(common,execNextFrame);
};
PARAMS_2(_wire,_unit);
private ["_config", "_delay"];
_config = (configFile >> "CfgVehicles" >> typeOf _unit);
_delay = if (getNumber(_config >> "engineer") == 1 || getNumber(_config >> "canDeactivateMines") == 1) then {60} else {120};
// TODO: Animation?
[
_delay,
[_wire],
{(_this select 0) call FUNC(dismountSuccess)},
{},
localize "STR_ACE_UNROLLWIRE",
{true},
["isnotinside"]
] call EFUNC(common,progressBar);

View File

@ -0,0 +1,28 @@
#include "script_component.hpp"
PARAMS_1(_wire);
{
_wire animate [_x, 1];
} foreach WIRE_FAST;
[{
EXPLODE_1_PVT(_this select 0,_wire);
if (_wire animationPhase "wire_2" == 1) then {
private ["_dir", "_pos", "_wirecoil"];
_dir = getDir _wire;
_pos = getPosASL _wire;
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
deleteVehicle _wire;
_wirecoil setDir _dir;
_wirecoil setPosASL _pos;
_wirecoil setVelocity [0, 0, 0];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0, [_wire]] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,113 @@
#include "script_component.hpp"
PARAMS_2(_wire,_killer);
if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {};
private ["_type", "_mode", "_distance", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w", "_vehicle"];
_type = typeOf _wire;
_mode = switch (_type) do {
case "ACE_ConcertinaWire": { 0 };
case "Land_Razorwire_F": { 1 };
default { -1 };
};
if (_mode == -1) exitWith {};
// _mode = 0 = Single Coil
// _mode = 1 = Triple Coil
// --------------------------------
// L M R
// 4.54929 (4)
// 6.13564 (6)
//9.78744 (10)
_distance = _wire distance _killer;
if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire
_type = typeOf _wire;
_anim = _wire animationPhase "wire_2";
_pos_w = getPos _wire;
_dir_w = getDir _wire;
_vehicle = vehicle _killer;
if (_mode == 0) then {
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
_x = _pos_w select 0;
_y = _pos_w select 1;
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
_wireCheckPosAr = [
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)],
[_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)]
];
{
_found = false;
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
_no = _no - [_wire]; //diag_log _no;
if (count _no > 0) exitWith {
_found = true; //diag_log "found";
};
} foreach _wireCheckPosAr;
// Double coil found!
if (_found) then {
_mode = 1;
} else {
// Randomly make a single coil also catch tanks, if speed is high
if (_vehicle isKindOf "Tank" && {20 > random 100} && {speed _vehicle > 30}) then {
_mode = 1;
} else {
if !(_vehicle isKindOf "Tank") then {
_mode = 1;
};
};
};
};
if (_mode == 1) then {
switch (true) do {
case (_vehicle isKindOf "Tank"): {
_parts = ["ltrack","rtrack"];
};
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
} else {
switch (true) do {
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
};
if (canMove _vehicle) then {
{
_selectionPart = "hit" + _x;
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
_selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
_vehicle setHit [_selection,1];
};
} foreach _parts; //TODO: Check sys_vehicle_damage compatibility
};
if (_mode == 1) then {
if (_vehicle isKindOf "StaticWeapon") exitWith {};
[{
PARAMS_2(_vehicle,_wire);
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
private ["_vPos", "_vDir"];
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
_vPos = getPosASL _vehicle;
_vDir = getDir _vehicle;
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires
}, [_vehicle, _wire], 0.1, 0] call EFUNC(common,waitAndExecute);
};
//TODO: Create broken geoless wire (two version)
//TODO: Make wire remains stop vehicles

View File

@ -0,0 +1 @@
#include "\z\ace\addons\concertina_wire\script_component.hpp"

View File

@ -0,0 +1,15 @@
#define COMPONENT concertina_wire
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_CONCERTINA_WIRE
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_CONCERTINA_WIRE
#define DEBUG_SETTINGS DEBUG_SETTINGS_CONCERTINA_WIRE
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define WIRE_FAST ["wire_2","wire_3","wire_4","wire_5","wire_6","wire_7","wire_8","wire_9","wire_10","wire_11","wire_12","wire_13","wire_14","wire_15","wire_16","wire_17","wire_18"]
#define WIRE_SLOW ["wire_2_1","wire_3_1","wire_4_1","wire_5_1","wire_6_1","wire_7_1","wire_8_1","wire_9_1","wire_10_1","wire_11_1","wire_12_1","wire_13_1","wire_14_1","wire_15_1","wire_16_1","wire_17_1","wire_18_1"]

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="concertina_wire">
<Key ID="STR_ACE_CONCERTINA_WIRE">
<English>Concertina Wire</English>
<German>NATO-Draht</German>
<Russian>Проволочная спираль</Russian>
<Polish>Drut kolczasty</Polish>
<Spanish>Concertina wire</Spanish>
<French>Concertina wire</French>
<Czech>Ostnatý drát</Czech>
<Italian>Concertina wire</Italian>
<Hungarian>Concertina wire</Hungarian>
</Key>
<Key ID="STR_ACE_CONCERTINA_WIRECOIL">
<English>Concertina Wire Coil</English>
<German>NATO-Draht Rolle</German>
<Russian>Проволочная спираль (моток)</Russian>
<Polish>Zwój drutu kolczastego</Polish>
<Spanish>Concertina wire coil</Spanish>
<French>Concertina wire coil</French>
<Czech>Smyčka ostnatého drátu</Czech>
<Italian>Concertina wire coil</Italian>
<Hungarian>Concertina wire coil</Hungarian>
</Key>
<Key ID="STR_ACE_UNROLLWIRE">
<English>Dismount Concertina Wire</English>
<German>NATO-Draht abbauen</German>
<Russian>Демонтировать проволочную спираль</Russian>
<Polish>Zwiń drut kolczasty</Polish>
<Spanish>Dismount Concertina wire</Spanish>
<French>Dismount Concertina wire</French>
<Czech>Svinout ostnatý drát</Czech>
<Italian>Dismount Concertina wire</Italian>
<Hungarian>Dismount Concertina wire</Hungarian>
</Key>
<Key ID="STR_ACE_ROLLWIRE">
<English>Deploy Concertina Wire</English>
<German>NATO-Draht verlegen</German>
<Russian>Монтировать проволочную спираль</Russian>
<Polish>Rozwiń drut kolczasty</Polish>
<Spanish>Deploy Concertina wire</Spanish>
<French>Deploy Concertina wire</French>
<Czech>Rozvinout ostnatý drát</Czech>
<Italian>Deploy Concertina wire</Italian>
<Hungarian>Deploy Concertina wire</Hungarian>
</Key>
</Package>
</Project>