remove malyutka

This commit is contained in:
Brandon Danyluk 2021-08-02 16:53:14 -06:00
parent 76c5c6e6d3
commit 98e66d20ab
35 changed files with 0 additions and 1141 deletions

View File

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

View File

@ -1,92 +0,0 @@
class CfgAmmo {
class M_Scalpel_AT;
class ammo_Penetrator_Base;
class GVAR(9s415_dummy_ammo): M_Scalpel_AT {
aiAmmoUsageFlags = 0;
model = "";
proxyShape = "";
effectsMissile = "";
};
class GVAR(9m14_penetrator): ammo_Penetrator_Base {
caliber = 60;
warheadName = "HEAT";
hit = 600;
};
// need to have ammo suffix or else game crashes on load
class GVAR(9m14_ammo): M_Scalpel_AT {
aiAmmoUsageFlags = 0;
model = QPATHTOF(data\9m14.p3d);
proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F";
submunitionAmmo = QGVAR(9m14_penetrator);
submunitionDirectionType = "SubmunitionModelDirection";
submunitionInitSpeed = 1000;
submunitionParentSpeedCoef = 0;
submunitionInitialOffset[] = { 0, 0, -0.2 };
hit = 150;
warheadName = "HEAT";
indirectHit = 25;
indirectHitRange = 3.5;
explosive = 0.8;
displayName = CSTRING(9m14_missile);
displayNameShort = CSTRING(9m14_missile);
description = CSTRING(9m14_missile_description);
descriptionShort = CSTRING(9m14_missile_descriptionShort);
effectsMissile = "missile2";
irLock = 0;
laserLock = 0;
manualControl = 0;
maxSpeed = 100;
thrustTime = 3;
thrust = 125;
timeToLive = 40;
initTime = 0;
EGVAR(rearm,caliber) = 178;
class ace_missileguidance {
enabled = 1;
pitchRate = 15; // Minium flap deflection for guidance
yawRate = 15; // Maximum flap deflection for guidance
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
showTrail = 1;
// Guidance type for munitions
defaultSeekerType = "MCLOS";
seekerTypes[] = { "MCLOS" };
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL" };
defaultNavigationType = "Line";
navigationTypes[] = { "Line" };
lineGainP = 5;
lineGainD = 0;
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 30; // Angle from the shooter's view that can track the missile
seekerAccuracy = 1; // seeker accuracy multiplier
seekerMinRange = 0;
seekerMaxRange = 3000; // Range from the missile which the seeker can visually search
correctionDistance = 0; // distance from center of crosshair where missile slows down
offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair.
// Attack profile type selection
defaultAttackProfile = "WIRE";
attackProfiles[] = {"WIRE"};
};
};
};

View File

@ -1,17 +0,0 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -1,20 +0,0 @@
class CfgMagazines {
class 12Rnd_PG_missiles;
class GVAR(9m14): 12Rnd_PG_missiles {
count = 1;
initSpeed = 100;
ammo = QGVAR(9m14_ammo);
displayName = CSTRING(9m14_missile);
displayNameShort = CSTRING(9m14_missile);
descriptionShort = CSTRING(9m14_missile_descriptionShort);
};
class GVAR(9s415_dummy): 12Rnd_PG_missiles {
count = 4;
ammo = QGVAR(9s415_dummy_ammo);
displayName = CSTRING(9m14_missile);
displayNameShort = CSTRING(9m14_missile);
descriptionShort = CSTRING(9m14_missile_descriptionShort);
};
};

View File

