Skip to content

Commit

Permalink
Made it more ace compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
AdlerSalbei committed Dec 1, 2018
1 parent 17945ab commit 69ea3d2
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 128 deletions.
11 changes: 8 additions & 3 deletions addons/trenches/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CfgVehicles {
GVAR(removalDuration) = QGVAR(smallEnvelopeRemovalTime);
GVAR(placementData)[] = {2,3,0.35};
GVAR(grassCuttingPoints)[] = {{0,-0.5,0}};
GVAR(boundingBoxOffset) = "0.16";

editorCategory = "EdCat_Things";
editorSubcategory = "EdSubcat_Military";
Expand Down Expand Up @@ -135,6 +136,7 @@ class CfgVehicles {
GVAR(removalDuration) = QGVAR(bigEnvelopeRemovalTime);
GVAR(placementData)[] = {6,1.1,0.20};
GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}};
GVAR(boundingBoxOffset) = "0.197";

class GVAR(camouflagePositions) {
center[] = {-0.4, 0.4, 0.2};
Expand All @@ -150,6 +152,7 @@ class CfgVehicles {
GVAR(placementData)[] = {15,1.1,0.40};
GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}};
model = QPATHTOF(data\trench_gigant.p3d);
GVAR(boundingBoxOffset) = 0.557;

class GVAR(camouflagePositions) {
left1[] = {-0.5, 0.3, 0.5};
Expand All @@ -166,19 +169,21 @@ class CfgVehicles {
GVAR(placementData)[] = {6,1.1,0.20};
GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}};
model = QPATHTOF(data\trench_vehicle.p3d);
GVAR(boundingBoxOffset) = "0.34";

class GVAR(camouflagePositions) {};
class Attributes {};
};

