-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
657 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[sqf.var_all_caps] | ||
options.ignore = [ | ||
"MTS_RECOMPILES", "MTS_PREP_RECOMPILE" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
PREP(addIgniteMiclicAction); | ||
PREP(canStartMineClearing); | ||
PREP(canStopMineClearing); | ||
PREP(handleMineClearingEffects); | ||
PREP(igniteMiclic); | ||
PREP(initMineClearingActions); | ||
PREP(startMineClearing); | ||
PREP(stopMineClearing); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class CfgVehicles { | ||
class gm_Leopard1_base; | ||
class gm_BPz2_base: gm_Leopard1_base { | ||
class Attributes; | ||
}; | ||
class gm_BPz2a0_base: gm_BPz2_base { | ||
class Attributes: Attributes { | ||
class GVAR(mineClearing) { | ||
displayName = CSTRING(mineClearingDisplayName); | ||
property = QGVAR(enableMineClearing); | ||
control = "Checkbox"; | ||
defaultValue = "true"; | ||
typeName = "BOOL"; | ||
expression = QUOTE(_this setVariable [ARR_3(QQGVAR(enableMineClearing),_value,true)];); // Only run on server | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class SUBADDON { | ||
name = COMPONENT_NAME; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = { | ||
QUOTE(ADDON), | ||
"gm_vehicles_land_tracked_bpz2" | ||
}; | ||
skipWhenMissingDependencies = 1; | ||
author = ECSTRING(main,authors); | ||
authors[] = {"Timi007"}; | ||
url = ECSTRING(main,URL); | ||
VERSION_CONFIG; | ||
|
||
addonRootClass = QUOTE(ADDON); | ||
}; | ||
}; | ||
|
||
#include "CfgVehicles.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define SUBCOMPONENT compat_gm | ||
#define SUBCOMPONENT_BEAUTIFIED Compat GM | ||
#include "..\script_component.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Checks if the vehicle can start clearing mines. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Mine clearing vehicle (ABV/MiRPz) | ||
* 1: OBJECT - Caller | ||
* | ||
* Returns: | ||
* BOOLEAN - Can start clearing mines. | ||
* | ||
* Example: | ||
* _this call mts_engineer_fnc_canStartMineClearing | ||
* | ||
*/ | ||
|
||
params ["_vehicle", "_caller"]; | ||
|
||
(_caller isEqualTo (driver _vehicle)) && // is driver of the vehicle | ||
{_vehicle getVariable [QGVAR(enableMineClearing), true]} && // mine clearing enabled | ||
{!(_vehicle getVariable [QGVAR(mineClearingActive), false])} && // not already mine clearing | ||
{speed _vehicle <= MAX_MINE_CLEARING_SPEED} && | ||
{isEngineOn _vehicle} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Checks if the vehicle can stop clearing mines. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Mine clearing vehicle (ABV/MiRPz) | ||
* 1: OBJECT - Caller | ||
* | ||
* Returns: | ||
* BOOLEAN - Can stop clearing mines. | ||
* | ||
* Example: | ||
* _this call mts_engineer_fnc_canStopMineClearing | ||
* | ||
*/ | ||
|
||
params ["_vehicle", "_caller"]; | ||
|
||
(_caller isEqualTo (driver _vehicle)) && // is driver of the vehicle | ||
{_vehicle getVariable [QGVAR(mineClearingActive), false]} // mine clearing is active |
118 changes: 118 additions & 0 deletions
118
addons/engineer/functions/fnc_handleMineClearingEffects.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Spawn and move the particles during mine clearing. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Mine clearing vehicle (ABV/MiRPz) | ||
* | ||
* Returns: | ||
* Nothing. | ||
* | ||
* Example: | ||
* _this call mts_engineer_fnc_handleMineClearingEffects | ||
* | ||
*/ | ||
|
||
params [["_vehicle", objNull, [objNull]]]; | ||
|
||
private _pos = getPos _vehicle; | ||
|
||
private _dustParticle = "#particlesource" createVehicleLocal _pos; | ||
_dustParticle setParticleCircle [0, [0, 0, 0]]; | ||
_dustParticle setParticleRandom | ||
[ | ||
2, // lifeTimeVar | ||
[0.5, 3, 0], // positionVar | ||
[5, 5, 10], // moveVelocityVar | ||
1, // rotationVelocityVar | ||
0, // sizeVar | ||
[0, 0, 0, 0.01], // colorVar | ||
0, // randomDirectionPeriodVar | ||
0, // randomDirectionIntensityVar | ||
0 // angleVar | ||
]; | ||
_dustParticle setDropInterval 0.01; | ||
|
||
private _dirtParticle = "#particlesource" createVehicleLocal _pos; | ||
_dirtParticle setParticleCircle [0, [0, 0, 0]]; | ||
_dirtParticle setParticleRandom | ||
[ | ||
2, | ||
[0.5, 3, 0], | ||
[15, 15, 5], | ||
0.1, | ||
0, | ||
[0, 0, 0, 0], | ||
0, | ||
0 | ||
]; | ||
_dirtParticle setDropInterval 0.5; | ||
|
||
[{ | ||
params ["_PFHArgs", "_PFHID"]; | ||
_PFHArgs params ["_vehicle", "_dustParticle", "_dirtParticle"]; | ||
|
||
if (!(_vehicle getVariable [QGVAR(mineClearingActive), false])) exitWith { | ||
[_PFHID] call CBA_fnc_removePerFrameHandler; | ||
|
||
deleteVehicle _dustParticle; | ||
deleteVehicle _dirtParticle; | ||
}; | ||
|
||
private _vectorDir = vectorDirVisual _vehicle; | ||
|
||
_dustParticle setParticleParams | ||
[ | ||
["\A3\data_f\cl_basic", 1, 0, 1], | ||
"", | ||
"Billboard", | ||
1, | ||
4, // lifeTime | ||
[0, 4, -2.5], // pos3D | ||
[(_vectorDir select 0) * 50, (_vectorDir select 1) * 50, 22], // moveVelocity | ||
0, // rotationVelocity | ||
1.6, // weight | ||
1, // volume | ||
0.3, // rubbing | ||
[2.2, 4, 6], // size | ||
[[0.060, 0.04, 0.02, 0.6], [0.050, 0.035, 0.02, 0.4], [0.030, 0.025, 0.015, 0.2]], // color | ||
[1], // animationSpeed | ||
3, // randomDirectionPeriod | ||
3, // randomDirectionIntensity | ||
"", // onTimerScript | ||
"", // beforeDestroyScript | ||
_vehicle, | ||
0, // angle | ||
true, // onSurface | ||
0.1 // bounceOnSurface | ||
]; | ||
|
||
_dirtParticle setParticleParams | ||
[ | ||
["\A3\data_f\ParticleEffects\Universal\Mud", 1, 0, 1], | ||
"", | ||
"SpaceObject", | ||
1, | ||
10, | ||
[0, 4, -2.5], | ||
[(_vectorDir select 0) * 20, (_vectorDir select 1) * 20, 10], | ||
0, | ||
2, | ||
0.1, | ||
0.1, | ||
[0.2], | ||
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], | ||
[0.08], | ||
0, | ||
0, | ||
"", | ||
"", | ||
_vehicle, | ||
0, | ||
true, | ||
0.2 | ||
]; | ||
}, DIRT_SFX_UPDATE_INTERVAL, [_vehicle, _dustParticle, _dirtParticle]] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Adds actions for mine clearing to the vehicle. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Mine clearing vehicle (ABV/MiRPz) | ||
* | ||
* Returns: | ||
* Nothing. | ||
* | ||
* Example: | ||
* _this call mts_engineer_fnc_initMineClearingActions | ||
* | ||
*/ | ||
|
||
params [["_vehicle", objNull, [objNull]]]; | ||
|
||
_vehicle addAction [ | ||
LLSTRING(startMineClearing), | ||
{ | ||
params ["_vehicle"]; | ||
|
||
[_vehicle] call FUNC(startMineClearing); | ||
}, | ||
[], // _arguments | ||
2, // priority | ||
true, // showWindow | ||
true, // hideOnUse | ||
"", // shortcut | ||
QUOTE([ARR_2(_target,_this)] call FUNC(canStartMineClearing)) | ||
]; | ||
|
||
_vehicle addAction [ | ||
LLSTRING(stopMineClearing), | ||
{ | ||
params ["_vehicle"]; | ||
|
||
[_vehicle] call FUNC(stopMineClearing); | ||
}, | ||
[], // _arguments | ||
2, // priority | ||
true, // showWindow | ||
true, // hideOnUse | ||
"", // shortcut | ||
QUOTE([ARR_2(_target,_this)] call FUNC(canStopMineClearing)) | ||
]; | ||
|
||
// If driver leaves vehicle during mine clearing, speed limiter and allowDamage need to be set again | ||
_vehicle addEventHandler ["Local", { | ||
params ["_vehicle", "_isLocal"]; | ||
|
||
TRACE_1("Locality changed during mine clearing",_this); | ||
|
||
if (_vehicle getVariable [QGVAR(mineClearingActive), false]) then { | ||
// Set speed limiter and damage again | ||
_vehicle setCruiseControl [MAX_MINE_CLEARING_SPEED, false]; | ||
_vehicle allowDamage false; | ||
} else { | ||
// Set speed limiter and damage again | ||
_vehicle setCruiseControl [0, false]; | ||
if (_vehicle getVariable [QGVAR(originalIsDamageAllowed), true]) then { | ||
_vehicle allowDamage true; | ||
}; | ||
}; | ||
}]; |
Oops, something went wrong.