@ -1,228 +0,0 @@
class CfgVehicles {
class LandVehicle;
class StaticWeapon: LandVehicle {
class Turrets;
class MainTurret;
class ACE_Actions {
class ACE_MainActions {};
};
};
class StaticATWeapon: StaticWeapon {};
class GVAR(9m14): StaticATWeapon {
scope = 2;
side = 1;
faction = "BLU_F";
crew = "B_UAV_AI";
author = "Brandon (TCVM)";
displayName = CSTRING(9m14);
model = QPATHTOF(data\9m14_mount.p3d);
picture = "\A3\Static_F_Gamma\data\UI\gear_StaticTurret_AT_CA.paa";
UiPicture = "\A3\Static_F_Gamma\data\UI\gear_StaticTurret_AT_CA.paa";
icon = "\A3\Static_F_Gamma\data\UI\map_StaticTurret_AT_CA.paa";
threat[] = {0.7,1.0,0.1};
cost = 150000;
class Damage {
tex[] = {};
mat[] = {
"a3\static_f_gamma\data\staticturret_01.rvmat",
"a3\static_f_gamma\data\staticturret_01_damage.rvmat",
"a3\static_f_gamma\data\staticturret_01_destruct.rvmat",
"a3\static_f_gamma\data\staticturret_02.rvmat",
"a3\static_f_gamma\data\staticturret_02_damage.rvmat",
"a3\static_f_gamma\data\staticturret_02_destruct.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher_damage.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher_destruct.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube_damage.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube_destruct.rvmat"
};
};
// no human will be in a turret
class Turrets: Turrets {
class MainTurret: MainTurret {
optics = 1;
turretInfoType = "RscWeaponEmpty";
gunnerOpticsModel = "";
minElev = 0;
maxElev = 0;
weapons[] = { QGVAR(9m14) };
magazines[] = { QGVAR(9m14) };
gunnerAction = "";
gunnergetInAction = "";
gunnergetOutAction = "";
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
displayName = CSTRING(9m14);
class ViewOptics {
initAngleX = 0;
minAngleX = -30;
maxAngleX = 30;
initAngleY = 5;
minAngleY = -100;
maxAngleY = 100;
initFov = 0.055;
minFov = 0.055; // 6 degree FOV
maxFov = 0.055;
visionMode[] = {"Normal"};
thermalMode[] = {0};
};
gunnerRightHandAnimName = "";
gunnerLeftHandAnimName = "";
gunBeg = "missile_begin";
gunEnd = "missile_end";
memoryPointGunnerOptics = "";
};
};
soundGetOut[] = {"A3\sounds_f\dummysound",0.001,1,5};
soundGetIn[] = {"A3\sounds_f\dummysound",0.00031622776,1,5};
armorStructural = 10.0;
class ACE_CSW {
disassembleTo = QGVAR(super);
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
displayName = CSTRING(9m14);
class GVAR(takePlug) {
displayName = CSTRING(takePlug);
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakePlug));
statement = QUOTE([ARR_2(_player,_target)] call FUNC(takePlug));
};
};
};
class AnimationSources {
class missile_hide {
source = "user";
animPeriod = 0.0001;
initPhase = 0;
maxValue = "1";
minValue = "0";
};
};
};
class GVAR(9m14_joystick): StaticATWeapon {
scope = 2;
side = 1;
faction = "BLU_F";
crew = "B_Soldier_F";
author = "Brandon (TCVM)";
ace_missileguidance_hasMCLOSControl = 1;
displayName = CSTRING(9s415);
model = QPATHTOF(data\9m14_joystick.p3d);
picture = "\A3\Static_F_Gamma\data\UI\gear_StaticTurret_AT_CA.paa";
UiPicture = "\A3\Static_F_Gamma\data\UI\gear_StaticTurret_AT_CA.paa";
icon = "\A3\Static_F_Gamma\data\UI\map_StaticTurret_AT_CA.paa";
threat[] = {0.7,1.0,0.1};
cost = 100000;
class Damage {
tex[] = {};
mat[] = {
"a3\static_f_gamma\data\staticturret_01.rvmat",
"a3\static_f_gamma\data\staticturret_01_damage.rvmat",
"a3\static_f_gamma\data\staticturret_01_destruct.rvmat",
"a3\static_f_gamma\data\staticturret_02.rvmat",
"a3\static_f_gamma\data\staticturret_02_damage.rvmat",
"a3\static_f_gamma\data\staticturret_02_destruct.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher_damage.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_launcher_destruct.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube_damage.rvmat",
"a3\weapons_f_beta\launchers\titan\data\titan_mtube_destruct.rvmat"
};
};
class Turrets: Turrets {
class MainTurret: MainTurret {
optics = 1;
turretInfoType = "RscWeaponEmpty";
gunnerOpticsModel = "\a3\weapons_f_gamma\reticle\GMG_01_Optics_Gunner_F";
minElev = -30;
maxElev = 20;
weapons[] = { QGVAR(9s415_dummy_weapon) };
magazines[] = { QGVAR(9s415_dummy) };
gunnerAction = "gunner_static_low01";
gunnergetInAction = "";
gunnergetOutAction = "";
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
displayName = CSTRING(9s415);
class ViewOptics {
initAngleX = 0;
minAngleX = -90;
maxAngleX = 90;
initAngleY = 0;
minAngleY = -100;
maxAngleY = 100;
initFov = 0.055;
minFov = 0.055; // 6 degree FOV
maxFov = 0.055;
visionMode[] = {"Normal"};
thermalMode[] = {0};
};
gunnerRightHandAnimName = "OtocHlaven_shake";
gunnerLeftHandAnimName = "OtocHlaven_shake";
gunBeg = "spice rakety";
gunEnd = "konec rakety";
memoryPointGunnerOptics = "view_pos";
};
};
soundGetOut[] = {"A3\sounds_f\dummysound",0.001,1,5};
soundGetIn[] = {"A3\sounds_f\dummysound",0.00031622776,1,5};
armorStructural = 10.0;
class ACE_CSW {
disassembleTo = QGVAR(super);
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
displayName = CSTRING(9s415);
selection = "center";
};
};
};
class ThingX;
class GVAR(plug): ThingX {
displayName = QGVAR(plug);
scope = 1;
scopeCurator = 1;
model = "\a3\Structures_F_Orange\VR\Helpers\Sign_sphere10cm_Geometry_F.p3d";
destrType = "DestructNo";
class ACE_Actions {
class ACE_MainActions {
displayName = CSTRING(plug);
condition = "true";
distance = 2;
class GVAR(pickup) {
displayName = CSTRING(pickupPlug);
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canPickupPlug));
statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickupPlug));
};
class GVAR(unattach) {
displayName = CSTRING(unattachPlug);
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canUnattachPlug));
statement = QUOTE([ARR_2(_player,_target)] call FUNC(unattachPlug));
};
};
};
};
};

