Remove AGM from TO_MERGE folder

This commit is contained in:
KoffeinFlummi 2015-04-09 21:25:55 +02:00
parent 2d265ec6c2
commit 5e918eb707
298 changed files with 0 additions and 12152 deletions

View File

@ -1,258 +0,0 @@
class CfgPatches {
class AGM_Armour {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"KoffeinFlummi", "Adanteh"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
class CfgFunctions {
class AGM_Armour {
class AGM_Armour {
file = "AGM_Armour\functions";
class cookOff;
class getHitPointBySelection;
class handleDamage;
class init;
};
};
};
class Extended_Init_EventHandlers {
class AllVehicles {
class AGM_Armour {
init = "_this call AGM_Armour_fnc_init";
};
};
};
class CfgSFX {
class AGM_CookOff {
name = "Cook-Off";
sounds[] = {"cookoff"};
cookoff[] = {"\AGM_Armour\sounds\cookoff.wav",6,1.8,400,1,0,0,0};
empty[] = {"",0,0,0,0,0,0,0};
};
};
class CfgVehicles {
/*
* AGM_Armour_AmmoLocation:
* HitPoint classname that holds the magazine of the vehicle
* AGM_Armour_CookOffLocations:
* Positions to spawn cookoff particle effects at
* AGM_Armour_CookOffOnTurret:
* Positions placed on turret?
*
* These 2 will be introduced in v0.96:
* AGM_Armour_TurretObject:
* Object to spawn to simulate turret flying off; "" to not spawn enything
* AGM_Armour_TurretPosition:
* Position to spawn turret at
*
* All positions are Y-up, just like in Oxygen/Object Builder.
*/
class Sound;
class AGM_Sound_CookOff: Sound {
sound = "AGM_CookOff";
scope = 2;
};
class Land;
class LandVehicle: Land {
AGM_Armour_AmmoLocation = "HitTurret";
AGM_Armour_CookOffLocations[] = {{0,-0.2,0}};
AGM_Armour_CookOffOnTurret[] = {0};
explosionEffect = "";
};
class Tank: LandVehicle {
// 2 hatches on the turret; fits most tanks
AGM_Armour_CookOffLocations[] = {{-0.6,-0.3,1.65}, {0.5,-0.3,1.65}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
// Small explosions for cars with explosive ammunition
class MRAP_01_gmg_base_F;
class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F {
explosionEffect = "FuelExplosion";
};
class MRAP_02_gmg_base_F;
class O_MRAP_01_gmg_F: MRAP_02_gmg_base_F {
explosionEffect = "FuelExplosion";
};
class MRAP_03_gmg_base_F;
class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F {
explosionEffect = "FuelExplosion";
};
// Big explosions for tracked vehicles and wheeled APCs
class Tank_F: Tank {
explosionEffect = "FuelExplosionBig";
};
class Car_F;
class Wheeled_APC_F: Car_F {
explosionEffect = "FuelExplosionBig";
};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
explosionEffect = "FuelExplosionBig";
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {
explosionEffect = "FuelExplosionBig";
};
class APC_Wheeled_02_base_F: Wheeled_APC_F {
explosionEffect = "FuelExplosionBig";
};
class B_MBT_01_base_F;
class B_MBT_01_cannon_F: B_MBT_01_base_F {
AGM_Armour_AmmoLocation = "HitHull";
//AGM_Armour_TurretObject = "AGM_Turret_MBT_01";
//AGM_Armour_TurretPosition[] = {3,3,0};
AGM_Armour_CookOffLocations[] = {{-0.3,-0.3,1.8}};
AGM_Armour_CookOffOnTurret[] = {1};
};
class B_MBT_01_arty_base_F;
class B_MBT_01_arty_F: B_MBT_01_arty_base_F {
AGM_Armour_CookOffLocations[] = {{0.7,-0.3,3.5}};
AGM_Armour_CookOffOnTurret[] = {1};
};
class B_MBT_01_mlrs_base_F;
class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F {
AGM_Armour_CookOffLocations[] = {{0,-0.3,1.65}};
AGM_Armour_CookOffOnTurret[] = {0};
};
class B_APC_Tracked_01_base_F;
class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
AGM_Armour_AmmoLocation = "HitHull";
AGM_Armour_CookOffLocations[] = {{0.5,-0.3,1.3}};
AGM_Armour_CookOffOnTurret[] = {0};
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
AGM_Armour_CookOffLocations[] = {{-0.4,-0.3,1.9}, {0.3,-0.3,1.9}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
class B_APC_Wheeled_01_base_F;
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
AGM_Armour_CookOffLocations[] = {{-0.3,0,1.85}, {0.3,0,1.85}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
class I_APC_tracked_03_base_F;
class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F {
AGM_Armour_CookOffLocations[] = {{-0.4,-0.3,1.5}, {0.7,-0.3,1.5}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
class I_APC_Wheeled_03_base_F;
class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F {
AGM_Armour_CookOffLocations[] = {{0,-0.6,0}};
AGM_Armour_CookOffOnTurret[] = {0};
};
class O_MBT_02_base_F;
class O_MBT_02_cannon_F: O_MBT_02_base_F {
AGM_Armour_CookOffLocations[] = {{-0.6,-0.3,1.65}, {0.5,-0.3,1.65}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
class O_MBT_02_arty_base_F;
class O_MBT_02_arty_F: O_MBT_02_arty_base_F {
AGM_Armour_CookOffLocations[] = {{0.7,-0.3,3.5}};
AGM_Armour_CookOffOnTurret[] = {1};
};
class O_APC_Tracked_02_base_F;
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
AGM_Armour_CookOffLocations[] = {{-0.4,0.2,3.6}, {0.3,0.2,3.6}};
AGM_Armour_CookOffOnTurret[] = {1, 1 };
};
class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F {
AGM_Armour_CookOffLocations[] = {{0,-0.5,1.65}};
AGM_Armour_CookOffOnTurret[] = {1};
};
class O_APC_Wheeled_02_base_F;
class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F {
AGM_Armour_AmmoLocation = "HitHull";
AGM_Armour_CookOffLocations[] = {{0,-0.4,1}};
AGM_Armour_CookOffOnTurret[] = {0};
};
/*
class O_MBT_02_base_F;
class O_MBT_02_cannon_F: O_MBT_02_base_F {
AGM_Armour_TurretObject = "AGM_Turret_MBT_02";
AGM_Armour_TurretPosition[] = {0.9,3,1.5};
};*/
// Turret Objects
/*
class thingX;
class AGM_Turret_MBT_01: thingX {
scope = 1;
model = "\A3\Structures_F\Wrecks\Wreck_Slammer_turret_F.p3d";
};
class AGM_Turret_MBT_02: thingX {
scope = 1;
model = "\A3\Structures_F\Wrecks\Wreck_T72_turret_F.p3d";
};
*/
};
class CfgCloudlets {
class AGM_CookOff {
angle = 0;
angleVar = 0;
animationName = "";
animationSpeed[] = {1};
animationSpeedCoef = 1;
beforeDestroyScript = "";
bounceOnSurface = 0.6;
bounceOnSurfaceVar = 0;
circleRadius = 0;
circleVelocity[] = {2,2,2};
color[] = {{1,1,1,-4},{1,1,1,-3},{1,1,1,-2},{1,1,1,-1},{1,1,1,0}};
colorCoef[] = {1,1,1,1};
colorVar[] = {0,0,0,2};
destroyOnWaterSurface = 0;
destroyOnWaterSurfaceOffset = 0;
interval = 0.004;
keepOnSurface = 0;
lifeTime = 1;
lifeTimeVar = 0;
moveVelocity[] = {0,4,0};
moveVelocityVar[] = {1,2,1};
moveVelocityVarConst[] = {0,0,0};
onSurface = 1;
onTimerScript = "";
particleEffects = "";
particleFSFrameCount = 32;
particleFSIndex = 0;
particleFSLoop = 0;
particleFSNtieth = 16;
particleShape = "\A3\data_f\ParticleEffects\Universal\Universal";
particleType = "Billboard";
position[] = {0,0,0};
positionVar[] = {0,0,0};
positionVarConst[] = {0,0,0};
postEffects = "";
randomDirectionIntensity = 1;
randomDirectionIntensityVar = 2;
randomDirectionPeriod = 5;
randomDirectionPeriodVar = 1;
rotationVelocity = 1;
rotationVelocityVar = 3;
rubbing = 0;
size[] = {0.01,0.5,1,1,1.5,0.01,0.001};
sizeCoef = 1;
sizeVar = 0.1;
surfaceOffset = 0;
timerPeriod = 1;
volume = 0.45;
weight = 0.4;
};
};

View File

@ -1,147 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Start a cook-off in the given vehicle.
*
* Arguments:
* 0: Vehicle
*
* Return Value:
* Boom.
*/
if !(local (_this select 0)) then {
[_this, "AGM_Armour_fnc_cookOff", (_this select 0)] call AGM_Core_fnc_execRemoteFnc;
};
if ((_this select 0) getVariable ["AGM_Armour_isCookingOff", False]) exitWith {};
(_this select 0) setVariable ["AGM_Armour_isCookingOff", True];
_this spawn {
private ["_vehicle", "_positions", "_onTurret"];
_vehicle = _this select 0;
_positions = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Armour_CookOffLocations");
_onTurret = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Armour_CookOffOnTurret");
sleep 0.5 + (random 0.3);
// guesstimate turret center; intersect weapon direction with front axis.
// if you find a better method, yell at me.
_gunBeg = _vehicle selectionPosition (getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "gunBeg"));
_gunEnd = _vehicle selectionPosition (getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "gunEnd"));
_weaponDir = _gunEnd vectorFromTo _gunBeg; // this may seem counterintuitive, but it's BIS we're talking about.
_turretAxis = [-1,-1];
if (abs (_weaponDir select 0) > 0.05 and !(isArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "memoryPointGun"))) then {
_y = (_gunBeg select 1) - ((_gunBeg select 0) / (_weaponDir select 0)) * (_weaponDir select 1);
if (_y < 5) then {
_turretAxis set [0, 0];
_turretAxis set [1, _y];
};
};
["Armour", nil, {
AGM_TurretAxis = _turretAxis;
addMissionEventHandler ["Draw3D", {
drawLine3D [(vehicle player) modelToWorld (AGM_TurretAxis + [-5]), (vehicle player) modelToWorld (AGM_TurretAxis + [10]), [1,0,0,1]];
}];
}] call AGM_Debug_fnc_log;
// Smoke out of cannon and hatches
_smokeBarrel = "#particlesource" createVehicle [0,0,0];
_smokeBarrel setParticleClass "MediumDestructionSmoke";
_smokeBarrel attachTo [_vehicle, _vehicle selectionPosition (getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "gunBeg"))];
_smokes = [];
{
_position = [
- (_x select 0),
- (_x select 2),
(_x select 1)
];
/* if (_onTurret select _forEachIndex == 1 and _turretAxis select 0 != -1) then {
_weaponDirDeg = ((_weaponDir select 0) atan2 (_weaponDir select 1)) * -1;
_posX = (_position select 0) - (_turretAxis select 0);
_posY = (_position select 1) - (_turretAxis select 1);
_posNewX = _posX * cos _weaponDirDeg - _posY * sin _weaponDirDeg;
_posNewY = _posX * sin _weaponDirDeg - _posY * cos _weaponDirDeg;
_position set [0, _posNewX + (_turretAxis select 0)];
_position set [1, _posNewY + (_turretAxis select 1)];
};*/
_smoke = "#particlesource" createVehicle [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [_vehicle, _position];
_smokes pushBack _smoke;
} forEach _positions;
sleep 3 + (random 2);
// this shit is busy being on fire, can't go driving around all over the place
_vehicle setFuel 0;
_light = "#lightpoint" createVehicle [0,0,0];
_light lightAttachObject [_vehicle, [0,0,4]];
[_light, "{_this setLightBrightness 0.7; _this setLightAmbient [1,0.4,0.15]; _this setLightColor [1,0.4,0.15];}"] call AGM_Core_fnc_execRemoteFnc;
// CookOffs
_fires = [];
{
_position = [
- (_x select 0),
- (_x select 2),
(_x select 1)
];
if (_onTurret select _forEachIndex == 1 and _turretAxis select 0 != -1) then {
_weaponDirDeg = ((_weaponDir select 0) atan2 (_weaponDir select 1)) * -1;
_posX = (_position select 0) - (_turretAxis select 0);
_posY = (_position select 1) - (_turretAxis select 1);
_posNewX = _posX * cos _weaponDirDeg - _posY * sin _weaponDirDeg;
_posNewY = _posX * sin _weaponDirDeg - _posY * cos _weaponDirDeg;
_position set [0, _posNewX + (_turretAxis select 0)];
_position set [1, _posNewY + (_turretAxis select 1)];
};
_fire = "#particlesource" createVehicle [0,0,0];
_fire setParticleClass "AGM_CookOff";
_fire attachTo [_vehicle, _position];
_fires pushBack _fire;
} forEach _positions;
_sound = createSoundSource ["AGM_Sound_CookOff", getPos _vehicle, [], 0];
// indicator for the crew - yo, your shit's on fire
{
if ([_x] call AGM_Core_fnc_isPlayer) then {
[[_vehicle], "{(_this select 0) spawn {for '_i' from 0 to 11 do {if (vehicle AGM_player != _this) exitWith {}; [] call BIS_fnc_flamesEffect; sleep 0.4;};};}", _x] call AGM_Core_fnc_execRemoteFnc;
};
} forEach (crew _vehicle);
sleep (4 + random 1);
deleteVehicle _smokeBarrel;
[_smokes, {deleteVehicle _this}] call AGM_Core_fnc_map;
[_fires, {deleteVehicle _this}] call AGM_Core_fnc_map;
deleteVehicle _light;
_sound setPosASL [-10000, -10000, 1000]; //deleteVehicle _sound;
(_this select 0) setVariable ["AGM_Armour_isCookingOff", False];
if (local _vehicle and damage _vehicle < 1) then {
_vehicle setDamage 1;
/* @todo: this is for v0.96
_turretClass = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Armour_TurretObject");
if (_turretClass != "") then {
_turretPos = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Armour_TurretPosition");
_position = [
- (_turretPos select 0),
- (_turretPos select 2),
(_turretPos select 1)
];
_turret = _turretClass createVehicle (_vehicle modelToWorld _position);
// @todo
//_turret setVectorUp [random 1, random 1, 1];
//_turret setVelocity [random 7, random 7, 8 + random 5];
};*/
};
};

View File

@ -1,31 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Finds out the hitpoint classname of the given selection.
* (works only for main and MainTurret hitpoints)
*
* Arguments:
* 0: Vehicle
* 1: Selection name
*
* Return Value:
* None
*/
private ["_vehicle", "_selectionName"];
_vehicle = _this select 0;
_selectionName = _this select 1;
_vehicleConfig = configFile >> "CfgVehicles" >> typeOf _vehicle;
_hitPoints = ("True" configClasses (_vehicleConfig >> "HitPoints")) +
("True" configClasses (_vehicleConfig >> "Turrets" >> "MainTurret" >> "HitPoints"));
_hitPoint = "";
for "_i" from 0 to (count _hitPoints - 1) do {
if (getText ((_hitPoints select _i) >> "name") == _selectionName) exitWith {
_hitPoint = configName (_hitPoints select _i);
};
};
_hitPoint

View File

@ -1,119 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Handles all incoming damage for vehicles.
*
* Arguments:
* HandleDamage EH
*
* Return Value:
* Damage to be inflicted.
*/
_vehicle = _this select 0;
_selectionName = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;
if (typeName _projectile == "OBJECT") then {
_projectile = typeOf _projectile;
};
// It's already dead, who cares?
if (damage _vehicle >= 1) exitWith {};
// Find out what hitpoint the selection belongs to.
_hitpoint = [_vehicle, _selectionName] call AGM_Armour_fnc_getHitPointBySelection;
// Determine type of vehicle and whether the selection is critical.
_type = "";
_critical = True;
if (_vehicle isKindOf "Car_F") then {
if (_vehicle isKindOf "Wheeled_APC_F") then {
_type = "tank";
} else {
_type = "car";
};
_critical = _hitpoint in ["HitHull", "HitFuel", ""];
};
if (_vehicle isKindOf "Tank_F") then {
_type = "tank";
_critical = _hitpoint in ["HitHull", ""];
};
if (_vehicle isKindOf "Helicopter") then {
_type = "heli";
_critical = _hitpoint in ["HitHull", ""];
};
if (_vehicle isKindOf "Plane") then {
_type = "plane";
_critical = _hitpoint in ["HitHull", ""];
};
if (_vehicle isKindOf "Ship_F") then {
_type = "ship";
_critical = _hitpoint in ["HitHull", ""];
};
if (_vehicle isKindOf "StaticWeapon") then {
_type = "static";
_critical = _hitpoint in ["HitHull", ""];
};
// Are we doing anything with this type of vehicle?
if !(_type in ["tank", "car"]) exitWith {};
// Change in damage
_newDamage = _damage - (_vehicle getHit _selectionName);
// Prevent total destruction of car unless round used is explosive
if (_type == "car") exitWith {
if (!_critical or (getNumber (configFile >> "CfgAmmo" >> _projectile >> "explosive") > 0.5)) then {
if (!(_vehicle getVariable ["AGM_Armour_isEngineSmoking", False]) and _hitpoint == "HitEngine" and _damage > 0.9) then {
_vehicle setVariable ["AGM_Armour_isEngineSmoking", True, True];
_pos = [
0,
(((boundingBoxReal _vehicle) select 1) select 1) - 4,
(((boundingBoxReal _vehicle) select 0) select 2) + 2
];
_smoke = "#particlesource" createVehicle [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [_vehicle, _pos];
[_vehicle, _smoke] spawn {
_vehicle = _this select 0;
_smoke = _this select 1;
_time = time;
waitUntil {sleep 5; isNull _vehicle or !(alive _vehicle) or ((_vehicle getHitPointDamage "HitEngine") < 0.9) or (_time + 240 < time)};
deleteVehicle _smoke;
};
};
_damage
} else {
_damage min 0.89
};
};
// Prevent total destruction of tank unless ammo storage is hit
if (_type == "tank") exitWith {
// Determine ammo storage location
_target = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Armour_AmmoLocation");
// Ammo was hit, high chance for cook-off
if (_hitpoint == _target and _damage > 0.5 and random 1 > 0.3) then {
[_vehicle] call AGM_Armour_fnc_cookOff;
};
// Ammo wasn't hit, slim chance for cook-off (only for high-damage weapons)
if (_hitpoint != target and _hitpoint in ["HitBody", "HitTurret", ""] and _newDamage > (0.6 + random 0.3)) then {
[_vehicle] call AGM_Armour_fnc_cookOff;
};
// Prevent destruction, let cook-off handle it if necessary
if (_critical) then {
_damage min 0.89
} else {
_damage
};
};
// this shouldn't happen, but who knows
_damage

View File

@ -1,16 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Because CBA's EHs sucks.
*
* Arguments:
* Init EH
*
* Return Value:
* None
*/
_vehicle = _this select 0;
if (_vehicle isKindOf "CAManBase") exitWith {};
_vehicle addEventHandler ["HandleDamage", {_this call AGM_Armour_fnc_handleDamage}];

View File

@ -1,161 +0,0 @@
class CfgPatches {
class AGM_FastRoping {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"KoffeinFlummi"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
class CfgFunctions {
class AGM_FastRoping {
class AGM_FastRoping {
file = "\AGM_FastRoping\functions";
class createRope;
class cutRopes;
class deployRopes;
class fastRope;
};
};
};
class CfgVehicles {
//class AGM_FastRoping_Helper: B_UAV_01_F {
class UAV_01_base_F;
class AGM_FastRoping_Helper: UAV_01_base_F {
scope = 1;
model = "agm_fastroping\agm_fastroping_helper.p3d";
isUav = 0;
};
class Air;
class Helicopter: Air {
AGM_FastRoping = 0;
AGM_FastRoping_Positions[] = {};
class AGM_SelfActions {
class AGM_DeployRopes {
displayName = "$STR_AGM_FastRoping_DeployRopes";
enableInside = 1;
condition = "(locked _vehicle <= 1) and !(_vehicle getVariable ['AGM_RopesDeployed', False]) and (getPos _vehicle select 2) > 5 and (getNumber (configFile >> 'CfgVehicles' >> typeOf _vehicle >> 'AGM_FastRoping')) == 1";
statement = "[_vehicle] call AGM_FastRoping_fnc_deployRopes";
showDisabled = 0;
priority = 1;
icon = "";
};
class AGM_FastRope {
displayName = "$STR_AGM_FastRoping_FastRope";
enableInside = 1;
condition = "(locked _vehicle <= 1) and (_vehicle getVariable ['AGM_RopesDeployed', False]) and (vectorMagnitude (velocity _vehicle) < 4) and (count ([_vehicle getVariable ['AGM_RopesOccupied', []], {!_this}] call AGM_Core_fnc_filter) > 0)";
statement = "[_player, _vehicle] call AGM_FastRoping_fnc_fastRope";
showDisabled = 0;
priority = 1;
icon = "";
};
class AGM_CutRopes {
displayName = "$STR_AGM_FastRoping_CutRopes";
enableInside = 1;
condition = "(_vehicle getVariable ['AGM_RopesDeployed', False]) and (count ([_vehicle getVariable ['AGM_RopesOccupied', []], {_this}] call AGM_Core_fnc_filter) == 0)";
statement = "[_vehicle] call AGM_FastRoping_fnc_cutRopes";
showDisabled = 0;
priority = 1;
icon = "";
};
};
};
class Plane: Air {
AGM_FastRoping = 0;
AGM_FastRoping_Positions[] = {};
class AGM_SelfActions {
class AGM_DeployRopes {
displayName = "$STR_AGM_FastRoping_DeployRopes";
enableInside = 1;
condition = "(locked _vehicle <= 1) and !(_vehicle getVariable ['AGM_RopesDeployed', False]) and (getPos _vehicle select 2) > 5 and (getNumber (configFile >> 'CfgVehicles' >> typeOf _vehicle >> 'AGM_FastRoping')) == 1";
statement = "[_vehicle] call AGM_FastRoping_fnc_deployRopes";
showDisabled = 0;
priority = 1;
icon = "";
};
class AGM_FastRope {
displayName = "$STR_AGM_FastRoping_FastRope";
enableInside = 1;
condition = "(locked _vehicle <= 1) and (_vehicle getVariable ['AGM_RopesDeployed', False]) and (vectorMagnitude (velocity _vehicle) < 4) and (count ([_vehicle getVariable ['AGM_RopesOccupied', []], {!_this}] call AGM_Core_fnc_filter) > 0)";
statement = "[_player, _vehicle] call AGM_FastRoping_fnc_fastRope";
showDisabled = 0;
priority = 1;
icon = "";
};
class AGM_CutRopes {
displayName = "$STR_AGM_FastRoping_CutRopes";
enableInside = 1;
condition = "(_vehicle getVariable ['AGM_RopesDeployed', False]) and (count ([_vehicle getVariable ['AGM_RopesOccupied', []], {_this}] call AGM_Core_fnc_filter) == 0)";
statement = "[_vehicle] call AGM_FastRoping_fnc_cutRopes";
showDisabled = 0;
priority = 1;
icon = "";
};
};
};
class Helicopter_Base_F;
class Helicopter_Base_H: Helicopter_Base_F {};
// Ghosthawk
class Heli_Transport_01_base_F: Helicopter_Base_H {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{1.2, 2.5, 0.25}, {-1.1, 2.5, 0.25}};
};
// Chinook
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{0, 1, -1.9}, {0, -5, 0.5}};
};
// Wildcat
class I_Heli_light_03_base_F: Helicopter_Base_F {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{1.2, 2.5, 0.25}, {-1.1, 2.5, 0.25}};
};
// Merlin
class Heli_Transport_02_base_F: Helicopter_Base_H {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{1.4, 2.5, 0.25}, {-1.2, 2.5, 0.25}};
};
// Kasatka
class Heli_Light_02_base_F: Helicopter_Base_H {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{1.4, 1.4, 0.05}, {-1.4, 1.4, 0.05}};
};
// Kajman
class Heli_Attack_02_base_F: Helicopter_Base_F {
AGM_FastRoping = 1;
AGM_FastRoping_Positions[] = {{1.4, 1.4, 0}, {-1.2, 1.4, 0}};
};
};
class CfgMovesBasic {
class DefaultDie;
class ManActions {
AGM_FastRoping = "AGM_FastRoping";
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class States {
class Crew;
class AGM_FastRoping: Crew {
file = "agm_fastroping\data\agm_fastroping.rtm";
interpolateTo[] = {"Unconscious",1};
disableWeapons = 1;
disableWeaponsLong = 1;
canReload = 0;
};
};
};

View File

@ -1,76 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Creates a rope for the vehicle at the given position.
*
* Arguments:
* 0: Vehicle
* 1: Position
* 2: Spawn bottom part of rope in place? (Default: False)
*
* Return Value:
* Array:
* 0: rope 1
* 1: rope 2
* 2-3: helper objects
*
* __/|
* | <- rope 1
* |
* X <- helper 1; attached to player
* |
* | <- rope 2
* |
* X <- helper 2
*/
#define HELPER "AGM_FastRoping_Helper"
#define ROPELENGTH 35
#define OFFSET 2
private ["_vehicle", "_pos", "_inPlace", "_helper1", "_helper1", "_helper2", "_rope1", "_rope2"];
_vehicle = _this select 0;
_pos = _this select 1;
_inPlace = False;
if (count _this > 2) then {
_inPlace = _this select 2;
};
if (typeName _pos == "STRING") then {
_pos = _vehicle selectionPosition _pos;
};
_posWorld = _vehicle modelToWorld _pos;
// modelToWorld seems to ignore buildings; let's fix that.
_posWorld = _posWorld vectorDiff ((getPosATL _vehicle) vectorDiff (getPos _vehicle));
_posWorld set [2, (_posWorld select 2) - OFFSET];
_posWorld2 =+ _posWorld;
if (_inPlace) then {
_posWorld2 set [2, ((_posWorld select 2) - (ROPELENGTH - OFFSET)) max 0];
};
_helper1 = HELPER createVehicle _posWorld;
_helper1 allowDamage False;
_helper2 = HELPER createVehicle _posWorld2;
_helper2 allowDamage False;
//_rope1 = ropeCreate [_helper1, [0,0,0], _helper1, [0,0,0], OFFSET];
_rope1 = ropeCreate [_vehicle, _pos, _helper1, [0,0,0], OFFSET + 1];
_rope2 = ropeCreate [_helper1, [0,0,0], _helper2, [0,0,0], ROPELENGTH - (OFFSET + 1)];
if (_inPlace) then {
_roof = ((getPosATL _vehicle) vectorDiff (getPos _vehicle)) select 2;
_helper2 setPosATL [
(getPosATL _helper1) select 0,
(getPosATL _helper1) select 1,
(((getPosATL _helper1) select 2) - ROPELENGTH) max (_roof + 1)
];
} else {
_helper2 setPosATL (getPosATL _helper1);
};
[_rope1, _rope2, _helper1, _helper2]

View File

@ -1,27 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Cuts the ropes from the helicopter
*
* Arguments:
* 0: helicopter
*
* Return Value:
* None
*/
_vehicle = _this select 0;
_ropes = _vehicle getVariable "AGM_Ropes";
{
(_x select 2) ropeDetach (_x select 0);
ropeDestroy (_x select 0);
_x spawn {
sleep 60;
ropeDestroy (_this select 1);
deleteVehicle (_this select 2);
deleteVehicle (_this select 3);
};
} forEach _ropes;
_vehicle setVariable ["AGM_RopesDeployed", False, True];

View File

@ -1,36 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Deploys the ropes necessary for fast roping.
*
* Arguments:
* 0: The helicopter
*
* Return Value:
* None
*/
#define HELPER "AGM_FastRoping_Helper"
#define ROPELENGTH 35
#define OFFSET 2
_vehicle = _this select 0;
if !(local _vehicle) exitWith {
[[_vehicle], "AGM_FastRoping_fnc_deployRopes", _vehicle] call AGM_Core_fnc_execRemoteFnc;
};
_ropePositions = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FastRoping_Positions");
_ropes = [_ropePositions, {[objNull, objNull, objNull]}] call AGM_Core_fnc_map;
_occupied = [_ropePositions, {False}] call AGM_Core_fnc_map;
for "_i" from 0 to ((count _ropes) - 1) do {
_ropePositions = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FastRoping_Positions");
_pos = _ropePositions select _i;
_ropes set [_i, [_vehicle, _pos] call AGM_FastRoping_fnc_createRope];
};
_vehicle setVariable ["AGM_RopesDeployed", True, True];
_vehicle setVariable ["AGM_Ropes", _ropes, True];
_vehicle setVariable ["AGM_RopesOccupied", _occupied, True];

View File

@ -1,95 +0,0 @@
/*
* Author: KoffeinFlummi
*
* Starts fast roping for a certain unit
*
* Arguments:
* 0: Unit
* 1: Helicopter
*
* Return Value:
* None
*/
#define ROPELENGTH 35
_unit = _this select 0;
_vehicle = _this select 1;
_ropes = _vehicle getVariable "AGM_Ropes";
_occupied = _vehicle getVariable "AGM_RopesOccupied";
_index = -1;
for "_i" from 0 to ((count _occupied) - 1) do {
if !(_occupied select _i) exitWith {
_index = _i;
};
};
_occupied set [_index, True];
_vehicle setVariable ["AGM_RopesOccupied", _occupied, True];
_rope = _ropes select _index;
_rope1 = _rope select 0;
_rope2 = _rope select 1;
_helper = _rope select 2;
_unit disableCollisionWith _helper;
[time, _unit, _vehicle, _index, _rope, _index] spawn {
_time = _this select 0;
_unit = _this select 1;
_vehicle = _this select 2;
_index = _this select 3;
_rope = _this select 4;
_index = _this select 5;
_rope1 = _rope select 0;
_rope2 = _rope select 1;
_helper = _rope select 2;
_unit allowDamage False;
moveOut _unit;
waitUntil {vehicle _unit == _unit};
_helper setVectorUp [0,0,1];
_unit attachTo [_helper, [0,0,0]];
_vector = (getPos _unit) vectorFromTo (getPos _vehicle);
_unit setVectorDir _vector;
[[_rope1, _rope2], "{ropeUnwind [_this select 0, 6, 35];ropeUnwind [_this select 1, 6, 0];}", _helper] call AGM_Core_fnc_execRemoteFnc;
sleep 0.1;
_unit allowDamage True;
[_unit, "AGM_FastRoping", 2] call AGM_Core_fnc_doAnimation;
waitUntil {
([_unit] + ([[_helper] call AGM_Core_fnc_getPitchBankYaw, {_this * -1}] call AGM_Core_fnc_map)) call AGM_Core_fnc_setPitchBankYaw;
_time + 1 < time and ((getPos _helper select 2) < 1 or (time >= (_time + ROPELENGTH / 6)) or (vectorMagnitude (velocity _vehicle) > 5))
};
_unit allowDamage False;
_unit spawn {
sleep 0.5;
_this allowDamage True;
};
detach _unit;
[_unit, "", 2] call AGM_Core_fnc_doAnimation;
_unit setVectorUp [0,0,1];
// delete and recreate rope
{deleteVehicle _x;} forEach _rope;
_ropePositions = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FastRoping_Positions");
_pos = _ropePositions select _index;
[
[_vehicle, _pos, _index],
"{_ropes = (_this select 0) getVariable 'AGM_Ropes';_ropes set [(_this select 2), [(_this select 0), (_this select 1), True] call AGM_FastRoping_fnc_createRope];(_this select 0) setVariable ['AGM_Ropes', _ropes, True];}",
_vehicle
] call AGM_Core_fnc_execRemoteFnc;
// free rope for next unit
_occupied = _vehicle getVariable "AGM_RopesOccupied";
_occupied set [_index, False];
_vehicle setVariable ["AGM_RopesOccupied", _occupied, True];
};

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-21 -->
<Project name="AGM">
<Package name="FastRoping">
<Key ID="STR_AGM_FastRoping_DeployRopes">
<English>Deploy Ropes</English>
<German>Seile vorbereiten</German>
<Polish>Rozwiń liny</Polish>
<Spanish>Desplegar cuerdas</Spanish>
<Russian>Развернуть веревку</Russian>
<Czech>Připravit lana</Czech>
</Key>
<Key ID="STR_AGM_FastRoping_FastRope">
<English>Fast Rope</English>
<German>Abseilen</German>
<Polish>Zjedź na linie</Polish>
<Spanish>Descender por cuerda</Spanish>
<Russian>Спуститься по веревке</Russian>
<Czech>Slanování</Czech>
</Key>
<Key ID="STR_AGM_FastRoping_CutRopes">
<English>Cut Ropes</English>
<German>Seile trennen</German>
<Polish>Odetnij liny</Polish>
<Spanish>Cortar cuerdas</Spanish>
<Russian>Перерезать веревку</Russian>
<Czech>Odstranit lana</Czech>
</Key>
</Package>
</Project>

View File

@ -1,24 +0,0 @@
class CfgPatches {
class AGM_Headless {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_Headless {
class AGM_Headless {
file = "\AGM_Headless\functions";
class getData;
class logLongString;
class spawnGroups;
};
};
};

View File

@ -1,84 +0,0 @@
// by commy2
private ["_sides", "_allGroups", "_data", "_count"];
_sides = _this;
// get groups
_allGroups = [];
{
if (side _x in _sides) then {
_allGroups pushBack _x;
};
} forEach allGroups;
// get data
_data = [];
_count = count _allGroups; diag_log text "[";
{
private ["_units", "_vehicles", "_positions", "_directions", "_vehiclePositions", "_vehicleDirections", "_vehicleIDs", "_index", "_waypoints"];
_side = ([civilian, west, east, resistance] find side _x) max 0;
_units = [];
_vehicles = [];
_positions = [];
_directions = [];
_vehiclePositions = [];
_vehicleDirections = [];
_vehicleIDs = [];
{
_units pushBack typeOf _x;
if (_x != vehicle _x) then {
_index = _vehicles find vehicle _x;
if (_index == -1) then {
_index = _vehicles pushBack vehicle _x;
_vehiclePositions pushBack position vehicle _x;
_vehicleDirections pushBack direction vehicle _x;
};
_vehicleIDs pushBack _index;
} else {
_vehicleIDs pushBack -1;
};
_positions pushBack position _x;
_directions pushBack direction _x;
} forEach units _x;
_vehicles = [_vehicles, {typeOf _this}] call AGM_Core_fnc_map;
_waypoints = [];
{
private "_waypointData";
_waypointData = [
waypointName _x,
waypointType _x,
waypointDescription _x,
waypointPosition _x,
waypointCompletionRadius _x,
waypointSpeed _x,
waypointHousePosition _x,
waypointLoiterRadius _x,
waypointLoiterType _x,
waypointCombatMode _x,
/*waypointAttachedObject _x,
waypointAttachedVehicle _x,*/
waypointShow _x,
waypointVisible _x,
waypointBehaviour _x,
waypointFormation _x,
waypointScript _x,
waypointStatements _x,
waypointTimeout _x
];
_waypoints set [_forEachIndex, _waypointData];
} forEach waypoints _x;
_data pushBack [_side, _units, _positions, _directions, _vehicles, _vehicleIDs, _vehiclePositions, _vehicleDirections, _waypoints];
[str [_side, _units, _positions, _vehicles, _vehicleIDs, _vehiclePositions, _waypoints] + ([",", ""] select (count _data == _count))] call AGM_Headless_fnc_logLongString;
} forEach _allGroups; diag_log text "] call AGM_Headless_fnc_spawnGroups;";
_data

View File

@ -1,15 +0,0 @@
// by commy2
private ["_array", "_string"];
_array = toArray (_this select 0);
while {count _array > 1024} do {
_string = + _array;
_string resize 1024;
diag_log text toString _string;
_array deleteRange [0, 1023];
};
diag_log text toString _array;

View File

@ -1,65 +0,0 @@
// by commy2
{
private ["_side", "_units", "_positions", "_directions", "_vehicles", "_vehicleIDs", "_vehiclePositions", "_vehicleDirections", "_waypoints", "_vehicle", "_group1", "_unit", "_index", "_waypoint", "_waypointData"];
_side = [civilian, west, east, resistance] select (_x select 0);
_units = _x select 1;
_positions = _x select 2;
_directions = _x select 3;
_vehicles = _x select 4;
_vehicleIDs = _x select 5;
_vehiclePositions = _x select 6;
_vehicleDirections = _x select 7;
_waypoints = _x select 8;
{
_vehicle = createVehicle [_x, _vehiclePositions select _forEachIndex, [], 0, "FORM"];
_vehicle setDir (_vehicleDirections select _forEachIndex);
_vehicles set [_forEachIndex, _vehicle];
} forEach _vehicles;
_group1 = createGroup _side;
{
_unit = _group1 createUnit [_x, _positions select _forEachIndex, [], 0, "FORM"];
_index = _vehicleIDs select _forEachIndex;
if (_index == -1) then {
_unit setDir (_directions select _forEachIndex);
} else {
_unit moveInAny (_vehicles select _index);
};
} forEach _units;
{
deleteWaypoint _x;
} forEach waypoints _group1;
for "_index" from 0 to (count _waypoints - 1) do {
_waypointData = _waypoints select _index;
_waypoint = _group1 addWaypoint [_waypointData select 3, _waypointData select 4];
_waypoint setWaypointName (_waypointData select 0);
_waypoint setWaypointType (_waypointData select 1);
_waypoint setWaypointDescription (_waypointData select 2);
_waypoint setWaypointPosition (_waypointData select 3);
_waypoint setWaypointCompletionRadius (_waypointData select 4);
_waypoint setWaypointSpeed (_waypointData select 5);
_waypoint setWaypointHousePosition (_waypointData select 6);
_waypoint setWaypointLoiterRadius (_waypointData select 7);
_waypoint setWaypointLoiterType (_waypointData select 8);
_waypoint setWaypointCombatMode (_waypointData select 9);
/*_waypoint waypointAttachObject (_waypointData select 10);
_waypoint waypointAttachVehicle (_waypointData select 11);*/
_waypoint showWaypoint (_waypointData select 10);
_waypoint setWaypointVisible (_waypointData select 11);
_waypoint setWaypointBehaviour (_waypointData select 12);
_waypoint setWaypointFormation (_waypointData select 13);
_waypoint setWaypointScript (_waypointData select 14);
_waypoint setWaypointStatements (_waypointData select 15);
_waypoint setWaypointTimeout (_waypointData select 16);
{vehicle _x doMove position vehicle _x} forEach units _group1;
};
} forEach _this;

View File

@ -1,104 +0,0 @@
class AGM_Rsc_Control_Base;
class AGM_Rsc_Display_Base;
class AGM_Repair_Diagnose_Dialog {
idd = -1;
movingEnable = 0;
onLoad = "uiNamespace setVariable ['AGM_dlgDiagnose', _this select 0];";
objects[] = {};
class controlsBackground {
class Background {
idc = -1;
moving = 0;
font = "TahomaB";
text = "";
sizeEx = 0;
lineSpacing = 0;
access = 0;
type = 0;
style = 0;
size = 1;
colorBackground[] = {0, 0, 0, 0.25};
colorText[] = {0, 0, 0, 0};
x = 0;//"safezoneX";
y = 0;//"safezoneY";
w = 1;//"safezoneW";
h = 1;//"safezoneH";
};
/*class Progress_Bar {
idc = 1;
moving = 0;
text = "";
font = "PuristaMedium";
sizeEx = "1 / 40 / (getResolution select 5)";
lineSpacing = 0;
access = 0;
type = 0;
style = 2;
size = 1;
colorBackground[] = {1, 0.647, 0, 0.5};
colorText[] = {1,1,1,1};
x = "safezoneX + 0.1 * safezoneW";
y = "safezoneY + 0.2 * safezoneH";
w = "0.0 * safezoneW";
h = "0.01 * safezoneH";
};*/
class LFWheel : Background{//AGM_Rsc_Control_Base {
idc = 10;
colorBackground[] = {1, 1, 1, 1};
x = "5.5 / 16";
y = "1 / 9";
w = "0.5 / 16";
h = "1.5 / 9";
};
class LF2Wheel : LFWheel {
idc = 11;
y = "3 / 9";
};
class LMWheel : LFWheel {
idc = 12;
y = "5 / 9";
};
class LBWheel : LFWheel {
idc = 13;
y = "7 / 9";
};
class RFWheel : LFWheel {
idc = 14;
x = "10 / 16";
};
class RF2Wheel : RFWheel {
idc = 15;
y = "3 / 9";
};
class RMWheel : RFWheel {
idc = 16;
y = "5 / 9";
};
class RBWheel : RFWheel {
idc = 17;
y = "7 / 9";
};
class Body : LFWheel {
idc = 20;
x = "7 / 16";
y = "4 / 9";
w = "2 / 16";
h = "1.5 / 9";
};
class Engine : Body {
idc = 21;
y = "2 / 9";
};
class Fuel : Body {
idc = 22;
y = "6 / 9";
};
};
};

View File

@ -1,35 +0,0 @@
#define AGM_FUELCAPACITY_KART 4
#define AGM_FUELCAPACITY_QUAD 15
#define AGM_FUELCAPACITY_OFFROARD 80 // http://www.nissan.de/content/dam/services/DE/brochure/NISSAN_Navara_Broschuere+Preisliste_DE.pdf
#define AGM_FUELCAPACITY_VAN 80 // @todo
#define AGM_FUELCAPACITY_MATV 163 // fuel capacity of humvee (can't find informations for M-ATV)
#define AGM_FUELCAPACITY_PUNISHER 200 // This is guesswork and should be adjusted for all vehicles individually in the future @todo
#define AGM_FUELCAPACITY_FENNEK 230 // http://de.wikipedia.org/wiki/Sp%C3%A4hwagen_Fennek
#define AGM_FUELCAPACITY_HEMTT 587 // http://en.wikipedia.org/wiki/Heavy_Expanded_Mobility_Tactical_Truck
#define AGM_FUELCAPACITY_KAMAZ 420 // @todo
#define AGM_FUELCAPACITY_TYPHOON 420 // @todo
#define AGM_FUELCAPACITY_PATRIA 600 // @todo
#define AGM_FUELCAPACITY_ARMA 600 // @todo
#define AGM_FUELCAPACITY_PANDUR 228 // http://www.pandur.at/panzer2.htm
#define AGM_FUELCAPACITY_NAMER 1400 // assumed to be the same as the merkava
#define AGM_FUELCAPACITY_BMP 800 // @todo
#define AGM_FUELCAPACITY_WARRIOR 770 // http://arcaneafvs.com/warrior.html (don't ask)
#define AGM_FUELCAPACITY_MERKAVA 1400 // http://en.wikipedia.org/wiki/Merkava
#define AGM_FUELCAPACITY_T100 1600 // http://www.tanksim.com/topic3.htm
#define AGM_FUELCAPACITY_LEOPARD 1200 // http://en.wikipedia.org/wiki/Leopard_2
#define AGM_FUELCAPACITYCARGO_VAN 5000 // guesswork based on relative size compared to the othes
#define AGM_FUELCAPACITYCARGO_HEMTT 9464 // http://oshkoshdefense.com/variants/m978a4-fuel-servicing-truck-tanker/
#define AGM_FUELCAPACITYCARGO_KAMAZ 7125 // guesswork based on relative size compared to HEMTT
#define AGM_FUELCAPACITYCARGO_TYPHOON 7125 // guesswork based on relative size compared to HEMTT
#define AGM_FUELCAPACITYCARGO_CRV 0 // this thing doesn't carry any fuel (I think)
#define AGM_FUELCAPACITYCARGO_SKYCRANE 3000 // no idea
#define AGM_FUELCAPACITYCARGO_ISOCONT 24000 //http://www.seacoglobal.com/equipment/tank-container/standards/ (a bit less due the ingame varriant)
#define AGM_FUELCAPACITYCARGO_BARREL 200 //https://en.wikipedia.org/wiki/Drum_%28container%29
#define AGM_FUELCAPACITYCARGO_4BARREL 800 //200*4

View File

@ -1,279 +0,0 @@
#define KEY_WHEEL_4X4 \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define KEY_WHEEL_6X6_FRONT \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLBWheel", "HitRBWheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLF2Wheel, STR_AGM_Repair_HitRF2Wheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define KEY_WHEEL_6X6_REAR \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLMWheel", "HitRMWheel", "HitLBWheel", "HitRBWheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLMWheel, STR_AGM_Repair_HitRMWheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define KEY_WHEEL_6X6_REAR_KAMAZ \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLMWheel", "HitRMWheel", "HitLF2Wheel", "HitRF2Wheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLMWheel, STR_AGM_Repair_HitRMWheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define KEY_WHEEL_6X6_STOMPER \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLMWheel", "HitRMWheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLMWheel, STR_AGM_Repair_HitRMWheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define KEY_WHEEL_8X8 \
AGM_Wheels[] = {"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLMWheel", "HitRMWheel", "HitLBWheel", "HitRBWheel"}; \
AGM_WheelsLocalized[] = {STR_AGM_Repair_HitLFWheel, STR_AGM_Repair_HitRFWheel, STR_AGM_Repair_HitLF2Wheel, STR_AGM_Repair_HitRF2Wheel, STR_AGM_Repair_HitLMWheel, STR_AGM_Repair_HitRMWheel, STR_AGM_Repair_HitLBWheel, STR_AGM_Repair_HitRBWheel};
#define MACRO_LOADABLE \
class AGM_loadItem { \
displayName = "$STR_AGM_Logistics_LoadItem"; \
distance = 4; \
condition = "[AGM_Interaction_Target] call AGM_Logistics_fnc_canLoadItem"; \
statement = "[AGM_Interaction_Target, AGM_Logistics_targetVehicle] call AGM_Logistics_fnc_openLoadUI"; \
showDisabled = 1; \
priority = 1.6; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
};
#define MACRO_NOT_LOADABLE \
class AGM_loadItem { \
condition = "false"; \
};
#define MACRO_UNLOAD \
class AGM_loadItemCarried { \
displayName = "$STR_AGM_Logistics_LoadItem"; \
distance = 4; \
condition = "[AGM_Interaction_Target] call AGM_Logistics_fnc_canLoadItemCarried"; \
statement = "[player getVariable 'AGM_carriedItem', AGM_Interaction_Target] call AGM_Logistics_fnc_openLoadUI"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.6; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
}; \
class AGM_unloadBox { \
displayName = "$STR_AGM_Logistics_Unload"; \
distance = 4; \
condition = "[AGM_Interaction_Target] call AGM_Logistics_fnc_hasLoadedItems && {alive AGM_Interaction_Target}"; \
statement = "[AGM_Interaction_Target] call AGM_Logistics_fnc_openUnloadUI"; \
showDisabled = 1; \
priority = 1.5; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
};
#define MACRO_RELOAD_MAGS \
class AGM_reloadMagazines { \
displayName = "$STR_AGM_Logistics_ReloadMagazines"; \
distance = 4; \
condition = "count ([player, AGM_Interaction_Target] call AGM_Logistics_fnc_getLoadableMagazines) > 0"; \
statement = "[AGM_Interaction_Target] call AGM_Logistics_fnc_openMagazineMenu"; \
showDisabled = 1; \
priority = 1.45; \
icon = "\A3\ui_f\data\igui\cfg\actions\reammo_ca.paa"; \
};
#define MACRO_DRAGABLE \
class AGM_DragItem { \
displayName = "$STR_AGM_Drag_StartDrag"; \
distance = 4; \
condition = "!(player call AGM_Drag_fnc_isDraggingObject)"; \
conditionShow = "[AGM_Interaction_Target, player] call AGM_Drag_fnc_isDraggable"; \
statement = "[AGM_Interaction_Target, player] call AGM_Drag_fnc_dragObject"; \
showDisabled = 0; \
priority = 3; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
hotkey = "R"; \
};
// tooltip = "Drag this object."; \
#define MACRO_NOT_DRAGABLE \
class AGM_DragItem { \
condition = "false"; \
};
#define MACRO_GETIN_STATIC \
class AGM_GetIn { \
displayName = "$STR_AGM_StaticWeapons_GetIn"; \
distance = 4; \
condition = "[AGM_Interaction_Target] call AGM_StaticWeapons_fnc_canGetIn"; \
statement = "[AGM_Interaction_Target] call AGM_StaticWeapons_fnc_getIn"; \
showDisabled = 0; \
priority = 1; \
}; \
class AGM_RotateClockwise { \
displayName = "$STR_AGM_StaticWeapons_RotateClockwise"; \
distance = 4; \
condition = "[AGM_Interaction_Target, true] call AGM_StaticWeapons_fnc_canRotate"; \
statement = "[AGM_Interaction_Target, true] call AGM_StaticWeapons_fnc_rotate"; \
showDisabled = 1; \
priority = 2.1; \
icon = "AGM_Logistics\ui\rotate_cw_ca.paa"; \
}; \
class AGM_RotateCounterclockwise { \
displayName = "$STR_AGM_StaticWeapons_RotateCounterclockwise"; \
distance = 4; \
condition = "[AGM_Interaction_Target, false] call AGM_StaticWeapons_fnc_canRotate"; \
statement = "[AGM_Interaction_Target, false] call AGM_StaticWeapons_fnc_rotate"; \
showDisabled = 1; \
priority = 2; \
icon = "AGM_Logistics\ui\rotate_ccw_ca.paa"; \
};
#define MACRO_NOT_GETINABLE_STATIC \
class AGM_GetIn { \
condition = "false"; \
}; \
class AGM_RotateClockwise { \
condition = "false"; \
}; \
class AGM_RotateCounterclockwise { \
condition = "false"; \
}; \
#define MACRO_CUTWIRE \
class AGM_Wirecutter_cut { \
displayName = "$STR_AGM_CutFence"; \
distance = 4; \
condition = "'ToolKit' in items player && {alive AGM_Interaction_Target}"; \
statement = "[5, AGM_Interaction_Target] call AGM_Wirecutter_fnc_cutDownFence"; \
showDisabled = 1; \
priority = 2.1; \
icon = "AGM_Logistics\ui\wirecutter_ca.paa"; \
};
#define MACRO_CUTWIRE_LONG \
class AGM_Wirecutter_cut { \
displayName = "$STR_AGM_CutFence"; \
distance = 4; \
condition = "'ToolKit' in items player && {alive AGM_Interaction_Target}"; \
statement = "[5, AGM_Interaction_Target] call AGM_Wirecutter_fnc_cutDownFence"; \
showDisabled = 1; \
priority = 2.1; \
icon = "AGM_Logistics\ui\wirecutter_ca.paa"; \
};
#define MACRO_CARRYJERRYCAN \
class AGM_CarryJerrycan { \
displayName = "$STR_AGM_Drag_StartCarry"; \
distance = 4; \
condition = "[player, AGM_Interaction_Target] call AGM_Drag_fnc_isCarryable"; \
statement = "[player, AGM_Interaction_Target] call AGM_Drag_fnc_carryJerrycan"; \
showDisabled = 1; \
priority = 3; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
}; \
class AGM_DropJerrycan { \
displayName = "$STR_AGM_Drag_EndCarry"; \
distance = 4; \
condition = "[player, AGM_Interaction_Target] call AGM_Drag_fnc_isCarryingObject"; \
statement = "[player, AGM_Interaction_Target] call AGM_Drag_fnc_dropJerrycan"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 3; \
icon = "\A3\ui_f\data\igui\cfg\actions\gear_ca.paa"; \
}; \
class AGM_CheckFuelJerrycan { \
displayName = "$STR_AGM_Resupply_CheckFuelJerryCan"; \
distance = 4; \
condition = "alive AGM_Interaction_Target"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_getFuelAmountJerrycan"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 3; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
};
#define MACRO_CHECKFUEL \
class AGM_CheckFuelSelf { \
displayName = "$STR_AGM_Resupply_CheckFuelJerryCan"; \
condition = "(player getVariable ['AGM_carriedItem', objNull]) isKindOf 'AGM_JerryCan'"; \
statement = "[player] call AGM_Resupply_fnc_getFuelAmountJerrycan"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 3; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
};
#define MACRO_REFUEL \
class AGM_RefuelCargo { \
displayName = "$STR_AGM_Resupply_RefuelVehicleCargo"; \
distance = 4; \
condition = "[AGM_Interaction_Target] call AGM_Resupply_fnc_canRefuelCargo"; \
statement = "[AGM_Interaction_Target] call AGM_Resupply_fnc_refuelVehicleCargo"; \
showDisabled = 0; \
priority = 1.225; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
}; \
class AGM_Refuel { \
displayName = "$STR_AGM_Resupply_RefuelVehicle"; \
distance = 4; \
condition = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_canRefuel"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_refuelVehicle"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.245; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
}; \
class AGM_DrainFuel { \
displayName = "$STR_AGM_Resupply_DrainFuel"; \
distance = 4; \
condition = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_canDrainFuel"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_drainFuel"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.235; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
}; \
class AGM_CheckFuel { \
displayName = "$STR_AGM_Resupply_CheckFuel"; \
distance = 4; \
condition = "alive AGM_Interaction_Target && {speed AGM_Interaction_Target == 0}"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_getFuelAmount"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.295; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
};
#define MACRO_REFUELCARGO \
class AGM_DrainFuelCargo { \
displayName = "$STR_AGM_Resupply_DrainFuelCargo"; \
distance = 4; \
condition = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_canDrainFuelCargo"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_drainFuelCargo"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.22; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
}; \
class AGM_CheckFuelCargo { \
displayName = "$STR_AGM_Resupply_CheckFuelCargo"; \
distance = 4; \
condition = "alive AGM_Interaction_Target && {speed AGM_Interaction_Target == 0}"; \
statement = "[player, AGM_Interaction_Target] call AGM_Resupply_fnc_getFuelAmountCargo"; \
exceptions[] = {"AGM_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 1.24; \
icon = "\A3\ui_f\data\igui\cfg\actions\refuel_ca.paa"; \
};
#define MACRO_REFUEL_UAV \
class AGM_RefuelUAV { \
displayName = "$STR_AGM_UAVs_Recharge"; \
distance = 4; \
condition = "'AGM_UAVBattery' in items player && {fuel cursorTarget < 1}"; \
statement = "[cursorTarget, player] call AGM_UAVs_fnc_refuel"; \
showDisabled = 0; \
priority = 1.245; \
icon = "AGM_Logistics\ui\AGM_battery.paa"; \
};
#define MACRO_PARADROP \
class AGM_DropCargo { \
displayName = "$STR_AGM_Paradrop_Unload"; \
distance = 4; \
condition = "getNumber(configFile >> 'CfgVehicles' >> typeOf vehicle player >> 'AGM_Paradrop') == 1 && {getPosATL vehicle player select 2 > 60} && {count (vehicle player getVariable ['AGM_Logistics_loadedItems', []]) > 0}"; \
conditionShow = "getNumber(configFile >> 'CfgVehicles' >> typeOf vehicle player >> 'AGM_Paradrop') == 1"; \
statement = "[vehicle player] call AGM_Paradrop_fnc_paradrop"; \
priority = 1; \
enableInside = 1; \
};

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness
specularPower=500; //area of glossiness - the higher the number, the smaller the area
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="AGM_Logistics\data\battery_nohq.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4 {
texture="AGM_Logistics\data\default_as.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,1};
};
};
class Stage5 {
texture="AGM_Logistics\data\battery_smdi.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6 {
texture="#(ai,64,64,1)fresnel(4.7,1.2)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};
class Stage7 {
texture="a3\data_f\env_land_ca.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};

View File

@ -1,79 +0,0 @@
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness
specularPower=500; //area of glossiness - the higher the number, the smaller the area
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="AGM_Logistics\data\default_nohq.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4 {
texture="AGM_Logistics\data\default_as.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,1};
};
};
class Stage5 {
texture="AGM_Logistics\data\default_smdi.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6 {
texture="#(ai,64,64,1)fresnel(4.7,1.2)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};
class Stage7 {
texture="a3\data_f\env_land_ca.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};

View File

@ -1,79 +0,0 @@
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness
specularPower=500; //area of glossiness - the higher the number, the smaller the area
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="AGM_Logistics\data\wheel_nohq.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4 {
texture="AGM_Logistics\data\default_as.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,1};
};
};
class Stage5 {
texture="AGM_Logistics\data\default_smdi.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6 {
texture="#(ai,64,64,1)fresnel(4.7,1.2)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};
class Stage7 {
texture="a3\data_f\env_land_ca.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};

View File

@ -1,48 +0,0 @@
/*
Name: AGM_Drag_fnc_GetWeight
Author(s):
L-H
Description:
Returns the weight of a crate.
Parameters:
OBJECT - Crate to get weight of
Returns:
NUMBER - Weight
Example:
_weight = Crate1 call AGM_Drag_fnc_GetWeight;
*/
private ["_totalWeight", "_fnc","_fnc_Extra"];
_totalWeight = 0;
_fnc_Extra = {
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
};
_fnc = {
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
};
_totalWeight = ([getMagazineCargo _this, "CfgMagazines"] call _fnc);
_totalWeight = _totalWeight + ([getItemCargo _this, "CfgWeapons", "ItemInfo"] call _fnc_Extra);
_totalWeight = _totalWeight + ([getWeaponCargo _this, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra);
_totalWeight = _totalWeight + ([getBackpackCargo _this, "CfgVehicles"] call _fnc);
_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of).
_totalWeight

View File

@ -1,45 +0,0 @@
/*
Name: AGM_Drag_fnc_HandleScrollWheel
Author(s):
L-H
Description:
Handles raising and lowering the dragged weapon to be able to place it on top of objects.
Parameters:
Number: Scroll amount
Returns:
Boolean: Handled or not.
Example:
1.2 call AGM_Drag_fnc_HandleScrollWheel;
*/
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})
private ["_handled", "_z", "_draggedObject"];
_handled = false;
if (player call AGM_Drag_fnc_isDraggingObject) then {
if (AGM_Modifier > 0) then {
_z = (_this * 0.15);
AGM_Drag_CurrentHeightChange = CLAMP(AGM_Drag_CurrentHeightChange + _z,0,1.755);
if (AGM_Drag_CurrentHeightChange <= 1.75 AND {AGM_Drag_CurrentHeightChange >= 0}) then {
_handled = true;
_draggedObject = player getVariable ["AGM_carriedItem", objNull];
if (isNull _draggedObject) exitWith {};
private ["_pos", "_max"];
_pos = getPosATL _draggedObject;
_max = (player ModelToWorld [0,0,1.5]) select 2;
_z = (_pos select 2) + _z;
_pos set [2, CLAMP(_z,0,_max)];
detach _draggedObject;
_draggedObject setPosATL _pos;
_draggedObject attachTo [player];
};
};
};
_handled

View File

@ -1,51 +0,0 @@
/*
Name: AGM_Drag_fnc_makeDraggable
Author(s):
L-H
Description:
Initialises an object for drag usage.
Ensure it is only run on one client or the server.
Parameters:
0: OBJECT - Object (static weapon, crate, etc.)
1: BOOLEAN - Weight accounting if a crate (Default: true)
Returns:
Nothing
Example:
// simply make an object draggable
StaticWeapon2 call AGM_Drag_fnc_makeDraggable;
// make a weapon crate draggable while ignoring its weight
[WeaponCrate,false] call AGM_Drag_fnc_makeDraggable;
// Ensuring only the server initialises the object in the init for the object
if (isServer) then {
this call AGM_Drag_fnc_makeDraggable;
};
*/
private ["_nilTest", "_weightAccount", "_object", "_id"];
if ((typeName _this) == "ARRAY") then {
_object = (_this select 0);
if (count _this > 1) then {
_weightAccount = (_this select 1);
};
} else {
_object = _this;
_weightAccount = true;
};
_nilTest = _object getVariable "AGM_dragActionID";
if ((isNil "_nilTest") OR {_id == -1}) then {
_object setVariable ["AGM_isUsedBy", objNull, true];
_object setVariable ["AGM_useWeight", _weightAccount, true];
_object setVariable ["AGM_disableDrag", false, true];
_id = [_object, localize "STR_AGM_Drag_StartDrag", 4, {!(player call AGM_Drag_fnc_isDraggingObject) AND {[AGM_Interaction_Target, player] call AGM_Drag_fnc_isDraggable}}, {[AGM_Interaction_Target, player] call AGM_Drag_fnc_dragObject;}, true, 2.2] call AGM_Interaction_fnc_addInteraction;
_object setVariable ["AGM_dragActionID", _id, true];
_id = _object getVariable ["AGM_releaseActionID", -1];
if (_id == -1) then {
_id = [_object, localize "STR_AGM_Drag_EndDrag", 4, {(player call AGM_Drag_fnc_isDraggingObject)}, {player call AGM_Drag_fnc_releaseObject;}, false, 2.1] call AGM_Interaction_fnc_addInteraction;
_object setVariable ["AGM_releaseActionID", _id, true];
};
};

View File

@ -1,38 +0,0 @@
/*
Name: AGM_Drag_fnc_makeUndraggable
Author(s):
L-H
Description:
Makes an object undraggable. Also reverses the effects of a AGM_Drag_fnc_makeDraggable call.
Parameters:
0: OBJECT - Object (static weapon, crate, etc.)
Returns:
Nothing
Example:
// Remove drag functionality from an object
[StaticWeapon2] call AGM_Drag_fnc_makeUndraggable;
*/
private ["_object", "_id"];
_object = (_this select 0);
if (_object getVariable ["AGM_inUse", false]) then {
private "_parentObject";
_parentObject = attachedTo _object;
if (!isNull _parentObject AND {_parentObject call AGM_Drag_fnc_isDraggingObject}) then {
_parentObject call AGM_Drag_fnc_releaseObject;
} else {
_object setVariable ["AGM_isUsedBy", objNull, true];
};
};
_object setVariable ["AGM_disableDrag", true, true];
_id = _object getVariable "AGM_dragActionID";
if (!(isNil "_id") OR {_id != -1}) then {
_object setVariable ["AGM_dragActionID", -1, true];
[_object, _id] call AGM_Interaction_fnc_removeInteraction;
};

View File

@ -1,49 +0,0 @@
// by commy2
#define ANIM_CARRY "AmovPercMstpSnonWnonDnon"
#define ATTACH_POINT [0.01, 0, -0.19]
_this spawn {
_unit = _this select 0;
_target = _this select 1;
_unit setVariable ["AGM_isDragging", true];
_unit setVariable ["AGM_carriedItem", _target, true];
_target setVariable ["AGM_isUsedBy", _unit, true];
[_unit, _target, true] call AGM_Core_fnc_claim;
if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"}) then {
[_unit, "amovpercmstpsraswrfldnon"] call AGM_Core_fnc_doAnimation;
};
_unit action ["SwitchWeapon", _unit, _unit, 99];
[_unit, ANIM_CARRY] call AGM_Core_fnc_doAnimation;
waitUntil {animationState _unit == ANIM_CARRY};
// exit here if the player releases the jerry can before the animation is finished
if !(_unit getVariable ["AGM_isDragging", false]) exitWith {};
_target attachTo [_unit, ATTACH_POINT, "RightHand"];
[_target, "{_this setDir 273}", _target] call AGM_Core_fnc_execRemoteFnc; // the setPos getPos trick doesn't work for attached objects
[_unit, "AGM_Logistics", true] call AGM_Core_fnc_setForceWalkStatus;
_actionID = _unit getVariable ["AGM_Drag_ReleaseActionID", -1];
if (_actionID != -1) then {
_unit removeAction _actionID;
};
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_AGM_Drag_EndDrag"], "player call AGM_Drag_fnc_releaseObject;", nil, 20, false, true, "","player call AGM_Drag_fnc_isDraggingObject"];
_unit setVariable ["AGM_Drag_ReleaseActionID", _actionID];
waitUntil {
if (stance _unit != "STAND" || {currentWeapon _unit != ""}) exitWith {
[_unit, _target] call AGM_Drag_fnc_dropJerrycan;
};
!(_unit getVariable ["AGM_isDragging", false])
};
_unit removeAction (_unit getVariable ["AGM_Drag_ReleaseActionID", -1]);
};

View File

@ -1,71 +0,0 @@
/*
Name: AGM_Drag_fnc_dragObject
Author(s):
L-H
Description:
Prepares the passed unit to drag the passed weapon.
Parameters:
0: OBJECT - Dragged weapon
1: OBJECT - Unit dragging
Returns:
Nothing
Example:
[StaticWeapon3, player] call AGM_Drag_fnc_dragObject;
*/
#define ANIM_CARRY ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon"];
_this spawn {
_draggedObject = _this select 0;
_unit = _this select 1;
if (_draggedObject getVariable ["AGM_disableDrag", false]) exitWith {};
_ableToDrag = true;
if ((typeOf _draggedObject) isKindOf "StaticWeapon") then {
_gunner = gunner _draggedObject;
if (!isNull _gunner && {alive _gunner}) then {
_gunner setPosASL getPosASL _gunner;
};
} else { // Crate handling
if (_draggedObject getVariable ["AGM_useWeight", true]) then {
_ableToDrag = ((_draggedObject call AGM_Drag_fnc_GetWeight) <= AGM_Drag_MaxWeight);
};
};
if (!_ableToDrag) exitWith { [localize "STR_AGM_Drag_UnableToDrag"] call AGM_Core_fnc_displayTextStructured;};
if (primaryWeapon _unit == "") then {
_unit addWeapon "AGM_FakePrimaryWeapon";
};
_unit selectWeapon (primaryWeapon _unit);
[_unit, _draggedObject, true] call AGM_Core_fnc_claim;
_unit setVariable ["AGM_isDragging", true];
_unit setVariable ["AGM_carriedItem", _draggedObject, true];
_unit playActionNow "grabDrag";
waitUntil {animationState _unit in ANIM_CARRY};
// exit here if the player releases the jerry can before the animation is finished
if !(_unit getVariable ["AGM_isDragging", false]) exitWith {
_unit playAction "released";
};
_attachPoint = [0,1.2, ((_draggedObject modelToWorld [0,0,0]) select 2) - ((_unit modelToWorld [0,0,0]) select 2)];
_draggedObject attachTo [_unit, _attachPoint];
_actionID = _unit getVariable ["AGM_Drag_ReleaseActionID", -1];
if (_actionID != -1) then {
_unit removeAction _actionID;
};
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_AGM_Drag_EndDrag"], "player call AGM_Drag_fnc_releaseObject;", nil, 20, false, true, "","player call AGM_Drag_fnc_isDraggingObject"];
_unit setVariable ["AGM_Drag_ReleaseActionID", _actionID];
AGM_Drag_CurrentHeightChange = 0;
};

View File

@ -1,19 +0,0 @@
// by commy2
_unit = _this select 0;
_target =_this select 1;
_unit setVariable ["AGM_isDragging", false];
_unit setVariable ["AGM_carriedItem", objNull, true];
_target setVariable ["AGM_isUsedBy", objNull, true];
[objNull, _target, true] call AGM_Core_fnc_claim;
_unit allowDamage false;
detach _target;
[_unit, "AGM_Logistics", false] call AGM_Core_fnc_setForceWalkStatus;
_unit allowDamage true;
_unit removeAction (_unit getVariable ["AGM_Drag_ReleaseActionID", -1]);
[_target, "{_this setVectorUp (surfaceNormal getPosASL _this)}", _target] call AGM_Core_fnc_execRemoteFnc;

View File

@ -1,25 +0,0 @@
/*
Name: AGM_Drag_fnc_Initialise
Author(s):
L-H
Description:
Adds an EventHandler to check if a weapon has been assembled.
Parameters:
Nothing
Returns:
Nothing
Example:
// Called by ArmA via Function Library
call AGM_Drag_fnc_Initialise;
*/
AGM_Drag_CurrentHeightChange = 0;
[{(_this select 0) call AGM_Drag_fnc_HandleScrollWheel;}] call AGM_Core_fnc_addScrollWheelEventHandler;
if (isNil "AGM_Drag_MaxWeight") then {
AGM_Drag_MaxWeight = 800;
};

View File

@ -1,10 +0,0 @@
// by commy2
private ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
_unit == vehicle _unit &&
{alive _target} &&
{!(_target getVariable ["AGM_disableDrag", false])}

View File

@ -1,7 +0,0 @@
// by commy2
private "_unit";
_unit = _this select 0;
!isNull (_unit getVariable ["AGM_carriedItem", objNull]);

View File

@ -1,36 +0,0 @@
/*
Name: AGM_Drag_fnc_isDraggable
Author(s):
L-H
Description:
Checks if an object can be dragged
Parameters:
OBJECT - Drag-able object
Returns:
BOOLEAN
Example:
[StaticWeapon, player] call AGM_Drag_fnc_isDraggable;
*/
private ["_result", "_targetObject","_unit"];
_result = true;
_targetObject = _this select 0;
_unit = _this select 1;
if (_unit != (vehicle _unit)) exitWith {false};
if (_targetObject getVariable ["AGM_disableDrag", false]) exitWith {false};
//if (_targetObject getVariable ["AGM_inUse", false]) exitWith {false};
if ((typeOf _targetObject) isKindOf "StaticWeapon") then {
_result = isNull(gunner _targetObject);
if !(_result) then {
_result = !alive (gunner _targetObject);
};
};
if !(_result) exitWith {_result};
_result = !(_unit call AGM_Drag_fnc_isDraggingObject) AND ((_unit distance _targetObject) < 3);
_result && {!([_targetObject] call AGM_Core_fnc_owned)}

View File

@ -1,23 +0,0 @@
/*
Name: AGM_Drag_fnc_isDraggingObject
Author(s):
L-H
Description:
Checks whether there is an attached dragged object to the passed unit.
Parameters:
OBJECT: Unit
Returns:
BOOLEAN: true if a dragged object is attached.
Example:
_draggingObject = player call AGM_Drag_fnc_isDraggingObject;
*/
private "_draggedObject";
_draggedObject = _this getVariable ["AGM_carriedItem", objNull];
if (isNull _draggedObject) exitWith {false};
true

View File

@ -1,42 +0,0 @@
/*
Name: AGM_Drag_fnc_releaseObject
Author(s):
L-H
Description:
Releases dragged weapon from passed unit.
Parameters:
OBJECT - Unit
Returns:
Nothing
Example:
player call AGM_Drag_fnc_releaseObject;
*/
private ["_draggedObject", "_position"];
_this removeWeapon "AGM_FakePrimaryWeapon";
_draggedObject = _this getVariable ["AGM_carriedItem", objNull];
if (_this == (vehicle _this)) then { // if the unit is the vehicle of the passed unit (avoids bugs with players entering vehicles while dragging
_this playAction "released";
};
if (isNull _draggedObject) exitWith {}; // If there is no dragged object exit now.
[objNull, _draggedObject, true] call AGM_Core_fnc_claim;
_this setVariable ["AGM_isDragging", false];
_this setVariable ["AGM_carriedItem", objNull, true];
detach _draggedObject;
[_this, "AGM_Logistics", false] call AGM_Core_fnc_setForceWalkStatus;
_this removeAction (_this getVariable ["AGM_Drag_ReleaseActionID", -1]);
_draggedObject setDamage (damage _draggedObject);
_position = getPosATL _draggedObject;
if (_position select 2 < 0) then {
_position set [2, 0];
_draggedObject setPosATL _position;
};
[_draggedObject, "{_this setVectorUp (surfaceNormal getPosASL _this)}", _draggedObject] call AGM_Core_fnc_execRemoteFnc;

View File

@ -1,8 +0,0 @@
// by commy2
private "_crate";
_crate = _this select 1;
isNull (missionNamespace getVariable ["AGM_Fortifications_Setup", objNull])
&& {!([_crate] call AGM_Core_fnc_owned)}

View File

@ -1,25 +0,0 @@
/*
Name: AGM_Fortifications_fnc_Initialise
Author(s):
L-H, commy2
Description:
Adds an EventHandler to check if a weapon has been assembled.
Parameters:
Nothing
Returns:
Nothing
Example:
// Called by ArmA via Function Library
call AGM_Fortifications_fnc_Initialise;
*/
[{
if (!isNull (missionNamespace getVariable ["AGM_Fortifications_Setup", objNull])) then {
AGM_Fortifications_TweakedAngle = AGM_Fortifications_TweakedAngle + (_this select 0) min 240 max 120;
};
}] call AGM_Core_fnc_addScrollWheelEventHandler;

View File

@ -1,39 +0,0 @@
// by commy2
private ["_unit", "_crate", "_types", "_count", "_actions", "_name", "_picture", "_type"];
_unit = _this select 0;
_crate = _this select 1;
_types = _this select 2;
_count = count _types;
_actions = ["Select Fortification Menu", "Select"] call AGM_Interaction_fnc_prepareSelectMenu;
for "_index" from 0 to (_count - 1) do {
_type = _types select _index;
_name = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
_picture = "AGM_Interaction\UI\dot_ca.paa";
_actions = [
_actions,
_name,
_picture,
_type
] call AGM_Interaction_fnc_AddSelectableItem;
};
[
_actions,
{
call AGM_Interaction_fnc_hideMenu;
_vehicle = AGM_Interaction_Target;
if ([player, _vehicle, _this] call AGM_Fortifications_fnc_canSetupBarrier) then {
[player, _vehicle, _this] call AGM_Fortifications_fnc_setupBarrier;
};
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {"Default" call AGM_Interaction_fnc_openMenu};
}
] call AGM_Interaction_fnc_openSelectMenu;

View File

@ -1,63 +0,0 @@
// by Garth de Wet (LH), edited by commy2
if (AGM_Fortifications_pfeh_running) then {
["AGM_Fortifications_Placement", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Fortifications_pfeh_running = false;
};
private "_setup";
_setup = AGM_Fortifications_Setup;
AGM_Fortifications_Setup = objNull;
[AGM_Fortifications_placer, "AGM_Logistics", false] call AGM_Core_fnc_setForceWalkStatus;
AGM_Fortifications_placer = objNull;
[player, "DefaultAction", player getVariable ["AGM_Fortifications_Place", -1]] call AGM_Core_fnc_removeActionEventHandler;
[player, "MenuBack", player getVariable ["AGM_Fortifications_Cancel", -1]] call AGM_Core_fnc_removeActionEventHandler;
call AGM_Interaction_fnc_hideMouseHint;
_setup spawn {
_pos = getPosASL _this;
_dir = getDir _this;
//_dir = if (_dir > 180) then {_dir - 180} else {180 + _dir}; // ?
player setVariable ["AGM_PlantingExplosive", true];
player playActionNow "MedicOther";
sleep 5;
deleteVehicle AGM_Fortifications_crate;
// create global object
_type = typeOf _this;
_setup = _type createVehicle [0, 0, -10000];
deleteVehicle _this;
_setup setDir _dir;
_setup setPosASL _pos;
player setVariable ["AGM_PlantingExplosive", false];
_this enableSimulationGlobal true;
_this allowDamage true;
//_this setDamage 0;
/*[_setup] spawn {
sleep 10;
_setup = _this select 0;
if (!isNull _setup) then {
_mag = _setup getVariable ["AGM_Class", ""];
_dir = _setup getVariable ["AGM_Dir", 0];
sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "AGM_DelayTime");
[player, GetPosATL _setup, _dir, _mag, _setup getVariable "AGM_Trigger", [_setup getVariable "AGM_Timer"], true] call AGM_Explosives_fnc_PlaceExplosive;
deleteVehicle _setup;
player RemoveMagazine _mag;
};
};*/
};

View File

@ -1,45 +0,0 @@
// by Garth de Wet (LH), edited by commy2
_this spawn {
_unit = _this select 0;
_crate = _this select 1;
_type = _this select 2;
AGM_Fortifications_placer = _unit;
AGM_Fortifications_crate = _crate;
[_unit, _crate] call AGM_Core_fnc_claim;
AGM_Fortifications_Setup = _type createVehicleLocal [0, 0, -10000];
AGM_Fortifications_Setup allowDamage false;
AGM_Fortifications_Setup enableSimulationGlobal false;
AGM_Fortifications_Setup attachTo [_unit, _unit worldToModel ((ASLtoATL eyePos player) vectorAdd (positionCameraToWorld [0, 0, 4] vectorDiff positionCameraToWorld [0, 0, 0]))];
detach AGM_Fortifications_Setup;
[_unit, "AGM_Logistics", true] call AGM_Core_fnc_setForceWalkStatus;
AGM_Fortifications_TweakedAngle = 180;
["AGM_Fortifications_Placement", "OnEachFrame", {
if (AGM_Fortifications_placer != player) exitWith {
call AGM_Fortifications_fnc_setupCancel;
};
AGM_Fortifications_pfeh_running = true;
_pos = (ASLtoATL eyePos player) vectorAdd (positionCameraToWorld [0, 0, 4] vectorDiff positionCameraToWorld [0, 0, 0]);
_pos set [2, 0];
if (getPosATL player distance _pos < 2 || {!alive player} || {player getVariable ["AGM_isUnconscious", false]} || {player != vehicle player}) exitWith {
call AGM_Fortifications_fnc_setupCancel;
};
AGM_Fortifications_Setup setPosATL _pos;
if (AGM_Modifier == 0) then {
AGM_Fortifications_Setup setDir (AGM_Fortifications_TweakedAngle + getDir player);
};
}] call BIS_fnc_addStackedEventHandler;
[localize "STR_AGM_Fortifications_PlaceAction", localize "STR_AGM_Fortifications_CancelAction", localize "STR_AGM_Fortifications_ScrollAction"] call AGM_Interaction_fnc_showMouseHint;
_unit setVariable ["AGM_Fortifications_Place", [_unit, "DefaultAction", {AGM_Fortifications_pfeh_running && {!isNull AGM_Fortifications_Setup}}, {call AGM_Fortifications_fnc_setupApprove}] call AGM_Core_fnc_AddActionEventHandler];
_unit setVariable ["AGM_Fortifications_Cancel", [_unit, "MenuBack", {AGM_Fortifications_pfeh_running && {!isNull AGM_Fortifications_Setup}}, {call AGM_Fortifications_fnc_setupCancel}] call AGM_Core_fnc_AddActionEventHandler];
};

View File

@ -1,25 +0,0 @@
// by Garth de Wet (LH), edited by commy2
if (AGM_Fortifications_pfeh_running) then {
["AGM_Fortifications_Placement", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Fortifications_pfeh_running = false;
};
if (!isNull (AGM_Fortifications_Setup)) then {
deleteVehicle AGM_Fortifications_Setup;
};
[objNull, AGM_Fortifications_crate] call AGM_Core_fnc_claim;
AGM_Fortifications_Setup = objNull;
if (isNil {AGM_Fortifications_placer}) then {
AGM_Fortifications_placer = objNull;
};
[AGM_Fortifications_placer, "AGM_Logistics", false] call AGM_Core_fnc_setForceWalkStatus;
AGM_Fortifications_placer = objNull;
call AGM_Interaction_fnc_hideMouseHint;
[player, "DefaultAction", player getVariable ["AGM_Fortifications_Place", -1]] call AGM_Core_fnc_removeActionEventHandler;
[player, "MenuBack", player getVariable ["AGM_Fortifications_Cancel", -1]] call AGM_Core_fnc_removeActionEventHandler;

View File

@ -1,42 +0,0 @@
//marc_book, commy2, CAA-Picard
private ["_vehicle", "_fnc_smoke", "_fnc_light", "_items", "_count", "_item", "_position", "_parachute", "_smoke", "_light"];
_this spawn {
_vehicle = _this select 0;
_fnc_smoke = {
_smoke = "SmokeshellYellow" createVehicle (_position);
_smoke attachTo [_item, [0, 0, 0]];
};
_fnc_light = {
_light = "Chemlight_yellow" createVehicle (_position);
_light attachTo [_item, [0, 0, 0]];
};
_items = _vehicle getVariable ["AGM_Logistics_loadedItems", []];
_count = count _items;
_item = _items select (_count - 1);
_items = _items - [_item];
_vehicle setVariable ["AGM_Logistics_loadedItems", _items, true];
_position = ((vectorDir _vehicle) vectorMultiply -15) vectorAdd getPosASL _vehicle;
detach _item;
_item setPosASL _position;
sleep 0.7;
_parachute = createVehicle ["B_Parachute_02_F", position _item, [], 0, "CAN_COLLIDE"];
_parachute attachTo [_item, [0, 0, 0]];
detach _parachute;
_item attachTo [_parachute, [0, 0, -1]];
_light = [] call _fnc_light;
waitUntil {sleep 0.1; position _item select 2 < 1};
detach _item;
_smoke = [] call _fnc_smoke;
};

View File

@ -1,17 +0,0 @@
#define ALL_HITPOINTS [ \
"HitBody", "HitHull", "HitEngine", "HitFuel", \
"HitTurret", "HitGun", \
"HitLTrack", "HitRTrack", \
"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLMWheel", "HitRMWheel", "HitLBWheel", "HitRBWheel", \
"HitAvionics", "HitHRotor", "HitVRotor" \
]
#define ALL_HITPOINTS_GLASS [ \
"HitBody", "HitHull", "HitEngine", "HitFuel", \
"HitTurret", "HitGun", \
"HitLTrack", "HitRTrack", \
"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLMWheel", "HitRMWheel", "HitLBWheel", "HitRBWheel", \
"HitAvionics", "HitHRotor", "HitVRotor", \
"HitRGlass", "HitLGlass", "HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6" \
]

View File

@ -1,14 +0,0 @@
// by commy2
private ["_vehicle", "_wheels"];
_vehicle = _this select 0;
//_wheels = _this select 1;
_wheels = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels");
_wheels = [_wheels, {_vehicle getHitPointDamage _this < 1}] call AGM_Core_fnc_filter;
count _wheels > 0
&& {alive _vehicle}
&& {speed _vehicle == 0}

View File

@ -1,11 +0,0 @@
// by commy2
private ["_vehicle", "_part"];
_vehicle = _this select 0;
_part = _this select 1;
("ToolKit" in items player || {!isNull ([_vehicle] call AGM_Repair_fnc_getNearestRepairer)})
&& {alive _vehicle}
&& {speed _vehicle == 0}
&& {floor (3 * (_vehicle getHitPointDamage _part)) > 0}

View File

@ -1,14 +0,0 @@
// by commy2
private ["_vehicle", "_part", "_spareTrack"];
_vehicle = _this select 0;
_part = _this select 1;
_spareTrack = [player] call AGM_Repair_fnc_getNearestTrack;
("ToolKit" in items player || {!isNull ([_vehicle] call AGM_Repair_fnc_getNearestRepairer)})
&& {alive _vehicle}
&& {speed _vehicle == 0}
&& {!isNull _spareTrack}
&& {floor (3 * (_vehicle getHitPointDamage _part)) > 0}

View File

@ -1,17 +0,0 @@
// by commy2
private ["_vehicle", "_wheels", "_spareWheel"];
_vehicle = _this select 0;
//_wheels = _this select 1;
_wheels = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels");
_wheels = [_wheels, {_vehicle getHitPointDamage _this == 1}] call AGM_Core_fnc_filter;
_spareWheel = [player] call AGM_Repair_fnc_getNearestWheel;
count _wheels > 0
&& {alive _vehicle}
&& {speed _vehicle == 0}
&& {!isNull _spareWheel}

View File

@ -1,10 +0,0 @@
// commy2
private "_vehicle";
_vehicle = _this select 0;
player playActionNow "Gear";
[8, [_vehicle], "AGM_Repair_fnc_checkVehicleCallback", localize "STR_AGM_Repair_CheckingVehicle"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,32 +0,0 @@
/*
* Author: marc_book, commy2
*/
#include <Macros.hqf>
private ["_vehicle", "_displayName", "_string", "_height", "_damage", "_name"];
_vehicle = _this select 0;
_displayName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
_string = format ["<t align='center' size='0.8'>%1<br/><br/>", format [localize "STR_AGM_Repair_VehicleName", _displayName]];
_height = 1;
{
_damage = floor (3 * (_vehicle getHitPointDamage _x));
if (!isNil "_damage" && {_damage > 0}) then {
_name = [_x] call AGM_Repair_fnc_getHitPointName;
_string = _string + format [localize (["STR_AGM_Repair_HitPointDamaged", "STR_AGM_Repair_HitPointDamagedHeavy", "STR_AGM_Repair_HitPointDestroyed"] select (_damage - 1)), _name] + "<br/>";
_height = _height + 0.25;
};
} forEach ALL_HITPOINTS;
if (_height == 1) then {
_string = _string + localize "STR_AGM_Repair_Nothing";
_height = 1.25;
};
_string = _string + "</t>";
[composeText [lineBreak, parseText _string], _height] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,9 +0,0 @@
// by commy2
private ["_hitPoint", "_string"];
_hitPoint = _this select 0;
_string = format ["STR_AGM_Repair_%1", _hitPoint];
if (isLocalized _string) then {localize _string} else {_hitPoint}

View File

@ -1,16 +0,0 @@
// by commy2
private ["_unit", "_nearObjects"];
_unit = _this select 0;
_nearObjects = nearestObjects [_unit, ["Car", "Tank", "ReammoBox_F"], 10];
{
if !(getNumber (configFile >> "CfgVehicles" >> typeOf _x >> "AGM_canRepair") > 0) then {
_nearObjects set [_forEachIndex, objNull];
};
} forEach _nearObjects;
_nearObjects = _nearObjects - [objNull];
if (count _nearObjects == 0) exitWith {objNull};
_nearObjects select 0

View File

@ -1,16 +0,0 @@
// by commy2
private ["_unit", "_nearObjects"];
_unit = _this select 0;
_nearObjects = nearestObjects [_unit, ["AGM_SpareTrack"], 5];
{
if !([_unit, _x] call AGM_Core_fnc_canInteractWith) then {
_nearObjects set [_forEachIndex, objNull];
};
} forEach _nearObjects;
_nearObjects = _nearObjects - [objNull];
if (count _nearObjects == 0) exitWith {objNull};
_nearObjects select 0

View File

@ -1,16 +0,0 @@
// by commy2
private ["_unit", "_nearObjects"];
_unit = _this select 0;
_nearObjects = nearestObjects [_unit, ["AGM_SpareWheel"], 5];
{
if !([_unit, _x] call AGM_Core_fnc_canInteractWith) then {
_nearObjects set [_forEachIndex, objNull];
};
} forEach _nearObjects;
_nearObjects = _nearObjects - [objNull];
if (count _nearObjects == 0) exitWith {objNull};
_nearObjects select 0

View File

@ -1,30 +0,0 @@
/*
* Author: KoffeinFlummi
* Edited from Medical Module
* Editor: Hawkeye104
*
* Initializes the repair module.
*
* Arguments:
* Whatever the module provides. (I dunno.)
*
* Return Value:
* None
*/
if !(isServer) exitWith {};
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {};
AGM_Repair_Module = true;
[_logic, "AGM_Repair_TimeRepair", "TimeRepair" ] call AGM_Core_fnc_readNumericParameterFromModule;
[_logic, "AGM_Repair_TimeWheelRepair", "TimeWheelRepair" ] call AGM_Core_fnc_readNumericParameterFromModule;
[_logic, "AGM_Repair_TimeTrackRepair", "TimeTrackRepair" ] call AGM_Core_fnc_readNumericParameterFromModule;
[_logic, "AGM_Repair_MaxDamageRepair", "MaxDamageRepair" ] call AGM_Core_fnc_readNumericParameterFromModule;
diag_log text "[AGM]: Repair Module Initialized.";

View File

@ -1,41 +0,0 @@
// by commy2
private ["_vehicle", "_wheels", "_listIDC", "_count", "_index", "_wheel", "_name", "_picture", "_lbIndex"];
_vehicle = _this select 0;
//_wheels = _this select 1;
_wheels = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels");
_wheels = [_wheels, {AGM_Interaction_Target getHitPointDamage _this > 0}] call AGM_Core_fnc_filter;
_count = count _wheels;
_actions = [localize "STR_AGM_Repair_SelectWheelMenu", localize "STR_AGM_Repair_SelectWheel"] call AGM_Interaction_fnc_prepareSelectMenu;
for "_index" from 0 to (_count - 1) do {
_wheel = _wheels select _index;
//_name = [_wheel] call AGM_Repair_fnc_getHitPointName;
_name = localize (getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_WheelsLocalized") select (getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels") find _wheel));
_picture = "AGM_Interaction\UI\dot_ca.paa";
if (_vehicle getHitPointDamage _wheel == 1) then {
_actions = [
_actions,
_name,
_picture,
_wheel
] call AGM_Interaction_fnc_AddSelectableItem;
};
};
[
_actions,
{
call AGM_Interaction_fnc_hideMenu;
_vehicle = AGM_Interaction_Target;
[_vehicle, _this] call AGM_Repair_fnc_repairWheel;
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {"Default" call AGM_Interaction_fnc_openMenu};
}
] call AGM_Interaction_fnc_openSelectMenu;

View File

@ -1,41 +0,0 @@
// by commy2
private ["_vehicle", "_wheels", "_listIDC", "_count", "_index", "_wheel", "_name", "_picture", "_lbIndex"];
_vehicle = _this select 0;
//_wheels = _this select 1;
_wheels = getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels");
_wheels = [_wheels, {AGM_Interaction_Target getHitPointDamage _this < 1}] call AGM_Core_fnc_filter;
_count = count _wheels;
_actions = [localize "STR_AGM_Repair_SelectWheelMenu_Salvage", localize "STR_AGM_Repair_SelectWheel_Salvage"] call AGM_Interaction_fnc_prepareSelectMenu;
for "_index" from 0 to (_count - 1) do {
_wheel = _wheels select _index;
//_name = [_wheel] call AGM_Repair_fnc_getHitPointName;
_name = localize (getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_WheelsLocalized") select (getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_Wheels") find _wheel));
_picture = "AGM_Interaction\UI\dot_ca.paa";
if (_vehicle getHitPointDamage _wheel < 1) then {
_actions = [
_actions,
_name,
_picture,
_wheel
] call AGM_Interaction_fnc_AddSelectableItem;
};
};
[
_actions,
{
call AGM_Interaction_fnc_hideMenu;
_vehicle = AGM_Interaction_Target;
[_vehicle, _this] call AGM_Repair_fnc_removeWheel;
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {"Default" call AGM_Interaction_fnc_openMenu};
}
] call AGM_Interaction_fnc_openSelectMenu;

View File

@ -1,20 +0,0 @@
// by commy2
private ["_vehicle", "_part", "_isEngineer", "_time", "_name", "_string"];
_vehicle = _this select 0;
_part = _this select 1;
_isEngineer = [player] call AGM_Core_fnc_isEngineer;
_time = 10;
_time = _time + 10 * (_vehicle getHitPointDamage _part);
if !(_isEngineer) then {_time = _time + 10};
[player, "AinvPknlMstpSnonWnonDr_medic5", 0] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_RemovingWheel", _name];
[_time, [_vehicle, _part], "AGM_Repair_fnc_removeWheelCallback", _string, "AGM_Repair_fnc_removeWheelAbort"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,3 +0,0 @@
// by commy2
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;

View File

@ -1,23 +0,0 @@
// by commy2
private ["_vehicle", "_part", "_damage", "_wheel", "_name", "_string"];
_vehicle = _this select 0;
_part = _this select 1;
_damage = _vehicle getHitPointDamage _part;
// can't remove destroyed or already removed wheel
if (_damage == 1) exitWith {};
[_vehicle, _part, 1, true] call AGM_Repair_fnc_setHitPointDamage;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
_wheel = ['AGM_SpareWheel', getPosASL player] call AGM_Logistics_fnc_spawnObject;
_wheel setdamage _damage;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_RemovedWheel", _name];
[_string] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,27 +0,0 @@
// by commy2
// Edited by Hawkeye104 for compatibility with Repair Module
private ["_vehicle", "_part", "_isEngineer", "_time", "_name", "_string", "_repairer"];
_vehicle = _this select 0;
_part = _this select 1;
_isEngineer = [player] call AGM_Core_fnc_isEngineer;
//New time calculation from repair module
_time = AGM_Repair_TimeRepair;
_time = _time + AGM_Repair_TimeRepair * (_vehicle getHitPointDamage _part);
if !(_isEngineer) then {_time = _time + 0.5 * AGM_Repair_TimeRepair};
[player, "AinvPknlMstpSnonWnonDr_medic5", 0] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repairing", _name];
[_time, [_vehicle, _part], "AGM_Repair_fnc_repairCallback", _string, "AGM_Repair_fnc_repairAbort"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;
_repairer = [_vehicle] call AGM_Repair_fnc_getNearestRepairer;
if (!("ToolKit" in items player) && {!isNull _repairer}) then {
[_repairer] call AGM_Core_fnc_closeDialogIfTargetMoves;
};

View File

@ -1,3 +0,0 @@
// by commy2
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;

View File

@ -1,17 +0,0 @@
// by commy2
// Edited by Hawkeye104 for compatibility with repair module
private ["_vehicle", "_part", "_name", "_string"];
_vehicle = _this select 0;
_part = _this select 1;
// Repair module parameter function call
[_vehicle, _part, AGM_Repair_MaxDamageRepair] call AGM_Repair_fnc_setHitPointDamage;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repaired", _name];
[_string] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,33 +0,0 @@
// by commy2
// Edited by Hawkeye104 for compatibility with Repair Module
private ["_vehicle", "_part", "_isEngineer", "_time", "_name", "_string", "_spareTrack", "_repairer"];
_vehicle = _this select 0;
_part = _this select 1;
_isEngineer = [player] call AGM_Core_fnc_isEngineer;
//New time calculation from repair module
_time = AGM_Repair_TimeTrackRepair;
_time = _time + AGM_Repair_TimeTrackRepair * (_vehicle getHitPointDamage _part);
if !(_isEngineer) then {_time = _time + 0.5 * AGM_Repair_TimeTrackRepair};
[player, "AinvPknlMstpSnonWnonDr_medic5", 0] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repairing", _name];
_spareTrack = [player] call AGM_Repair_fnc_getNearestTrack;
if (isNull _spareTrack) exitWith {};
[player, _spareTrack] call AGM_Core_fnc_claim;
[_time, [_vehicle, _part, _spareTrack], "AGM_Repair_fnc_repairTrackCallback", _string, "AGM_Repair_fnc_repairTrackAbort"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;
[_spareTrack] call AGM_Core_fnc_closeDialogIfTargetMoves;
_repairer = [_vehicle] call AGM_Repair_fnc_getNearestRepairer;
if (!("ToolKit" in items player) && {!isNull _repairer}) then {
[_repairer] call AGM_Core_fnc_closeDialogIfTargetMoves;
};

View File

@ -1,9 +0,0 @@
// by commy2
private "_spareTrack";
_spareTrack = _this select 2;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
[objNull, _spareTrack] call AGM_Core_fnc_claim;

View File

@ -1,20 +0,0 @@
// by commy2
#define POST_REPAIR_DAMAGE 0
private ["_vehicle", "_part", "_spareTrack", "_name", "_string"];
_vehicle = _this select 0;
_part = _this select 1;
_spareTrack = _this select 2;
deleteVehicle _spareTrack;
[_vehicle, _part, POST_REPAIR_DAMAGE] call AGM_Repair_fnc_setHitPointDamage;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repaired", _name];
[_string] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,28 +0,0 @@
// by commy2
// Edited by Hawkeye104 for compatibility with Repair Module
private ["_vehicle", "_part", "_isEngineer", "_time", "_name", "_string", "_spareWheel"];
_vehicle = _this select 0;
_part = _this select 1;
_isEngineer = [player] call AGM_Core_fnc_isEngineer;
//New time calculation from repair module
_time = AGM_Repair_TimeWheelRepair;
_time = _time + AGM_Repair_TimeWheelRepair * (_vehicle getHitPointDamage _part);
if !(_isEngineer) then {_time = _time + 0.5 * AGM_Repair_TimeWheelRepair};
[player, "AinvPknlMstpSnonWnonDr_medic5", 0] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repairing", _name];
_spareWheel = [player] call AGM_Repair_fnc_getNearestWheel;
if (isNull _spareWheel) exitWith {};
[player, _spareWheel] call AGM_Core_fnc_claim;
[_time, [_vehicle, _part, _spareWheel], "AGM_Repair_fnc_repairWheelCallback", _string, "AGM_Repair_fnc_repairWheelAbort"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;
[_spareWheel] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,9 +0,0 @@
// by commy2
private "_spareWheel";
_spareWheel = _this select 2;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
[objNull, _spareWheel] call AGM_Core_fnc_claim;

View File

@ -1,21 +0,0 @@
// by commy2
#define POST_REPAIR_DAMAGE 0
private ["_vehicle", "_part", "_spareWheel", "_damage", "_name", "_string"];
_vehicle = _this select 0;
_part = _this select 1;
_spareWheel = _this select 2;
_damage = damage _spareWheel;
deleteVehicle _spareWheel;
[_vehicle, _part, _damage] call AGM_Repair_fnc_setHitPointDamage;
[player, "AmovPknlMstpSrasWrflDnon", 1] call AGM_Core_fnc_doAnimation;
_name = [_part] call AGM_Repair_fnc_getHitPointName;
_string = format [localize "STR_AGM_Repair_Repaired", _name];
[_string] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,34 +0,0 @@
/*
* Author: commy2, KoffeinFlummi
*
* Sets the structural damage of a vehicle without altering the hitPoints.
* THIS NEEDS TO BE CALLED FROM THE PC WHERE THE VEHICLE IS LOCAL.
*
* Arguments:
* 0: Vehicle
* 1: Damage
*
* Return Value:
* None
*/
#include <Macros.hqf>
private ["_vehicle", "_damage", "_hitPoints", "_damageHitPoint"];
_vehicle = _this select 0;
_damage = _this select 1;
_hitPoints = [];
{
_damageHitPoint = _vehicle getHitPointDamage _x;
if (isNil "_damageHitPoint") then {_damageHitPoint = 0};
_hitPoints set [_forEachIndex, _damageHitPoint];
} forEach ALL_HITPOINTS;
_vehicle setDamage _damage;
{
_vehicle setHitPointDamage [_x, _hitPoints select _forEachIndex];
} forEach ALL_HITPOINTS;

View File

@ -1,70 +0,0 @@
/*
* Author: commy2, KoffeinFlummi
*
* My very own setHitPointDamage since BIS's one is buggy when affecting a remote unit.
* It also doesn't change the overall damage. This does.
*
* Arguments:
* 0: vehicle
* 1: selection
* 2: damage
* 4: disable overall damage adjustment (optional)
*
* Return Value:
* -
*/
#include <Macros.hqf>
private ["_vehicle", "_selection", "_damage", "_hitPoints", "_damageHitPoint", "_damageOld", "_damageSumOld", "_damageSumNew", "_damageNew"];
_vehicle = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
// Unit isn't local, give function to machine where it is.
if !(local _vehicle) exitWith {
[_this, "AGM_Repair_fnc_setHitPointDamage", _vehicle] call AGM_Core_fnc_execRemoteFnc;
};
// Check if overall damage adjustment is disabled
if (count _this > 3 && {_this select 3}) exitWith {
_vehicle setHitPointDamage [_selection, _damage];
};
if !(_selection in ALL_HITPOINTS) exitWith {
_vehicle setHitPointDamage [_selection, _damage];
};
_hitPoints = [];
{
_damageHitPoint = _vehicle getHitPointDamage _x;
if (isNil "_damageHitPoint") then {_damageHitPoint = 0};
_hitPoints set [_forEachIndex, _damageHitPoint];
} forEach ALL_HITPOINTS;
_damageOld = damage _vehicle;
_damageSumOld = 0;
{
_damageSumOld = _damageSumOld + _x;
} forEach _hitPoints;
_damageSumOld = _damageSumOld max 0.001;
_hitPoints set [ALL_HITPOINTS find _selection, _damage];
_damageSumNew = 0;
{
_damageSumNew = _damageSumNew + _x;
} forEach _hitPoints;
_damageNew = _damageSumNew / count ALL_HITPOINTS;
if (_damageOld > 0) then {
_damageNew = _damageOld * (_damageSumNew / _damageSumOld);
};
_vehicle setDamage _damageNew;
{
_vehicle setHitPointDamage [_x, _hitPoints select _forEachIndex];
} forEach ALL_HITPOINTS;

View File

@ -1,15 +0,0 @@
// by commy2
private ["_unit", "_target", "_item", "_fuel"];
_unit = _this select 0;
_target = _this select 1;
_item = _unit getVariable ["AGM_carriedItem", objNull];
_fuel = _item getVariable ["AGM_amountFuel", 20];
_item isKindOf "AGM_JerryCan"
&& {alive _target}
&& {speed _target == 0}
&& {fuel _target > 0}
&& {_fuel < 20}

View File

@ -1,16 +0,0 @@
// by commy2
private ["_unit", "_target", "_item", "_fuel", "_fuelCargo"];
_unit = _this select 0;
_target = _this select 1;
_item = _unit getVariable ["AGM_carriedItem", objNull];
_fuel = _item getVariable ["AGM_amountFuel", 20];
_fuelCargo = _target getVariable ["AGM_amountFuel", 9999];
_item isKindOf "AGM_JerryCan"
&& {alive _target}
&& {speed _target == 0}
&& {_fuelCargo > 0}
&& {_fuel < 20}

View File

@ -1,15 +0,0 @@
// by commy2
private ["_unit", "_target", "_item", "_fuel"];
_unit = _this select 0;
_target = _this select 1;
_item = _unit getVariable ["AGM_carriedItem", objNull];
_fuel = _item getVariable ["AGM_amountFuel", 20];
_item isKindOf "AGM_JerryCan"
&& {alive _target}
&& {speed _target == 0}
&& {fuel _target < 1}
&& {_fuel > 0}

View File

@ -1,17 +0,0 @@
// by commy2
private ["_target", "_vehicle", "_fuel"];
_target = _this select 0;
_vehicle = [player] call AGM_Resupply_fnc_getNearestRefueler;
_fuel = _vehicle getVariable ["AGM_amountFuelCargo", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacityCargo")];
!isNull _vehicle
&& {alive _target}
&& {alive _vehicle}
&& {speed _target == 0}
&& {speed _vehicle == 0}
&& {fuel _target < 1}
&& {_fuel > 0}

View File

@ -1,22 +0,0 @@
// by commy2
#define TIME_PER_LITER 2
private ["_unit", "_vehicle", "_item", "_fuel", "_capacity", "_fuelVehicle", "_time"];
_unit = _this select 0;
_vehicle = _this select 1;
_item = _unit getVariable "AGM_carriedItem";
if (isNil "_item") exitWith {};
_fuel = _item getVariable ["AGM_amountFuel", 20];
_capacity = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacity");
_fuelVehicle = fuel _vehicle * _capacity;
_time = TIME_PER_LITER * (_fuelVehicle min 20) max 2;
[_time, [_unit, _vehicle], "AGM_Resupply_fnc_drainFuelCallback", localize "STR_AGM_Resupply_DrainingFuel"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,31 +0,0 @@
// by commy2
private ["_unit", "_vehicle", "_item", "_fuel", "_capacity", "_fuelVehicle", "_displayName", "_text"];
_unit = _this select 0;
_vehicle = _this select 1;
_item = _unit getVariable "AGM_carriedItem";
if (isNil "_item") exitWith {};
_fuel = _item getVariable ["AGM_amountFuel", 20];
_capacity = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacity");
_fuelVehicle = fuel _vehicle * _capacity;
if (_fuel + _fuelVehicle < 20) then {
_fuel = _fuel + _fuelVehicle;
_fuelVehicle = 0;
} else {
_fuelVehicle = _fuelVehicle + _fuel - 20;
_fuel = 20;
};
[[_vehicle, _fuelVehicle / _capacity], "{(_this select 0) setFuel (_this select 1)}", _vehicle] call AGM_Core_fnc_execRemoteFnc;
_item setVariable ["AGM_amountFuel", _fuel, true];
_displayName = getText (configfile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
_text = format [localize "STR_AGM_Resupply_DrainedFuel", _displayName];
[_text] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,19 +0,0 @@
// by commy2
#define TIME_PER_LITER 2
private ["_unit", "_vehicle", "_item", "_fuel", "_fuelCargo", "_time"];
_unit = _this select 0;
_vehicle = _this select 1;
_item = _unit getVariable "AGM_carriedItem";
if (isNil "_item") exitWith {};
_fuel = _item getVariable ["AGM_amountFuel", 20];
_fuelCargo = _vehicle getVariable ["AGM_amountFuelCargo", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacityCargo")];
_time = TIME_PER_LITER * (_fuelCargo min 20) max 2;
[_time, [_unit, _vehicle], "AGM_Resupply_fnc_drainFuelCargoCallback", localize "STR_AGM_Resupply_DrainingFuelCargo"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,28 +0,0 @@
// by commy2
private ["_unit", "_vehicle", "_item", "_fuel", "_fuelCargo", "_displayName", "_text"];
_unit = _this select 0;
_vehicle = _this select 1;
_item = _unit getVariable "AGM_carriedItem";
if (isNil "_item") exitWith {};
_fuel = _item getVariable ["AGM_amountFuel", 20];
_fuelCargo = _vehicle getVariable ["AGM_amountFuelCargo", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacityCargo")];
if (_fuel + _fuelCargo < 20) then {
_fuel = _fuel + _fuelCargo;
_fuelCargo = 0;
} else {
_fuelCargo = _fuelCargo + _fuel - 20;
_fuel = 20;
};
_item setVariable ["AGM_amountFuel", _fuel, true];
_vehicle setVariable ["AGM_amountFuelCargo", _fuelCargo, true];
_displayName = getText (configfile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
_text = format [localize "STR_AGM_Resupply_DrainedFuelCargo", _displayName];
[_text] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,11 +0,0 @@
// by commy2
private ["_unit", "_vehicle"];
_unit = _this select 0;
_vehicle = _this select 1;
player playActionNow "Gear";
[2, [_vehicle], "AGM_Resupply_fnc_getFuelAmountCallback", localize "STR_AGM_Resupply_CheckingFuel"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,13 +0,0 @@
// by commy2
private ["_vehicle", "_capacity", "_fuel", "_text"];
_vehicle = _this select 0;
_capacity = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacity");
_fuel = fuel _vehicle * _capacity;
_fuel = (round (10 * _fuel)) / 10;
_text = format [localize "STR_AGM_Resupply_CheckedFuelVehicle", _fuel];
[_text] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,11 +0,0 @@
// by commy2
private ["_unit", "_vehicle"];
_unit = _this select 0;
_vehicle = _this select 1;
player playActionNow "Gear";
[2, [_vehicle], "AGM_Resupply_fnc_getFuelAmountCargoCallback", localize "STR_AGM_Resupply_CheckingFuelCargo"] call AGM_Core_fnc_progressBar;
[_vehicle] call AGM_Core_fnc_closeDialogIfTargetMoves;

View File

@ -1,10 +0,0 @@
// by commy2
private ["_vehicle", "_fuel", "_text"];
_vehicle = _this select 0;
_fuel = _vehicle getVariable ["AGM_amountFuelCargo", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_fuelCapacityCargo")];
_text = format [localize "STR_AGM_Resupply_CheckedFuelVehicleCargo", _fuel];
[_text] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,19 +0,0 @@
// by commy2
private ["_unit", "_item", "_fuel", "_text"];
_unit = _this select 0;
_item = _this select 1;
if (isNil "_item") then {
_item = _unit getVariable "AGM_carriedItem";
};
if (isNil "_item") exitWith {};
_fuel = _item getVariable ["AGM_amountFuel", 20];
_fuel = (round (10 * _fuel)) / 10;
_unit playActionNow "Gear";
_text = format [localize "STR_AGM_Resupply_CheckedFuel", _fuel];
[_text] call AGM_Core_fnc_displayTextStructured;

Some files were not shown because too many files have changed in this diff Show More