class ACE_envelope_short: ACE_envelope_small {
displayName = CSTRING(EnvelopeshortName);
descriptionShort = CSTRING(EnevlopeshortDescription);
displayName = CSTRING(EnvelopeShortName);
descriptionShort = CSTRING(EnevlopeShortDescription);
GVAR(diggingDuration) = QGVAR(shortEnvelopeDigTime);
GVAR(removalDuration) = QGVAR(shortEnvelopeRemovalTime);
GVAR(placementData)[] = {6,1.1,0.20};
GVAR(placementData)[] = {10,1.1,0.20};
GVAR(grassCuttingPoints)[] = {{-1.5,-1,0},{1.5,-1,0}};
model = QPATHTOF(data\trench_short.p3d);
GVAR(boundingBoxOffset) = "0.16";

class GVAR(camouflagePositions) {
right[] = {1.1,0.2,0.2};
Expand Down
51 changes: 32 additions & 19 deletions addons/trenches/CfgWorlds.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
class CfgWorlds {
class Default {
surfaceTextureBasePath = "a3\map_data\";
filePrefix = "co.paa";
};
//Altis
class Altis: Default {
class Altis {
surfaceTextureBasePath = "a3\map_data\";
filePrefix = "co.paa";
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d" /*, "A3\plants_f\Clutter\c_Thistle_Thorn_Green.p3d"*/};
};
Expand All @@ -28,7 +25,7 @@ class CfgWorlds {
};
//Bray-Dunes
class SWU_Dunkirk_Bray_Dunes_1940: Baranow {
class SWU_Dunkirk_Bray_Dunes_1940 {
surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\";
filePrefix = "_co.paa";
camouflageObjects[] = {};
Expand Down Expand Up @@ -61,12 +58,16 @@ class CfgWorlds {
};
//Celle
class mbg_celle2: Chernarus {
class mbg_celle2 {
surfaceTextureBasePath = "ca\CHERNARUS\data\";
filePrefix = "detail_co.paa";
camouflageObjects[] = {};
};
//Chernarus Summer
class Chernarus_Summer: Chernarus {
class Chernarus_Summer {
surfaceTextureBasePath = "ca\CHERNARUS\data\";
filePrefix = "detail_co.paa";
camouflageObjects[] = {"ca\plants2\clutter\c_weed3.p3d"};
};
Expand All @@ -78,7 +79,7 @@ class CfgWorlds {
};
//Colleville
class Colleville: Baranow {
class Colleville {
surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\France\";
filePrefix = "co.paa";
camouflageObjects[] = {};
Expand Down Expand Up @@ -147,14 +148,16 @@ class CfgWorlds {
};
//Lythium
class lythium: Default {
class lythium {
surfaceTextureBasePath = "GBR\lythium\data\";
filePrefix = "co.paa";
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"};
};
//Malden
class Malden: Altis {
class Malden {
surfaceTextureBasePath = "a3\map_data\";
filePrefix = "co.paa";
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"};
class Surfaces {
class GdtForestMalden {
Expand All @@ -171,7 +174,7 @@ class CfgWorlds {
};
//Montherme
class SWU_Ardennes_1940: Baranow {
class SWU_Ardennes_1940 {
surfaceTextureBasePath = "WW2\TerrainsWW2_swurvin\Surfaces_t\";
filePrefix = "_co.paa";
camouflageObjects[] = {};
Expand Down Expand Up @@ -250,7 +253,7 @@ class CfgWorlds {
};
//Sark
class Hyde_Sark: Baranow {
class Hyde_Sark {
surfaceTextureBasePath = "WW2\TerrainsWW2_Hyde\Surfaces_t\";
filePrefix = "co.paa";
camouflageObjects[] = {};
Expand All @@ -276,14 +279,16 @@ class CfgWorlds {
};
//Staszow
class Staszow: Baranow {
class Staszow {
surfaceTextureBasePath = "WW2\TerrainsIF_t\Worlds\IF_Surfaces_t\staszow\";
filePrefix = "co.paa";
camouflageObjects[] = {};
};
//Stratis
class Stratis: Altis {
class Stratis {
surfaceTextureBasePath = "a3\map_data\";
filePrefix = "co.paa";
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"};
};
Expand All @@ -302,14 +307,22 @@ class CfgWorlds {
};
//Tanoa
class Tanoa : Altis{
class Tanoa {
surfaceTextureBasePath = "A3\Map_Data_Exp\";
filePrefix = "co.paa";
camouflageObjects[] = {"A3\Vegetation_F_Exp\Clutter\Grass\c_GrassBunch_HI.p3d"};
};
//United Sahrani
class Sara_dbe1 : Sara {
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"};
class Sara_dbe1 {
surfaceTextureBasePath = "ca\sara\Data\";
filePrefix = "detail_co.paa";
camouflageObjects[] = {"A3\plants_f\Clutter\c_Thistle_Thorn_Brown.p3d"};
class Surfaces {
class mesto {
texturePath = "ca\sara\Data\mesto_co.paa";
};
};
};
//Utes
Expand Down
1 change: 0 additions & 1 deletion addons/trenches/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ PREP(handleInteractMenuOpened);
PREP(handleKilled);
PREP(handlePlayerChanged);
PREP(handlePlayerInventoryChanged);
PREP(handleScrollWheel);
PREP(handleUnconscious);
PREP(initCurator);
PREP(initTrench);
Expand Down
5 changes: 4 additions & 1 deletion addons/trenches/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class CfgPatches {
author = ECSTRING(common,ACETeam);
authors[] = {"Grey", "esteldunedain", "chris579", "Salbei"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
//VERSION_CONFIG;
version = "3.12.3.36";
versionStr = "3.12.3.36";
versionAr[] = {3,12,3,36};
};
};

Expand Down
25 changes: 16 additions & 9 deletions addons/trenches/functions/fnc_addDigger.sqf
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
/*
@Authors
Salbei
@Arguments
- _unit, is the unit that helps digging
- _trench, the trench that is beeing dug
@Return Value
None
*/
* Author: Salbei
* Help digging trench.
*
* Arguments:
* 0: trench <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [TrenchObj, ACE_player] call ace_trenches_fnc_addDigger
*
* Public: No
*/

#include "script_component.hpp"

Expand Down Expand Up @@ -68,6 +75,6 @@ private _fnc_condition = {
true
};

[[_unit, _trench, _type, _handle], _fnc_onFinish, _fnc_onFailure, localize "STR_ace_trenches_DiggingTrench", _fnc_condition] call FUNC(progressBar);
[[_unit, _trench, _type, _handle], _fnc_onFinish, _fnc_onFailure, localize LSTRING(DiggingTrench), _fnc_condition] call FUNC(progressBar);

[_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation);;
17 changes: 17 additions & 0 deletions addons/trenches/functions/fnc_applyCamouflageAttribute.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@
@Example
?
*/
/*
* Author: Christian 'chris5790' Klemm
* Apply camouflage attribute to trench.
*
* Arguments:
* 0: object <OBJECT>
* 1: value <INT>
*
* Return Value:
* None
*
* Example:
* [TrenchObj, ACE_player] call ace_trenches_fnc_applyCamouflageAttribute
*
* Public: No
*/

#include "script_component.hpp"
params ["_object", "_value"];

Expand Down
16 changes: 16 additions & 0 deletions addons/trenches/functions/fnc_automaticFilePath.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Author: Salbei
* Automatic creation of a path to surface texture.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [TrenchObj, ACE_player] call ace_trenches_fnc_automaticFilePath
*
* Public: No
*/

#include "script_component.hpp"

if ((isText (configFile >> "CfgWorlds" >> worldName >> "surfaceTextureBasePath")) || ("surfaceTexture" in (uiNamespace getVariable ["Intercept_cba_capabilities",[]]))) exitWith {};
Expand Down
24 changes: 15 additions & 9 deletions addons/trenches/functions/fnc_canHelpDiggingTrench.sqf
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/*
@Authors
Salbei
@Arguments
?
@Return Value
?
@Example
?
*/
* Author: Salbei
* Check if unit can help digging trench.
*
* Arguments:
* 0: trench <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* Boolean
*
* Example:
* [TrenchObj, ACE_player] call ace_trenches_fnc_canHelpDiggingTrench
*
* Public: No
*/

#include "script_component.hpp"

Expand Down
1 change: 1 addition & 0 deletions addons/trenches/functions/fnc_canPlaceCamouflage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* Arguments:
* 0: trench <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* Can place <BOOL>
Expand Down
21 changes: 13 additions & 8 deletions addons/trenches/functions/fnc_canRemoveCamouflage.sqf
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
/*
@Authors
Christian 'chris5790' Klemm
@Arguments
?
@Return Value
?
@Example
?
* Author: chris579
* Checks if camouflage can be removed from trench
*
* Arguments:
* 0: trench <OBJECT>
*
* Return Value:
* Can remove <BOOL>
*
* Example:
* [TrenchObj] call ace_trenches_fnc_canPlaceCamouflage
*
* Public: No
*/
#include "script_component.hpp"

Expand Down
8 changes: 4 additions & 4 deletions addons/trenches/functions/fnc_continueDiggingTrench.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params ["_trench", "_unit",["_switchingDigger", false]];
TRACE_2("continueDiggingTrench",_trench,_unit);

private _actualProgress = _trench getVariable [QGVAR(progress, 0];
private _actualProgress = _trench getVariable [QGVAR(progress), 0];
if (_actualProgress == 1) exitWith {};

// Mark trench as being worked on
Expand Down Expand Up @@ -50,7 +50,7 @@ private _fnc_onFinish = {
_trench setVariable [QGVAR(diggingType), nil, true];

// Save progress global
_trench setVariable [QGVAR(progress, 1, true];
_trench setVariable [QGVAR(progress), 1, true];

// Reset animation
[_unit, "", 1] call EFUNC(common,doAnimation);
Expand All @@ -61,7 +61,7 @@ private _fnc_onFailure = {
_trench setVariable [QGVAR(diggingType), nil, true];

// Save progress global
private _progress = _trench getVariable [QGVAR(progress, 0];
private _progress = _trench getVariable [QGVAR(progress), 0];
_trench setVariable [QGVAR(progress), _progress, true];

// Reset animation
Expand All @@ -76,7 +76,7 @@ private _fnc_condition = {
true
};

[[_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize "STR_ace_trenches_DiggingTrench", _fnc_condition] call FUNC(progressBar);
[[_unit, _trench], _fnc_onFinish, _fnc_onFailure, localize LSTRING(DiggingTrench), _fnc_condition] call FUNC(progressBar);

if (_actualProgress == 0) then {
//Remove grass
Expand Down
Loading

0 comments on commit 69ea3d2

Please sign in to comment.