View File

@ -1,54 +0,0 @@
class CfgWeapons {
class MissileLauncher;
class GVAR(9m14): MissileLauncher {
displayName = CSTRING(9m14_missile);
magazines[] = { QGVAR(9m14) };
initSpeed = 100;
autoFire = 0;
canLock = 0;
weaponLockSystem = 0;
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
soundFly[] = {"A3\Sounds_F\weapons\Rockets\rocket_fly_1",1,1.1,700};
nameSound = "MissileLauncher";
sounds[] = {"StandardSound"};
class StandardSound {
begin1[] = {"A3\Sounds_F\weapons\Rockets\missile_1",1.12202,1.3,1000};
soundBegin[] = {"begin1",1};
soundsetshot[] = {"RocketsMedium_Shot_SoundSet"};
};
cursor = "EmptyCursor";
cursorAim = "missile";
showAimCursorInternal = 0;
autoReload = 1;
magazineReloadTime = 20;
};
// dummy weapon meant to allow the ability to shoot "connected" malyutkas
class GVAR(9s415_dummy_weapon): MissileLauncher {
displayName = CSTRING(9m14_missile); // intended to be 9m14
magazines[] = { QGVAR(9s415_dummy) };
initSpeed = 100;
autoFire = 0;
canLock = 0;
weaponLockSystem = 0;
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
soundFly[] = {"",1,1.1,700};
nameSound = "";
sounds[] = {""};
class StandardSound {
begin1[] = {"",1.12202,1.3,1000};
soundBegin[] = {"",1};
soundsetshot[] = {""};
};
cursor = "EmptyCursor";
cursorAim = "missile";
showAimCursorInternal = 0;
autoReload = 1;
magazineReloadTime = 0.2;
};
};

View File

