Merge remote-tracking branch 'origin/master' into lasers

This commit is contained in:
jaynus 2015-04-02 09:35:51 -07:00
commit c83e602028
54 changed files with 1639 additions and 1129 deletions

View File

@ -1,6 +1,10 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit)); init = QUOTE(call COMPILE_FILE(XEH_preInit));
}; };
}; };
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
};
};

View File

@ -4,23 +4,23 @@
class ACE_MainActions { \ class ACE_MainActions { \
class GVAR(AttachVehicle) { \ class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \ displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ condition = QUOTE(_this call FUNC(canAttach)); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \
exceptions[] = {"isNotDragging"}; \ exceptions[] = {}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \ icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \ distance = 4.5; \
}; \ }; \
class GVAR(DetachVehicle) { \ class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \ displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ condition = QUOTE(_this call FUNC(canDetach)); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ statement = QUOTE(_this call FUNC(detach) ); \
exceptions[] = {"isNotDragging"}; \ exceptions[] = {}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0.1; \
icon = PATHTOF(UI\detach_ca.paa); \ icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \ distance = 4.5; \
}; \ }; \
}; \ }; \
}; };
@ -55,18 +55,18 @@ class CfgVehicles {
class ACE_Equipment { class ACE_Equipment {
class GVAR(Attach) { class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach"; displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach))); condition = QUOTE(_this call FUNC(canAttach));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions));
exceptions[] = {"isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\attach_ca.paa); icon = PATHTOF(UI\attach_ca.paa);
hotkey = "T"; // hotkey = "T";
}; };
class GVAR(Detach) { class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach"; displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach))); condition = QUOTE(_this call FUNC(canDetach));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) ); statement = QUOTE(_this call FUNC(detach));
exceptions[] = {"isNotDragging"}; exceptions[] = {"isNotDragging"};
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;

View File

@ -0,0 +1,6 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
//If attach placing, stop when opening menu:
["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler);

View File

@ -6,8 +6,7 @@ PREP(attach);
PREP(canAttach); PREP(canAttach);
PREP(canDetach); PREP(canDetach);
PREP(detach); PREP(detach);
PREP(openAttachUI); PREP(getChildrenAttachActions);
PREP(placeApprove); PREP(placeApprove);
PREP(placeCancel);
ADDON = true; ADDON = true;

View File

@ -1,53 +1,54 @@
/* /*
* Author: eRazeri and esteldunedain * Author: eRazeri, esteldunedain, PabstMirror
* Attach an item to the unit * Attach an item to the unit
* *
* Arguments: * Arguments:
* 0: unit doing the attach (player) <OBJECT> * 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT> * 1: unit doing the attach (player) <OBJECT>
* 2: Name of the attachable item <STRING> * 2: Array containing a string of the attachable item <ARRAY>
* *
* Return Value: * Return Value:
* Nothing * Nothing
* *
* Example: * Example:
* Nothing * [bob, bob, ["light"]] call ace_attach_fnc_attach;
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_itemName); private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"];
PARAMS_3(_attachToVehicle,_unit,_args);
_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam;
//Sanity Check (_unit has item in inventory, not over attach limit) //Sanity Check (_unit has item in inventory, not over attach limit)
if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");}; if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"];
_itemVehClass = ""; _itemVehClass = "";
_onAtachText = ""; _onAtachText = "";
_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; _selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"];
switch (true) do { switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item"): { case (_itemClassname == "ACE_IR_Strobe_Item"): {
_itemVehClass = "ACE_IR_Strobe_Effect"; _itemVehClass = "ACE_IR_Strobe_Effect";
_onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached"; _onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached";
//_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri //_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri
}; };
case (_itemName == "B_IR_Grenade"): { case (_itemClassname == "B_IR_Grenade"): {
_itemVehClass = "B_IRStrobe"; _itemVehClass = "B_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
}; };
case (_itemName == "O_IR_Grenade"): { case (_itemClassname == "O_IR_Grenade"): {
_itemVehClass = "O_IRStrobe"; _itemVehClass = "O_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
}; };
case (_itemName == "I_IR_Grenade"): { case (_itemClassname == "I_IR_Grenade"): {
_itemVehClass = "I_IRStrobe"; _itemVehClass = "I_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
}; };
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemName; _itemVehClass = _itemClassname;
_onAtachText = localize "STR_ACE_Attach_Chemlight_Attached"; _onAtachText = localize "STR_ACE_Attach_Chemlight_Attached";
}; };
}; };
@ -55,36 +56,50 @@ switch (true) do {
if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");}; if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");};
if (_unit == _attachToVehicle) then { //Self Attachment if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeItem _itemName; // Remove item _unit removeItem _itemClassname; // Remove item
_attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo _selfAttachPosition; _attachedItem attachTo _selfAttachPosition;
[_onAtachText] call EFUNC(common,displayTextStructured); [_onAtachText] call EFUNC(common,displayTextStructured);
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true]; _attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true]; _attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true];
} else { } else {
GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000]; GVAR(placeAction) = -1;
GVAR(setupObject) enableSimulationGlobal false;
GVAR(SetupPlacmentText) = _onAtachText; _tempObject = _itemVehClass createVehicleLocal [0,0,-10000];
GVAR(SetupPlacmentItem) = _itemName; _tempObject enableSimulationGlobal false;
GVAR(SetupAttachVehicle) = _attachToVehicle;
GVAR(placer) = _unit;
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); [_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
[QGVAR(PlacementEachFrame),"OnEachFrame", { //MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction")
private "_player"; [{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_player = ACE_player; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)];
//Stop if player switch or player gets to far from vehicle // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)];
if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith {
call FUNC(placeCancel);
};
GVAR(pfeh_running) = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
GVAR(setupObject) setPosATL _pos;
}] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH
//had to delay the mouseHint, not sure why _actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}];
[{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)]; [{
_unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; PARAMS_2(_args,_pfID);
EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID);
if ((GVAR(placeAction) != -1) ||
{_unit != ACE_player} ||
{!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} ||
{!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then {
[_pfID] call CBA_fnc_removePerFrameHandler;
[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
[] call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler);
//[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler);
_unit removeAction _actionID;
if (GVAR(placeAction) == 1) then {
_startingPosition = _tempObject modelToWorld [0,0,0];
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove);
};
deleteVehicle _tempObject;
} else {
_tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));;
};
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
}; };

View File

@ -3,25 +3,28 @@
* Check if a unit can attach a specific item. * Check if a unit can attach a specific item.
* *
* Arguments: * Arguments:
* 0: unit doing the attach (player) <OBJECT> * 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT> * 1: unit doing the attach (player) <OBJECT>
* 2: Name of the attachable item <STRING> * 2: Array empty or containing a string of the attachable item <ARRAY>
* *
* Return Value: * Return Value:
* Boolean <BOOL> * Can Attach <BOOL>
* *
* Example: * Example:
* Nothing * [bob, bob, ["light"]] call ace_attach_fnc_canAttach;
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_item); PARAMS_3(_attachToVehicle,_player,_args);
private ["_attachLimit", "_attachedObjects"]; private ["_itemName", "_attachLimit", "_attachedObjects"];
_attachLimit = [10, 1] select (_unit == _attachToVehicle); _itemName = [_args, 0, ""] call CBA_fnc_defaultParam;
_attachLimit = [6, 1] select (_player == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
canStand _unit && {alive _attachToVehicle} && {count _attachedObjects < _attachLimit} && {_item in (itemsWithMagazines _unit + [""])} _playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot"));
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};

View File

@ -3,20 +3,20 @@
* Check if a unit has an item attached and if it can remove that item. * Check if a unit has an item attached and if it can remove that item.
* *
* Arguments: * Arguments:
* 0: unit doing the detaching (player) <STRING> * 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT> * 1: unit doing the detaching (player) <OBJECT>
* *
* Return Value: * Return Value:
* Boolean <BOOL> * Can Detach <BOOL>
* *
* Example: * Example:
* Nothing * [bob, bob] call ace_attach_fnc_canDetach;
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle); PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_inRange"]; private ["_attachedObjects", "_inRange"];

View File

@ -3,20 +3,20 @@
* Detach an item from a unit * Detach an item from a unit
* *
* Arguments: * Arguments:
* 0: unit doing the attaching (player) <STRING> * 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT> * 1: unit doing the detaching (player) <OBJECT>
* *
* Return Value: * Return Value:
* Nothing * Nothing
* *
* Example: * Example:
* Nothing * [car, bob] call ace_attach_fnc_detach
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle); PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_attachedItems"]; private ["_attachedObjects", "_attachedItems"];

View File

@ -0,0 +1,51 @@
/*
* Author: Garth de Wet (LH), PabstMirror
* Show the ammo counts for a static weapon.
* Called from "insertChildren" on interact_menu
*
* Argument:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
*
* Return value:
* ChildActiosn<ARRAY>
*
* Example:
* [player, player] call ace_attach_fnc_getChildrenAttachActions
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_target,_player);
_listed = [];
_actions = [];
{
if !(_x in _listed) then {
_listed pushBack _x;
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
};
};
} forEach (magazines _player);
{
if !(_x in _listed) then {
_listed pushBack _x;
_item = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
};
};
} forEach (items _player);
_actions

View File

@ -1,66 +0,0 @@
/*
* Author: Garth de Wet (LH)
* Opens the UI for attaching objects.
*
* Arguments:
* 0: unit <STRING>
* 1: target <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
private ["_actions", "_attachables", "_item"];
PARAMS_2(_unit,_target);
GVAR(attachTarget) = _target;
_listed = [];
_attachables = magazines _unit;
_actions = [localize "STR_ACE_Attach_AttachDetach", localize "STR_ACE_Attach_Attach"] call EFUNC(interaction,prepareSelectMenu);
{
if !(_x in _listed) then {
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_actions = [
_actions,
getText(_item >> "displayName"),
getText(_item >> "picture"),
_x
] call EFUNC(interaction,addSelectableItem);
};
_listed pushBack _x;
};
} forEach _attachables;
_attachables = items _unit;
{
if !(_x in _listed) then {
_item = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_actions = [
_actions,
getText(_item >> "displayName"),
getText(_item >> "picture"),
_x
] call EFUNC(interaction,addSelectableItem);
};
_listed pushBack _x;
};
} forEach _attachables;
[
_actions,
{
[ACE_player, GVAR(attachTarget), _this] call FUNC(attach);
call EFUNC(interaction,hideMenu);
},
{
call EFUNC(interaction,hideMenu);
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -1,69 +1,55 @@
/* /*
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH)) * Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Approves placement of the lightObject, scans for an appropriate location and attaches * Approves placement of the lightObject, scans for an appropriate location and attaches
* A player can release the attachObject with it floating in mid-air.
* This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision
* ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD)
* So it does multiple scans at slighly different angles
* This is VERY computationaly intensive, but doesn't happen that often.
* *
* Arguments: * Arguments:
* Nothing * 0: Unit (player) <OBJECT>
* 1: attachToVehicle <OBJECT>
* 2: Item Classname (cfgWeapon/cfgMagazine) <STRING>
* 3: Light Vehicle Classname <STRING>
* 4: On Attach Text <STRING>
* 5: Starting Pos of dummy item <ARRAY>
* *
* Return Value: * Return Value:
* Nothing * Nothing
* *
* Example: * Example:
* Nothing * No
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_distanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_setupObject", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
if (GVAR(pfeh_running)) then {
[QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
_setupObject = GVAR(setupObject);
_setupClassname = typeOf _setupObject;
_itemClassname = GVAR(SetupPlacmentItem);
_placementText = GVAR(SetupPlacmentText);
_attachToVehicle = GVAR(SetupAttachVehicle);
_placer = GVAR(placer);
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;
GVAR(placer) = objNull;
[_placer, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
[_placer, "DefaultAction", _placer getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler);
[_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint);
//A player can release the attachObject with it floating in mid-air.
//This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision
//ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD)
//So it does multiple scans at slighly different angles
//This is VERY computationaly intensive, but doesn't happen that often.
_startingPosition = _setupObject modelToWorld [0,0,0];
_startingOffset = _attachToVehicle worldToModel _startingPosition; _startingOffset = _attachToVehicle worldToModel _startingPosition;
_distanceFromCenter = vectorMagnitude _startingOffset; _startDistanceFromCenter = vectorMagnitude _startingOffset;
_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
_keepGoingCloser = true;
_closeInDistance = 0;
while {_keepGoingCloser} do { _closeInMax = _startDistanceFromCenter;
if (_closeInDistance >= _distanceFromCenter) exitWith {}; _closeInMin = 0;
_closeInDistance = _closeInDistance + 0.01; //10mm each step //Delete Local Placement Object
deleteVehicle _setupObject;
while {(_closeInMax - _closeInMin) > 0.01} do {
_closeInDistance = (_closeInMax + _closeInMin) / 2;
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)]; _endPosTestOffset set [2, (_startingOffset select 2)];
_endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; _endPosTest = _attachToVehicle modelToWorld _endPosTestOffset;
_doesIntersect = false;
{ {
if (_doesIntersect) exitWith {};
_startingPosShifted = _startingPosition vectorAdd _x; _startingPosShifted = _startingPosition vectorAdd _x;
_startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted};
{ {
@ -71,33 +57,37 @@ while {_keepGoingCloser} do {
_endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted};
//Uncomment to see the lazor show, and see how the scanning works: //Uncomment to see the lazor show, and see how the scanning works:
drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]];
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true};
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_keepGoingCloser = false};
} forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]];
} forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]];
if (_doesIntersect) then {
_closeInMax = _closeInDistance;
} else {
_closeInMin = _closeInDistance;
};
}; };
//Delete Local Placement Object _closeInDistance = (_closeInMax + _closeInMin) / 2;
deleteVehicle _setupObject;
//Checks //Checks (too close to center or can't attach)
if ((_closeInDistance >= _distanceFromCenter) || (!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach)))) exitWith { if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith {
TRACE_2("no valid spot found",_closeInDistance,_distanceFromCenter); TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter);
[localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured);
}; };
//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull) //Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull and be useless)
_closeInDistance = (_closeInDistance - 0.0085); _closeInDistance = (_closeInDistance - 0.0085);
//Create New 'real' Object //Create New 'real' Object
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)]; _endPosTestOffset set [2, (_startingOffset select 2)];
_attachedObject = _setupClassname createVehicle (getPos _placer); _attachedObject = _itemVehClass createVehicle (getPos _unit);
_attachedObject attachTo [_attachToVehicle, _endPosTestOffset]; _attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
//Remove Item from inventory //Remove Item from inventory
_placer removeItem _itemClassname; _unit removeItem _itemClassname;
//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames //Add Object to ACE_AttachedObjects and ACE_AttachedItemNames
_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
@ -107,4 +97,4 @@ _currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_currentItemNames pushBack _itemClassname; _currentItemNames pushBack _itemClassname;
_attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true]; _attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true];
[_placementText] call EFUNC(common,displayTextStructured); [_onAtachText] call EFUNC(common,displayTextStructured);

View File

@ -1,35 +0,0 @@
/*
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Cancels placement of the lightObject
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
if (!isNull (GVAR(setupObject))) then {
deleteVehicle GVAR(setupObject);
};
[GVAR(placer), QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
call EFUNC(interaction,hideMouseHint);
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler);
[GVAR(placer), "MenuBack", GVAR(placer) getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler);
GVAR(placer) = objNull;
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;

View File

@ -1,41 +0,0 @@
class CfgAmmo {
/* 6.5x39mm Grendel */
class BulletBase;
class B_65x39_Caseless: BulletBase {
typicalSpeed = 724;
airFriction = -0.000915;
};
/* 5.56x45mm NATO */
class B_556x45_Ball: BulletBase {
typicalSpeed = 911;
airFriction = -0.001335;
};
/* 7.62x51mm NATO */
class B_762x51_Ball: BulletBase {
typicalSpeed = 853;
//airfriction =
};
/* Other */
class B_9x21_Ball;
class B_9x19_Ball: B_9x21_Ball {
typicalSpeed = 381;
airfriction = -0.00213;
};
class B_45ACP_Ball: BulletBase {
typicalSpeed = 250;
airfriction = -0.0009;
};
};

View File

@ -1,65 +0,0 @@
class CfgMagazines {
/* 6.5x39mm Grendel - MX */
class CA_Magazine;
class 30Rnd_65x39_caseless_mag: CA_Magazine {
initSpeed = 724;
};
class 100Rnd_65x39_caseless_mag: CA_Magazine {
initSpeed = 724;
};
/* 6.5x39mm Grendel - Katiba */
class 30Rnd_65x39_caseless_green: 30Rnd_65x39_caseless_mag {
initSpeed = 724;
};
class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag {
initSpeed = 691;
};
/* 5.56x45mm NATO */
class 30Rnd_556x45_Stanag: CA_Magazine {
initSpeed = 911;
};
/* 7.62x51mm NATO */
class 20Rnd_762x51_Mag: CA_Magazine {
initSpeed = 792; // 18" M14 EBR barrel
};
class 150Rnd_762x51_Box: CA_Magazine {
ammo = "B_762x51_Ball";
initSpeed = 853; // Typical MV for M240
};
/* Other */
class 30Rnd_9x21_Mag: CA_Magazine {
ammo = "B_9x19_Ball";
initSpeed = 370;
};
class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag {
ammo = "B_9x19_Ball";
initSpeed = 381;
};
class 30Rnd_45ACP_Mag_SMG_01: 30Rnd_9x21_Mag {
initSpeed = 259;
};
class 9Rnd_45ACP_Mag: 30Rnd_45ACP_Mag_SMG_01 {
initSpeed = 250;
};
};

View File

@ -12,7 +12,5 @@ class CfgPatches {
}; };
}; };
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"

View File

@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers {
}; };
}; };
}; };
//make sure captiveNum is reset on respawn
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE(_this call FUNC(handleRespawn));
};
};
};