@ -1,12 +0,0 @@
ace_malutka
===================
Adds 9M14 Malyutka MCLOS ATGM
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [Brandon-TCVM](https://github.com/TheCandianVendingMachine)

View File

@ -1,16 +0,0 @@
PREP(canAttachPlug);
PREP(attachPlug);
PREP(canPickupPlug);
PREP(pickupPlug);
PREP(canTakePlug);
PREP(takePlug);
PREP(canUnattachPlug);
PREP(unattachPlug);
PREP(onFired);
PREP(initSuitcase);
PREP(initJoystick);
PREP(carryPlugPFH);
PREP(onMouseButtonDown);
PREP(returnPlug);
PREP(onLauncherFired);

View File

@ -1,27 +0,0 @@
#include "script_component.hpp"
[QGVAR(9m14_joystick), "fired", LINKFUNC(onFired)] call CBA_fnc_addClassEventHandler;
[QGVAR(9m14), "fired", LINKFUNC(onLauncherFired)] call CBA_fnc_addClassEventHandler;
[QGVAR(9m14_joystick), "init", LINKFUNC(initJoystick), true, [], true] call CBA_fnc_addClassEventHandler;
[QGVAR(9m14), "init", LINKFUNC(initSuitcase), true, [], true] call CBA_fnc_addClassEventHandler;
["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler;
if (hasInterface) then {
["vehicle", {
params ["_unit","_vehicle"];
TRACE_2("vehicle change",_vehicle,typeOf _vehicle);
if (!(_vehicle isKindOf QGVAR(9m14_joystick))) exitWith {};
// transfer locality of connected units
private _connectedUnits = _vehicle getVariable QGVAR(plugStatus);
{
if (_x isNotEqualTo objNull) then {
["ace_setOwner", [_x, clientOwner]] call CBA_fnc_serverEvent;
_x setVariable [QGVAR(owner), _unit];
};
} forEach _connectedUnits;
}, true] call CBA_fnc_addPlayerEventHandler;
};

View File

@ -1,10 +0,0 @@
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
ADDON = true;

View File

@ -1,4 +0,0 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

View File

@ -1,22 +0,0 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common","ace_missileguidance"};
author = ECSTRING(common,ACETeam);
authors[] = {"Brandon (TCVM)"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -1,81 +0,0 @@
class CfgSkeletons {
class Default {
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {
"suitcase", "",
"missile", "suitcase"
};
};
class 9m14_skeleton: Default {};
class 9m14_mount_skeleton: Default {};
class 9m14_joystick_skeleton: Default {
skeletonBones[] = {
"box", "",
"periscope", "box",
"view_pos", "periscope"
};
};
};
class CfgModels {
class Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "";
};
class 9m14: Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "9m14_skeleton";
};
class 9m14_mount: Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "9m14_mount_skeleton";
class Animations {
class missile_hide {
type = "hide";
source = "user";
selection = "missile";
animPeriod = 0.0001;
minValue = 0;
maxValue = 1;
minPhase = 0;
maxPhase = 1;
hideValue = 0.99;
};
};
};
class 9m14_joystick: Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "9m14_joystick_skeleton";
class Animations {
class MainGun {
type = "rotation";
selection = "view_pos";
sourceAddress = "clamp";
source = "MainGun";
axis = "elevation_axis";
animPeriod = 0.01;
initPhase = 0;
maxValue = "rad 360";
minValue = "rad -360";
angle1 = "rad -360";
angle0 = "rad +360";
};
class MainTurret {
type = "rotation";
source = "MainTurret";
selection = "periscope";
sourceAddress = "loop";
axis = "rotation_axis";
animPeriod = 0.005;
minValue = "rad -360";
maxValue = "rad +360";
angle1 = "rad -360";
angle0 = "rad +360";
};
};
};
};

View File

@ -1,49 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Attaches a launch suitcase to a control box
*
* Arguments:
* 0: Suitcase <OBJECT>
* 1: Control Box <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, obj2] call ace_malyutka_fnc_attachPlug
*
* Public: No
*/
params ["_suitcase", "_controlBox"];
private _statuses = _controlBox getVariable QGVAR(plugStatus);
private _availableIndex = _statuses findIf { _x isEqualTo objNull };
if (_availableIndex >= 0) then {
_statuses set [_availableIndex, _suitcase];
_controlBox setVariable [QGVAR(plugStatus), _statuses, true];
private _plug = _suitcase getVariable QGVAR(plugHeader);
_plug attachTo [_controlBox, [0, 0, 0], format ["plug_%1", _availableIndex + 1]];
_plug setVariable [QGVAR(attachedControlBox), _controlBox, true];
_suitcase setVariable [QGVAR(attachedToPlugNumber), _availableIndex, true];
if (someAmmo _suitcase) then {
private _currentAmmoState = (_controlBox getVariable QGVAR(vehicleAmmo)) + 1;
_controlBox setVariable [QGVAR(vehicleAmmo), _currentAmmoState, true];
// can only hold 4 missiles at a time, so we multiply by 1/4 to get correct ammo
_controlBox setVehicleAmmo (_currentAmmoState * 0.25);
};
// transfer locality so missileguidance works
if !(local gunner _controlBox) then {
private _gunnerID = ((gunner _controlBox) getVariable [QEGVAR(common,playerOwner), CBA_clientID]);
["ace_setOwner", [_suitcase, _gunnerID]] call CBA_fnc_serverEvent;
_suitcase setVariable [QGVAR(owner), _unit];
};
} else {
// how did we get here?
WARNING_2("Managed to attach plug to a full control box",_availableIndex,_statuses);
};

View File

@ -1,22 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Whether or not we can attach the plug to a control box
*
* Arguments:
* 0: Suitcase <OBJECT>
* 1: Control Box <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_canAttachPlug
*
* Public: No
*/
params ["_suitcase", "_controlBox"];
private _statuses = _controlBox getVariable QGVAR(plugStatus);
// if we have a single available plug, we can attach
(_statuses findIf { _x isEqualTo objNull }) >= 0

View File

@ -1,20 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Whether or not we can pickup the plug from the ground
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Plug <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_canPickupPlug
*
* Public: No
*/
params ["", "_plug"];
(objNull isEqualTo attachedTo _plug) && { (_plug getVariable QGVAR(attachedControlBox)) isEqualTo objNull }

View File

@ -1,20 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Whether or not we can take the plug from the launch suitcase
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_canTakePlug
*
* Public: No
*/
params ["_unit", "_target"];
(alive _target) && !(_target getVariable QGVAR(plugTaken))

View File

@ -1,20 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Whether or not we can unattach the plug from the control box
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_canUnattachPlug
*
* Public: No
*/
params ["", "_plug"];
(_plug getVariable QGVAR(attachedControlBox)) isNotEqualTo objNull

View File

@ -1,80 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Handles carrying of plug
*
* Arguments:
* 0: Unit carrying plug <OBJECT>
* 1: Plug <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, plug] call ace_malyutka_fnc_carryPlugPFH
*
* Public: No
*/
params ["_unit", "_plug"];
private _originSuitcase = _plug getVariable QGVAR(origin);
private _rope = _originSuitcase getVariable QGVAR(plugRope);
[{
params ["_args", "_handle"];
_args params ["_unit", "_rope", "_plug", "_suitcase"];
private _exitCondition = !(
!isNull _plug
&& !isNull _suitcase
&& { alive _unit }
&& {"" isEqualTo currentWeapon _unit || {_unit call EFUNC(common,isSwimming)}}
&& {[_unit, objNull, ["isNotInside", "isNotOnLadder", "isNotSwimming", "notOnMap"]] call EFUNC(common,canInteractWith)}
&& {"unconscious" isNotEqualTo toLower animationState _unit}
&& {!(_unit getVariable ["ACE_isUnconscious", false])}
);
if (_plug isNotEqualTo objNull && _suitcase isNotEqualTo objNull) then {
_exitCondition = _exitCondition || (_plug getVariable QGVAR(dropped));
_exitCondition = _exitCondition || ((_plug distance2d _suitcase) > MAX_WIRE_DISTANCE);
};
if (_exitCondition) exitWith {
[_handle] call CBA_fnc_removePerFrameHandler;
call EFUNC(interaction,hideMouseHint);
_unit setVariable [QGVAR(hint), []];
_unit setVariable [QGVAR(carryingPlug), objNull];
if ((_plug getVariable QGVAR(attachedControlBox)) isEqualTo objNull) then {
detach _plug;
};
_plug setVariable [QGVAR(dropped), false];
};
private _hintLMB = "";
private _hintRMB = localize ELSTRING(dragging,Drop);
getCursorObjectParams params ["_cursorObject", "", "_distance"];
if (!isNull _cursorObject && {_distance < ATTACH_DISTANCE}) then {
if (
_cursorObject isKindOf QGVAR(9m14_joystick) &&
{ ([_suitcase, _cursorObject] call FUNC(canAttachPlug)) }
) then {
_hintLMB = localize LSTRING(attachPlug);
};
if (
_cursorObject isKindOf QGVAR(9m14) &&
{ _cursorObject isEqualTo (_plug getVariable QGVAR(origin)) }
) then {
_hintLMB = localize LSTRING(returnPlug);
};
};
private _hint = [_hintLMB, _hintRMB];
if (_hint isNotEqualTo (_unit getVariable [QGVAR(hint), []])) then {
_unit setVariable [QGVAR(hint), _hint];
_hint call EFUNC(interaction,showMouseHint);
};
}, 0, [_unit, _rope, _plug, _originSuitcase]] call CBA_fnc_addPerFrameHandler;