View File

@ -39,6 +39,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
interpolationRestart = 2; interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
}; };
class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
@ -63,6 +64,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
interpolationRestart = 2; interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
}; };
class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon";
@ -80,4 +82,3 @@ class CfgMovesMaleSdr: CfgMovesBasic {
}; };
}; };
}; };

View File

@ -21,6 +21,7 @@ PREP(handleGetOut);
PREP(handleKilled); PREP(handleKilled);
PREP(handleOnUnconscious); PREP(handleOnUnconscious);
PREP(handlePlayerChanged); PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost); PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged); PREP(handleZeusDisplayChanged);
PREP(moduleSurrender); PREP(moduleSurrender);

View File

@ -18,7 +18,7 @@
PARAMS_1(_oldUnit); PARAMS_1(_oldUnit);
if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then {
_oldUnit setVariable [QGVAR(isHandcuffed), false, true]; [_oldUnit, false] call FUNC(setSurrendered);
}; };
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
@ -26,5 +26,5 @@ if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
}; };
if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then { if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then {
_oldUnit setVariable [QGVAR(isSurrendering), false, true]; [_oldUnit, false] call FUNC(setSurrendered);
}; };

View File

@ -0,0 +1,39 @@
/*
* Author: commy2 PabstMirror
* Fix, because captiveNum doesn't reset properly on respawn
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [alive, body] call ACE_captives_fnc_handleRespawn;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_dead);
if (!local _unit) exitWith {};
//With respawn="group", we could be respawning into a unit that is handcuffed/captive
//If they are, reset and rerun the SET function
//if not, make sure to explicity disable the setCaptivityStatus, because captiveNum does not work correctly on respawn
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
_unit setVariable [QGVAR(isHandcuffed), false];
[_unit, true] call FUNC(setHandcuffed);
} else {
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
[_unit, true] call FUNC(setSurrendered);
} else {
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
};

View File

@ -75,6 +75,7 @@ if (_state) then {
}; };
}; };
if (!alive _unit) exitWith {};
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
//if we are in "hands up" animationState, crack it now //if we are in "hands up" animationState, crack it now

View File

@ -34,6 +34,7 @@ if (hasInterface) then {
}] call FUNC(addEventhandler); }] call FUNC(addEventhandler);
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
// hack to get PFH to work in briefing // hack to get PFH to work in briefing
[QGVAR(onBriefingPFH), "onEachFrame", { [QGVAR(onBriefingPFH), "onEachFrame", {
@ -174,13 +175,15 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
["VehicleSetFuel", {
PARAMS_2(_vehicle,_fuelLevel);
_vehicle setFuel _fuelLevel;
}] call FUNC(addEventhandler);
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition); ["isNotInside", {
// Players can always interact with himself if not boarded
vehicle (_this select 0) == (_this select 0) ||
// Players can always interact with his vehicle
{vehicle (_this select 0) == (_this select 1)} ||
// Players can always interact with passengers of the same vehicle
{!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}}
}] call FUNC(addCanInteractWithCondition);

View File

@ -57,6 +57,8 @@ PREP(getAllGear);
PREP(getCaptivityStatus); PREP(getCaptivityStatus);
PREP(getConfigCommander); PREP(getConfigCommander);
PREP(getConfigGunner); PREP(getConfigGunner);
PREP(getConfigType);
PREP(getConfigTypeObject);
PREP(getDeathAnim); PREP(getDeathAnim);
PREP(getDefaultAnim); PREP(getDefaultAnim);
PREP(getDefinedVariable); PREP(getDefinedVariable);
@ -70,6 +72,8 @@ PREP(getGunner);
PREP(getHitPoints); PREP(getHitPoints);
PREP(getHitPointsWithSelections); PREP(getHitPointsWithSelections);
PREP(getInPosition); PREP(getInPosition);
PREP(getItemType);
PREP(getItemTypeWeapon);
PREP(getMarkerType); PREP(getMarkerType);
PREP(getName); PREP(getName);
PREP(getNumberFromMissionSQM); PREP(getNumberFromMissionSQM);
@ -95,6 +99,9 @@ PREP(getVehicleCrew);
PREP(getVersion); PREP(getVersion);
PREP(getWeaponAzimuthAndInclination); PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex); PREP(getWeaponIndex);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(getWeaponState);
PREP(getWeaponType); PREP(getWeaponType);
PREP(getWindDirection); PREP(getWindDirection);
PREP(goKneeling); PREP(goKneeling);

View File

@ -0,0 +1,24 @@
/*
* Author: commy2
*
* What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses
*
* Argument:
* 0: A item's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"};
if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"};
if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"};
""

View File

@ -0,0 +1,22 @@
/*
* Author: commy2
*
* What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo
*
* Argument:
* 0: An object's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_object";
_object = _this select 0;
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"};
if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"};
""

View File

@ -0,0 +1,29 @@
/*
* Author: commy2
*
* What kind of item is given classname
*
* Argument:
* 0: Classname of a item. (String)
*
* Return value:
* Item type. (Array)
* 0: "weapon", "item", "magazine", "unknown" or "" (String)
* 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item)
*
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
_cfgType = [_item] call FUNC(getConfigType);
if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]};
if (_cfgType == "CfgMagazines") exitWith { ["magazine", [_item] call FUNC(getItemTypeWeapon) select 1] };
if (_cfgType == "CfgWeapons") exitWith { [_item] call FUNC(getItemTypeWeapon) };
["",""]

View File

@ -0,0 +1,74 @@
/*
* Author: commy2
*
* What kind of item is given classname. Has to be a CfgWeapons. Undefined behavior for CfgMagazine.
*
* Argument:
* 0: Classname of a CfgWeapon. (String)
*
* Return value:
* See ace_common_fnc_getItemType
*
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
private "_config";
_config = configFile >> [_item] call FUNC(getConfigType) >> _item;
if (!isClass _config) exitWith {["",""]};
private "_type";
_type = getNumber (_config >> "type");
if (isNumber (_config >> "ItemInfo" >> "type")) then {
_type = getNumber (_config >> "ItemInfo" >> "type");
};
switch (true) do {
case (_type == 0): {["unknown","unknown"]};
case (_type == 2^0): {["weapon","primary"]};
case (_type == 2^1): {["weapon","handgun"]};
case (_type == 2^2): {["weapon","secondary"]};
case (_type < 2^4): {["weapon","unknown"]};
case (_type == 2^4): {["magazine","handgun"]}; // handgun
case (_type == 2^8): {["magazine","primary"]}; // rifle
case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines
case (_type == 768): {["magazine","secondary"]}; // NLAW
case (_type == 1536): {["magazine","secondary"]}; // titan
case (_type == 101): {["item","muzzle"]};
case (_type == 201): {["item","optics"]};
case (_type == 301): {["item","flashlight"]};
case (_type == 302): {["item","under"]}; // czech for bipod item
case (_type == 401): {["item","first_aid_kit"]};
case (_type == 501): {["item","fins"]}; // not implemented
case (_type == 601): {["item","breathing_bomb"]}; // not implemented
case (_type == 603): {["item","goggles"]};
case (_type == 604): {["item","scuba"]}; // not implemented
case (_type == 605): {["item","headgear"]};
case (_type == 611): {["item","radio"]};
case (_type == 616): {["item","hmd"]};
case (_type == 617): {["item","binocular"]};
case (_type == 619): {["item","medikit"]};
case (_type == 620): {["item","toolkit"]};
case (_type == 621): {["item","uav_terminal"]};
case (_type == 701): {["item","vest"]};
case (_type == 801): {["item","uniform"]};
case (_type == 2^12): {
switch (toLower getText (_config >> "simulation")) do {
case ("binocular"): {["weapon","binocular"]};
case ("nvgoggles"): {["item","nvgoggles"]};
case ("itemminedetector"): {["item","minedetector"]};
default {["weapon","unknown"]};
};
};
case (_type == 2^16): {["weapon","vehicle"]};
case (_type == 2^17): {["item","unknown"]}; // ???
default {["item","unknown"]};
};

View File

@ -0,0 +1,73 @@
/*
* Author: commy2
*
* Return current state of the weapon. Attachments and magazines with ammo.
*
* Argument:
* 0: A unit (Object)
* 1: A weapon (String)
*
* Return value:
* Weapon info, format: [attachments, muzzles, magazines, ammo] (Array)
*/
#include "script_component.hpp"
private ["_unit", "_weapon"];
_unit = _this select 0;
_weapon = _this select 1;
private "_muzzles";
_muzzles = [_weapon] call FUNC(getWeaponMuzzles);
private "_weaponInfo";
_weaponInfo = [];
switch (_weapon) do {
case (primaryWeapon _unit): {
_weaponInfo pushBack primaryWeaponItems _unit;
};
case (secondaryWeapon _unit): {
_weaponInfo pushBack secondaryWeaponItems _unit;
};
case (handgunWeapon _unit): {
_weaponInfo pushBack handgunItems _unit;
};
default {
_weaponInfo pushBack ["","","",""];
};
};
// get loaded magazines and ammo
private ["_magazines", "_ammo"];
_magazines = [];
_ammo = [];
{
_magazines pushBack "";
_ammo pushBack 0;
} forEach _muzzles;
{
if (_x select 2) then {
private "_index";
_index = _muzzles find (_x select 4);
if (_index != -1) then {
_magazines set [_index, _x select 0];
_ammo set [_index, _x select 1];
};
};
} forEach magazinesAmmoFull _unit;
_weaponInfo append [_muzzles, _magazines, _ammo];
_weaponInfo