View File

@ -1,25 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Initialise joystick
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_initJoystick
*
* Public: No
*/
params ["_joystick"];
// each plug has information regarding the current launcher which is connected
// if null, no launcher is connected
_joystick setVariable [QGVAR(plugStatus), [objNull, objNull, objNull, objNull], true];
_joystick setVariable [QGVAR(vehicleAmmo), 0, true];
_joystick setVehicleAmmo 0;

View File

@ -1,24 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Initialise suitcase launcher
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_initSuitcase
*
* Public: No
*/
params ["_suitcase"];
_suitcase setVariable [QGVAR(plugTaken), false, true];
_suitcase setVariable [QGVAR(plugRope), objNull, true];
_suitcase setVariable [QGVAR(plugHeader), objNull, true];
_suitcase setVariable [QGVAR(attachedToPlugNumber), -1, true];

View File

@ -1,38 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Handle the firing of a Malyutka
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_onFired
*
* Public: No
*/
params ["_unit", "", "", "", "", "", "_projectile"];
// projectile is a dummy to trigger this event handler
deleteVehicle _projectile;
private _controlBox = vehicle _unit;
private _currentAmmoState = (_controlBox getVariable QGVAR(vehicleAmmo));
_controlBox setVariable [QGVAR(vehicleAmmo), _currentAmmoState - 1, true];
private _statuses = _controlBox getVariable QGVAR(plugStatus);
private _availableIndex = _statuses findIf { (_x isNotEqualTo objNull) && (someAmmo _x) };
if (_availableIndex >= 0) then {
private _malyutka = _statuses select _availableIndex;
_malyutka animate ["missile_hide", 1];
[_malyutka, QGVAR(9m14)] call BIS_fnc_fire;
} else {
// how did we get here?
private _statusesData = _statuses apply { (_x isNotEqualTo objNull) && (someAmmo _x) };
WARNING_3("Managed to fire when no control boxes were ready to fire",_availableIndex,_statuses,_statusesData);
};

View File

@ -1,34 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Add a per frame handler to the malyutka that copies MCLOS control data from player to missile
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_onLauncherFired
*
* Public: No
*/
params ["_unit", "", "", "", "", "", "_projectile"];
[{
params ["_args", "_handle"];
_args params ["_unit", "_projectile"];
if !(alive _projectile) exitWith {
[_handle] call CBA_fnc_removePerFrameHandler;
};
// owner can change while missile is in flight
private _owner = _unit getVariable QGVAR(owner);
if ((vehicle _owner) isKindOf QGVAR(9m14_joystick)) then {
_unit setVariable [QEGVAR(missileguidance,MCLOS_direction), _owner getVariable [QEGVAR(missileguidance,MCLOS_direction), [0, 0, 0]]];
};
}, 0, [_unit, _projectile, _trackerLight]] call CBA_fnc_addPerFrameHandler;

View File

@ -1,48 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Handles mouse interaction when carrying plug
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [player, plug] call ace_malyutka_fnc_onMouseButtonDown
*
* Public: No
*/
params ["", "_button"];
private _unit = ACE_PLAYER;
private _plug = _unit getVariable [QGVAR(carryingPlug), objNull];
if (_button > 1 || _plug isEqualTo objNull) exitWith {
};
if (_button == 1) then {
// RMB
_plug setVariable [QGVAR(dropped), true];
} else {
// LMB
getCursorObjectParams params ["_cursorObject", "", "_distance"];
if (!isNull _cursorObject && {_distance < ATTACH_DISTANCE}) then {
if (
_cursorObject isKindOf QGVAR(9m14_joystick) &&
{ ([_suitcase, _cursorObject] call FUNC(canAttachPlug)) }
) then {
[_plug getVariable QGVAR(origin), _cursorObject] call FUNC(attachPlug);
_plug setVariable [QGVAR(dropped), true];
};
if (
_cursorObject isKindOf QGVAR(9m14) &&
{ _cursorObject isEqualTo (_plug getVariable QGVAR(origin)) }
) then {
[_plug, _cursorObject] call FUNC(returnPlug);
};
};
};

View File