View File

@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// drop if the crate is destroyed // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if !([_target] call EFUNC(common,isAlive)) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject_carry); [_unit, _target] call FUNC(dropObject_carry);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// drop if the crate is destroyed // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if !([_target] call EFUNC(common,isAlive)) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -22,8 +22,8 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
if (_unit getVariable [QGVAR(isCarrying), false]) then { if (_unit getVariable [QGVAR(isCarrying), false]) then {
// drop carried object when not standing // drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND") then { if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private "_carriedObject"; private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];

View File

@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// same as dragObjectPFH, checks if object is deleted or dead. // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if !([_target] call EFUNC(common,isAlive)) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// same as dragObjectPFH, checks if object is deleted or dead. // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if !([_target] call EFUNC(common,isAlive)) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -3,7 +3,7 @@
["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", ["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
{ {
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
@ -20,7 +20,7 @@
GVAR(isDownStateKey1) = false; GVAR(isDownStateKey1) = false;
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
@ -33,7 +33,7 @@
["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", ["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
{ {
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
@ -47,7 +47,7 @@
["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
{ {
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};

View File

@ -13,7 +13,7 @@
* The entry full path, which can be used to remove the entry, or add children entries <ARRAY>. * The entry full path, which can be used to remove the entry, or add children entries <ARRAY>.
* *
* Example: * Example:
* [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; * [cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToObject;
* *
* Public: No * Public: No
*/ */

View File

@ -43,7 +43,7 @@ _recurseFnc = {
if (_condition == "") then {_condition = "true"}; if (_condition == "") then {_condition = "true"};
// Add canInteract (including exceptions) and canInteractWith to condition // Add canInteract (including exceptions) and canInteractWith to condition
_condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")];
_insertChildren = compile (getText (_entryCfg >> "insertChildren")); _insertChildren = compile (getText (_entryCfg >> "insertChildren"));
@ -79,18 +79,29 @@ _recurseFnc = {
private "_actionsCfg"; private "_actionsCfg";
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
private ["_baseDisplayName", "_baseIcon"];
_baseDisplayName = "";
_baseIcon = "";
if (_objectType isKindOf "CAManBase") then {
_baseDisplayName = "Self Actions";
_baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
} else {
_baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName");
_baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon");
};
// Create a master action to base on self action // Create a master action to base on self action
_actions = [ _actions = [
[ [
[ [
"ACE_SelfActions", "ACE_SelfActions",
"Self Actions", _baseDisplayName,
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", _baseIcon,
{ {
// Dummy statement so it's not collapsed when there's no available actions // Dummy statement so it's not collapsed when there's no available actions
true true
}, },
{[ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)},
{}, {},
[], [],
"Spine3", "Spine3",

View File

@ -19,7 +19,7 @@
* Action <ARRAY> * Action <ARRAY>
* *
* Example: * Example:
* [VulcanPinch","Vulcan Pinch",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; * [VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
* *
* Public: No * Public: No
*/ */

View File

@ -15,6 +15,10 @@
// Exit if there's no menu opened // Exit if there's no menu opened
if (GVAR(openedMenuType) < 0) exitWith {true}; if (GVAR(openedMenuType) < 0) exitWith {true};
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
closeDialog 0;
};
if(GVAR(actionSelected)) then { if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget); this = GVAR(selectedTarget);
@ -40,10 +44,6 @@ GVAR(keyDown) = false;
GVAR(keyDownSelfAction) = false; GVAR(keyDownSelfAction) = false;
GVAR(openedMenuType) = -1; GVAR(openedMenuType) = -1;
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
closeDialog 0;
};
GVAR(expanded) = false; GVAR(expanded) = false;
GVAR(lastPath) = []; GVAR(lastPath) = [];
GVAR(menuDepthPath) = []; GVAR(menuDepthPath) = [];

View File

@ -38,7 +38,7 @@ _fnc_renderNearbyActions = {
// Only render them directly if they are base level actions // Only render them directly if they are base level actions
if (count (_x select 1) == 0) then { if (count (_x select 1) == 0) then {
// Try to render the menu // Try to render the menu
_action = [_x,[]]; _action = _x;
if ([_target, _action] call FUNC(renderBaseMenu)) then { if ([_target, _action] call FUNC(renderBaseMenu)) then {
_numInteractions = _numInteractions + 1; _numInteractions = _numInteractions + 1;
}; };

View File

@ -24,7 +24,7 @@ _onFinish = {
EXPLODE_2_PVT((_this select 0),_caller,_target); EXPLODE_2_PVT((_this select 0),_caller,_target);
_caller removeItem "ACE_UAVBattery"; _caller removeItem "ACE_UAVBattery";
playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10];
["VehicleSetFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local
}; };
_onFailure = { _onFailure = {

View File

@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if (((getPosASL ace_player) distance _setPosition) > 5) then { if (((getPosASL ace_player) distance _setPosition) > 5) then {
_fncStatement = { _fncStatement = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; PARAMS_3(_dummyTarget,_player,_attachedFence);
[ace_player, _attachedFence] call FUNC(cutDownFence); [_player, _attachedFence] call FUNC(cutDownFence);
}; };
_fncCondition = { _fncCondition = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; PARAMS_3(_dummyTarget,_player,_attachedFence);
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))}) ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))})
}; };
{ {
@ -53,10 +53,10 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if ([_x] call FUNC(isFence)) then { if ([_x] call FUNC(isFence)) then {
_fencesHelped pushBack _x; _fencesHelped pushBack _x;
_helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x);
[_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction); _action = [QGVAR(helperCutFence), (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction);
[_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject);
_helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
_helper hideObject true; _helper hideObject true;
_helper setVariable [QGVAR(attachedFence), _x];
_addedHelpers pushBack _helper; _addedHelpers pushBack _helper;
}; };
}; };

View File

@ -11,7 +11,7 @@
<Czech>Přepáskovat&lt;br/&gt;Zásobníky</Czech> <Czech>Přepáskovat&lt;br/&gt;Zásobníky</Czech>
<Italian>Ricarica&lt;br/&gt;Caricatori</Italian> <Italian>Ricarica&lt;br/&gt;Caricatori</Italian>
<Portuguese>Reorganizar&lt;br/&gt;Carregadores</Portuguese> <Portuguese>Reorganizar&lt;br/&gt;Carregadores</Portuguese>
<Hungarian>Újratárazás<&lt;br/&gt;Hungarian> <Hungarian>Újratárazás&lt;br/&gt;</Hungarian>
<Russian>Перепаковать&lt;br/&gt;магазины</Russian> <Russian>Перепаковать&lt;br/&gt;магазины</Russian>
</Key> </Key>
<Key ID="STR_ACE_MagazineRepack_SelectMagazineMenu"> <Key ID="STR_ACE_MagazineRepack_SelectMagazineMenu">

View File

@ -230,7 +230,7 @@ class CfgWeapons {
class muzzle_snds_H: ItemCore { class muzzle_snds_H: ItemCore {
class ItemInfo: InventoryMuzzleItem_Base_F { class ItemInfo: InventoryMuzzleItem_Base_F {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -263,7 +263,7 @@ class CfgWeapons {
class muzzle_snds_L: muzzle_snds_H { class muzzle_snds_L: muzzle_snds_H {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -296,7 +296,7 @@ class CfgWeapons {
class muzzle_snds_M: muzzle_snds_H { class muzzle_snds_M: muzzle_snds_H {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -329,7 +329,7 @@ class CfgWeapons {
class muzzle_snds_B: muzzle_snds_H { class muzzle_snds_B: muzzle_snds_H {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -362,7 +362,7 @@ class CfgWeapons {
class muzzle_snds_H_MG: muzzle_snds_H { class muzzle_snds_H_MG: muzzle_snds_H {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -395,7 +395,7 @@ class CfgWeapons {
class muzzle_snds_H_SW: muzzle_snds_H_MG { class muzzle_snds_H_SW: muzzle_snds_H_MG {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {
@ -428,7 +428,73 @@ class CfgWeapons {
class muzzle_snds_acp: muzzle_snds_H { class muzzle_snds_acp: muzzle_snds_H {
class ItemInfo: ItemInfo { class ItemInfo: ItemInfo {
class MagazineCoef { class MagazineCoef {
initSpeed = 1.0; initSpeed = 1.05;
};
class AmmoCoef {
hit = 0.9;
visibleFire = 0.5;
audibleFire = 0.1;
visibleFireTime = 0.5;
audibleFireTime = 0.5;
cost = 1.0;
typicalSpeed = 1.0;
airFriction = 1.0;
};
class MuzzleCoef {
dispersionCoef = "0.8f";
artilleryDispersionCoef = "1.0f";
fireLightCoef = "0.5f";
recoilCoef = "1.0f";
recoilProneCoef = "1.0f";
minRangeCoef = "1.0f";
minRangeProbabCoef = "1.0f";
midRangeCoef = "1.0f";
midRangeProbabCoef = "1.0f";
maxRangeCoef = "1.0f";
maxRangeProbabCoef = "1.0f";
};
};
};
class muzzle_snds_338_black: ItemCore {
class ItemInfo: InventoryMuzzleItem_Base_F {
class MagazineCoef {
initSpeed = 1.05;
};
class AmmoCoef {
hit = 0.9;
visibleFire = 0.5;
audibleFire = 0.1;
visibleFireTime = 0.5;
audibleFireTime = 0.5;
cost = 1.0;
typicalSpeed = 1.0;
airFriction = 1.0;
};
class MuzzleCoef {
dispersionCoef = "0.8f";
artilleryDispersionCoef = "1.0f";
fireLightCoef = "0.5f";
recoilCoef = "1.0f";
recoilProneCoef = "1.0f";
minRangeCoef = "1.0f";
minRangeProbabCoef = "1.0f";
midRangeCoef = "1.0f";
midRangeProbabCoef = "1.0f";
maxRangeCoef = "1.0f";
maxRangeProbabCoef = "1.0f";
};
};
};
class muzzle_snds_93mmg: ItemCore {
class ItemInfo: InventoryMuzzleItem_Base_F {
class MagazineCoef {
initSpeed = 1.05;
}; };
class AmmoCoef { class AmmoCoef {

View File

@ -294,3 +294,10 @@ class V_Press_F: Vest_Camo_Base {
/*passThrough = 1;*/ /*passThrough = 1;*/
}; };
}; };
// marksman dlc
/*class V_PlateCarrierGL_blk: V_PlateCarrierGL_rgr {};
class V_PlateCarrierGL_mtp: V_PlateCarrierGL_rgr {};
class V_PlateCarrierSpec_blk: V_PlateCarrierSpec_rgr {};
class V_PlateCarrierSpec_mtp: V_PlateCarrierSpec_rgr {};
class V_PlateCarrierIAGL_oli: V_PlateCarrierIAGL_dgtl {};*/

View File

@ -552,4 +552,85 @@ class CfgVehicles {
class Weapon_srifle_DMR_01_F: Weapon_Base_F { class Weapon_srifle_DMR_01_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name";
}; };
// marksmen
/*class Weapon_srifle_DMR_02_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02";
};
class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo";
};
class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper";
};
class Weapon_srifle_DMR_03_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03";
};
class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki";
};
class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan";
};
class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam";
};
class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland";
};
class Weapon_srifle_DMR_04_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_04";
};
class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan";
};
class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk";
};
class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex";
};
class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan";
};
class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo";
};
class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive";
};
class Weapon_MMG_01_hex_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_01_hex";
};
class Weapon_MMG_01_tan_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_01_tan";
};
class Weapon_MMG_02_camo_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_camo";
};
class Weapon_MMG_02_black_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_black";
};
class Weapon_MMG_02_sand_F: Weapon_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_sand";
};*/
}; };

View File

@ -192,6 +192,120 @@ class CfgWeapons {
displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name";
}; };
// marksmen marksman
/*class DMR_02_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_DMR_02"; //MAR-10 .338";
};
class srifle_DMR_02_F: DMR_02_base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; //MAR-10 .338 (Black)";
};
class srifle_DMR_02_camo_F: srifle_DMR_02_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; //MAR-10 .338 (Camo)";
};
class srifle_DMR_02_sniper_F: srifle_DMR_02_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; //MAR-10 .338 (Sand)";
};
class DMR_03_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_DMR_03"; //Mk-I EMR 7.62 mm";
};
class srifle_DMR_03_F: DMR_03_base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; //Mk-I EMR 7.62 mm (Black)";
};
class srifle_DMR_03_khaki_F: srifle_DMR_03_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; //Mk-I EMR 7.62 mm (Khaki)";
};
class srifle_DMR_03_tan_F: srifle_DMR_03_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; //Mk-I EMR 7.62 mm (Sand)";
};
class srifle_DMR_03_multicam_F: srifle_DMR_03_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; //Mk-I EMR 7.62 mm (Camo)";
};
class srifle_DMR_03_woodland_F: srifle_DMR_03_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; //Mk-I EMR 7.62 mm (Woodland)";
};
class srifle_DMR_03_spotter_F: srifle_DMR_03_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_spotter"; //NATO DMR (provisional) spotter";
};
class DMR_04_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_DMR_04"; //ASP-1 Kir 12.7 mm";
};
class srifle_DMR_04_F: DMR_04_base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; //ASP-1 Kir 12.7 mm (Black)";
};
class srifle_DMR_04_Tan_F: srifle_DMR_04_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; //ASP-1 Kir 12.7 mm (Tan)";
};
class DMR_05_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_DMR_05"; //Cyrus 9.3 mm";
};
class srifle_DMR_05_blk_F: DMR_05_base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; //Cyrus 9.3 mm (Black)
};
class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; //Cyrus 9.3 mm (Hex)";
};
class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; //Cyrus 9.3 mm (Tan)";
};
class DMR_06_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_DMR_06"; //Mk14 7.62 mm";
};
class srifle_DMR_06_camo_F: DMR_06_base_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; //Mk14 7.62 mm (Camo)
};
class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F {
displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; //Mk14 7.62 mm (Olive)";
};
// marksmen mgs
class MMG_01_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_01"; //Navid 9.3 mm";
};
class MMG_01_hex_F: MMG_01_base_F {
displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; //Navid 9.3 mm (Hex)";
};
class MMG_01_tan_F: MMG_01_hex_F {
displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; //Navid 9.3 mm (Tan)";
};
class MMG_02_base_F: Rifle_Long_Base_F {
displayName = "$STR_ACE_RealisticNames_MMG_02"; //SPMG .338";
};
class MMG_02_camo_F: MMG_02_base_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; //SPMG .338 (MTP)";
};
class MMG_02_black_F: MMG_02_camo_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_black"; //SPMG .338 (Black)";
};
class MMG_02_sand_F: MMG_02_camo_F {
displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; //SPMG .338 (Sand)";
};*/
// vehicle weapons // vehicle weapons
// gatlings // gatlings

View File

@ -1214,5 +1214,97 @@
<English>VS-121</English> <English>VS-121</English>
<German>VS-121</German> <German>VS-121</German>
</Key> </Key>
<Key ID="STR_ACE_RealisticNames_DMR_02">
<English>TODO: MAR-10 .338</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_02">
<English>TODO: MAR-10 .338 (Black)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_02_camo">
<English>TODO: MAR-10 .338 (Camo)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_02_sniper">
<English>TODO: MAR-10 .338 (Sand)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_DMR_03">
<English>TODO: Mk-I EMR 7.62 mm</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03">
<English>TODO: Mk-I EMR 7.62 mm (Black)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03_khaki">
<English>TODO: Mk-I EMR 7.62 mm (Khaki)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03_tan">
<English>TODO: Mk-I EMR 7.62 mm (Sand)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03_multicam">
<English>TODO: Mk-I EMR 7.62 mm (Camo)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03_woodland">
<English>TODO: Mk-I EMR 7.62 mm (Woodland)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_03_spotter">
<English>TODO: NATO DMR (provisional) spotter</English>
</Key>
<Key ID="STR_ACE_RealisticNames_DMR_04">
<English>TODO: ASP-1 Kir 12.7 mm</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_04">
<English>TODO: ASP-1 Kir 12.7 mm (Black)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_04_Tan">
<English>TODO: ASP-1 Kir 12.7 mm (Tan)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_DMR_05">
<English>TODO: Cyrus 9.3 mm</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_05_blk">
<English>TODO: Cyrus 9.3 mm (Black)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_05_hex">
<English>TODO: Cyrus 9.3 mm (Hex)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_05_tan">
<English>TODO: Cyrus 9.3 mm (Tan)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_DMR_06">
<English>TODO: Mk14 7.62 mm</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_06_camo">
<English>TODO: Mk14 7.62 mm (Camo)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_srifle_DMR_06_olive">
<English>TODO: Mk14 7.62 mm (Olive)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_01">
<English>TODO: Navid 9.3 mm</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_01_hex">
<English>TODO: Navid 9.3 mm (Hex)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_01_tan">
<English>TODO: Navid 9.3 mm (Tan)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_02">
<English>TODO: SPMG .338</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_02_camo">
<English>TODO: SPMG .338 (MTP)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_02_black">
<English>TODO: SPMG .338 (Black)</English>
</Key>
<Key ID="STR_ACE_RealisticNames_MMG_02_sand">
<English>TODO: SPMG .338 (Sand)</English>
</Key>
</Package> </Package>
</Project> </Project>

View File

@ -8,8 +8,6 @@ PREP(findNextGrenadeMagazine);
PREP(findNextGrenadeMuzzle); PREP(findNextGrenadeMuzzle);
PREP(fireSmokeLauncher); PREP(fireSmokeLauncher);
PREP(getSelectedGrenade); PREP(getSelectedGrenade);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(playChangeFiremodeSound); PREP(playChangeFiremodeSound);
PREP(putWeaponAway); PREP(putWeaponAway);
PREP(selectGrenadeAll); PREP(selectGrenadeAll);

View File

@ -29,8 +29,8 @@ if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith
private ["_muzzles", "_modes"]; private ["_muzzles", "_modes"];
_muzzles = [_weapon] call FUNC(getWeaponMuzzles); _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles);
_modes = [_weapon] call FUNC(getWeaponModes); _modes = [_weapon] call EFUNC(common,getWeaponModes);
private ["_index", "_muzzle", "_mode"]; private ["_index", "_muzzle", "_mode"];

View File

@ -19,7 +19,7 @@ _weapon = _this select 1;
if (_weapon == "") exitWith {}; if (_weapon == "") exitWith {};
private "_muzzles"; private "_muzzles";
_muzzles = [_weapon] call FUNC(getWeaponMuzzles); _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles);
if (currentWeapon _unit != _weapon) exitWith { if (currentWeapon _unit != _weapon) exitWith {
if (count _muzzles > 1) then { if (count _muzzles > 1) then {