@ -1,26 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Picks up plug from ground
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_pickupPlug
*
* Public: No
*/
params ["_unit", "_handle"];
_handle attachTo [_unit, [0, 1, 0], "pelvis"];
_unit setVariable [QGVAR(carryingPlug), _handle];
_plug setVariable [QGVAR(dropped), false];
[_unit] call EFUNC(weaponselect,putWeaponAway);
[_unit, _handle] call FUNC(carryPlugPFH);

View File

@ -1,28 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Returns plug to launcher suitcase
*
* Arguments:
* 0: Plug <OBJECT>
* 1: Suitcase <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_returnPlug
*
* Public: No
*/
params ["_plug", "_suitcase"];
deleteVehicle _plug;
private _rope = _suitcase getVariable QGVAR(plugRope);
ropeDestroy _rope;
_suitcase setVariable [QGVAR(plugTaken), false, true];
_suitcase setVariable [QGVAR(plugRope), objNull, true];
_suitcase setVariable [QGVAR(plugHeader), objNull, true];

View File

@ -1,32 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Takes a plug from the launch suitcase
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Suitcase <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_takePlug
*
* Public: No
*/
params ["_unit", "_target"];
private _handle = createVehicle [QGVAR(plug), [0, 0, 0], [], 0, "CAN_COLLIDE"];
_handle setVariable [QGVAR(origin), _target, true];
_handle setVariable [QGVAR(attachedControlBox), objNull, true];
_handle setVariable [QGVAR(dropped), false, false];
[_unit, _handle] call FUNC(pickupPlug);
private _rope = ropeCreate [_target, "missile_plug", _handle, [0, 0, 0], MAX_WIRE_DISTANCE];
_target setVariable [QGVAR(plugTaken), true, true];
_target setVariable [QGVAR(plugRope), _rope, true];
_target setVariable [QGVAR(plugHeader), _handle, true];

View File

@ -1,35 +0,0 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Unattaches plug from control box
*
* Arguments:
* 0: Static Weapon <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player] call ace_malyutka_fnc_unattachPlug
*
* Public: No
*/
params ["_unit", "_plug"];
private _suitcase = _plug getVariable QGVAR(origin);
private _controlBox = _plug getVariable QGVAR(attachedControlBox);
private _suitcaseIndex = _suitcase getVariable QGVAR(attachedToPlugNumber);
if (_suitcaseIndex < 0) exitWith {
WARNING_1("Somehow unattached plug when not first attached",_suitcaseIndex);
};
_suitcase setVariable [QGVAR(attachedToPlugNumber), -1, true];
private _statuses = _controlBox getVariable QGVAR(plugStatus);
_statuses set [_suitcaseIndex, objNull];
_controlBox setVariable [QGVAR(plugStatus), _statuses, true];
_plug setVariable [QGVAR(attachedControlBox), objNull, true];
[_unit, _plug] call FUNC(pickupPlug);

View File

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

View File

@ -1,20 +0,0 @@
#define COMPONENT malyutka
#define COMPONENT_BEAUTIFIED Malyutka
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_MALYUTKA
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_MALYUTKA
#define DEBUG_SETTINGS DEBUG_SETTINGS_MALYUTKA
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define ATTACH_DISTANCE 3
#define MAX_WIRE_DISTANCE 15

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Malyutka">
<Key ID="STR_ACE_Malyutka_9m14">
<English>[CSW] 9M14 Malyutka</English>
</Key>
<Key ID="STR_ACE_Malyutka_9m14_missile">
<English>9M14</English>
</Key>
<Key ID="STR_ACE_Malyutka_9m14_missile_description">
<English>MCLOS, wire-guided missile</English>
</Key>
<Key ID="STR_ACE_Malyutka_9m14_missile_descriptionShort">
<English>MCLOS, wire-guided missile</English>
</Key>
<Key ID="STR_ACE_Malyutka_9s415">
<English>[CSW] 9S415 Control Unit</English>
</Key>
<Key ID="STR_ACE_Malyutka_takePlug">
<English>Take Plug</English>
</Key>
<Key ID="STR_ACE_Malyutka_attachPlug">
<English>Attach Plug</English>
</Key>
<Key ID="STR_ACE_Malyutka_plug">
<English>Plug</English>
</Key>
<Key ID="STR_ACE_Malyutka_pickupPlug">
<English>Pickup Plug</English>
</Key>
<Key ID="STR_ACE_Malyutka_returnPlug">
<English>Return Plug</English>
</Key>
</Package>
</Project>