Merge branch 'master' into serverConfig

This commit is contained in:
Glowbal 2015-04-04 23:00:47 +02:00
commit 044d2551ce
168 changed files with 4202 additions and 1616 deletions

View File

@ -6,12 +6,22 @@
# request, preferably including an email address.
# CORE TEAM
bux578 <github@jonathandavid.de>
commy2
esteldunedain <nicolas.d.badano@gmail.com>
Felix Wiegand <koffeinflummi@gmail.com>
Garth "L-H" de Wet <garthofhearts@gmail.com>
bux578 <github@jonathandavid.de>
Giallustio
Glowbal
Janus
Kieran
NouberNou
PabstMirror <pabstmirror@gmail.com>
Ruthberg
tpM
ViperMaul
VKing <kauestad@gmail.com>
Walter Pearce <jaynus@gmail.com>
# CONTRIBUTORS
11RDP-LoupVert <loupvert@11rdp.fr>

View File

@ -1,6 +1,10 @@
class Extended_PreInit_EventHandlers {
class ADDON {
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 GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"isNotDragging"}; \
condition = QUOTE(_this call FUNC(canAttach)); \
insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \
exceptions[] = {}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \
distance = 4.5; \
}; \
class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"isNotDragging"}; \
condition = QUOTE(_this call FUNC(canDetach)); \
statement = QUOTE(_this call FUNC(detach) ); \
exceptions[] = {}; \
showDisabled = 0; \
priority = 0; \
priority = 0.1; \
icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
distance = 4.5; \
}; \
}; \
};
@ -55,18 +55,18 @@ class CfgVehicles {
class ACE_Equipment {
class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
condition = QUOTE(_this call FUNC(canAttach));
insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions));
exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
hotkey = "T";
// hotkey = "T";
};
class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
condition = QUOTE(_this call FUNC(canDetach));
statement = QUOTE(_this call FUNC(detach));
exceptions[] = {"isNotDragging"};
showDisabled = 0;
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(canDetach);
PREP(detach);
PREP(openAttachUI);
PREP(getChildrenAttachActions);
PREP(placeApprove);
PREP(placeCancel);
ADDON = true;

View File

@ -1,53 +1,54 @@
/*
* Author: eRazeri and esteldunedain
* Author: eRazeri, esteldunedain, PabstMirror
* Attach an item to the unit
*
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
* 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: unit doing the attach (player) <OBJECT>
* 2: Array containing a string of the attachable item <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
* [bob, bob, ["light"]] call ace_attach_fnc_attach;
*
* Public: No
*/
#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)
if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");};
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"];
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
_itemVehClass = "";
_onAtachText = "";
_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"];
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item"): {
case (_itemClassname == "ACE_IR_Strobe_Item"): {
_itemVehClass = "ACE_IR_Strobe_Effect";
_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
};
case (_itemName == "B_IR_Grenade"): {
case (_itemClassname == "B_IR_Grenade"): {
_itemVehClass = "B_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "O_IR_Grenade"): {
case (_itemClassname == "O_IR_Grenade"): {
_itemVehClass = "O_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "I_IR_Grenade"): {
case (_itemClassname == "I_IR_Grenade"): {
_itemVehClass = "I_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemName;
case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemClassname;
_onAtachText = localize "STR_ACE_Attach_Chemlight_Attached";
};
};
@ -55,36 +56,50 @@ switch (true) do {
if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");};
if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeItem _itemName; // Remove item
_unit removeItem _itemClassname; // Remove item
_attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo _selfAttachPosition;
[_onAtachText] call EFUNC(common,displayTextStructured);
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true];
} else {
GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000];
GVAR(setupObject) enableSimulationGlobal false;
GVAR(SetupPlacmentText) = _onAtachText;
GVAR(SetupPlacmentItem) = _itemName;
GVAR(SetupAttachVehicle) = _attachToVehicle;
GVAR(placer) = _unit;
GVAR(placeAction) = -1;
_tempObject = _itemVehClass createVehicleLocal [0,0,-10000];
_tempObject enableSimulationGlobal false;
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
[QGVAR(PlacementEachFrame),"OnEachFrame", {
private "_player";
_player = ACE_player;
//Stop if player switch or player gets to far from vehicle
if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith {
call FUNC(placeCancel);
//MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction")
[{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)];
// _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)];
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}];
[{
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]));;
};
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
[{[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)];
}, 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.
*
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
* 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: unit doing the attach (player) <OBJECT>
* 2: Array empty or containing a string of the attachable item <ARRAY>
*
* Return Value:
* Boolean <BOOL>
* Can Attach <BOOL>
*
* Example:
* Nothing
* [bob, bob, ["light"]] call ace_attach_fnc_canAttach;
*
* Public: No
*/
#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), []];
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.
*
* Arguments:
* 0: unit doing the detaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: unit doing the detaching (player) <OBJECT>
*
* Return Value:
* Boolean <BOOL>
* Can Detach <BOOL>
*
* Example:
* Nothing
* [bob, bob] call ace_attach_fnc_canDetach;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle);
PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_inRange"];

View File

@ -3,20 +3,20 @@
* Detach an item from a unit
*
* Arguments:
* 0: unit doing the attaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: unit doing the detaching (player) <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
* [car, bob] call ace_attach_fnc_detach
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle);
PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_attachedItems"];
@ -74,13 +74,13 @@ _attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true];
// Display message
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item") : {
case (_itemName == "ACE_IR_Strobe_Item") : {
[localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured);
};
case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : {
case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : {
[localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured);
};
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : {
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : {
[localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured);
};
};

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))
* 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:
* 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:
* Nothing
*
* Example:
* Nothing
* No
*
* Public: No
*/
#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;
_distanceFromCenter = vectorMagnitude _startingOffset;
_startDistanceFromCenter = vectorMagnitude _startingOffset;
_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
_keepGoingCloser = true;
_closeInDistance = 0;
while {_keepGoingCloser} do {
if (_closeInDistance >= _distanceFromCenter) exitWith {};
_closeInMax = _startDistanceFromCenter;
_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 set [2, (_startingOffset select 2)];
_endPosTest = _attachToVehicle modelToWorld _endPosTestOffset;
_doesIntersect = false;
{
if (_doesIntersect) exitWith {};
_startingPosShifted = _startingPosition vectorAdd _x;
_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};
//Uncomment to see the lazor show, and see how the scanning works:
drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]];
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_keepGoingCloser = false};
// drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]];
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true};
} 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]];
if (_doesIntersect) then {
_closeInMax = _closeInDistance;
} else {
_closeInMin = _closeInDistance;
};
};
//Delete Local Placement Object
deleteVehicle _setupObject;
_closeInDistance = (_closeInMax + _closeInMin) / 2;
//Checks
if ((_closeInDistance >= _distanceFromCenter) || (!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach)))) exitWith {
TRACE_2("no valid spot found",_closeInDistance,_distanceFromCenter);
//Checks (too close to center or can't attach)
if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith {
TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter);
[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);
//Create New 'real' Object
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)];
_attachedObject = _setupClassname createVehicle (getPos _placer);
_attachedObject = _itemVehClass createVehicle (getPos _unit);
_attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
//Remove Item from inventory
_placer removeItem _itemClassname;
_unit removeItem _itemClassname;
//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames
_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
@ -107,4 +97,4 @@ _currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_currentItemNames pushBack _itemClassname;
_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 "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;
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
};
class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
@ -63,6 +64,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
};
class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon";
@ -80,4 +82,3 @@ class CfgMovesMaleSdr: CfgMovesBasic {
};
};
};

View File

@ -149,11 +149,6 @@ class CfgVehicles {
MACRO_LOADUNLOADCAPTIVE
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
MACRO_LOADUNLOADCAPTIVE
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {

View File

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

View File

@ -27,7 +27,7 @@ if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
_listedItemClasses = [];
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu;
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", ""] call ACE_Interaction_fnc_prepareSelectMenu;
_allGear = [];

View File

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

View File

@ -16,15 +16,16 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_isUnconc);
EXPLODE_2_PVT(_this,_unit,_isUnconc);
diag_log "handleOnUnconscious";
diag_log _this;
diag_log _unit;
if (!local _unit) exitWith {};
systemChat format ["med: %1", _this];
if (_isUnconc) then {
//Knocked out: If surrendering, stop
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrendered);
};
} else {

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 we are in "hands up" animationState, crack it now

View File

@ -107,4 +107,21 @@ class CfgVehicles {
class TransportItems {};
class TransportBackpacks {};
};
class Item_Base_F;
class ACE_bananaItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = "$STR_ACE_Common_bananaDisplayName";
author = "$STR_ACE_Common_ACETeam";
vehicleClass = "Items";
class TransportItems
{
class ACE_banana
{
name = "ACE_banana";
count = 1;
};
};
};
};

View File

@ -34,6 +34,7 @@ if (hasInterface) then {
}] 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
[QGVAR(onBriefingPFH), "onEachFrame", {
@ -155,7 +156,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
};
// "playerTurretChanged" event
[ACE_player] call FUNC(getTurretIndex);
_newPlayerTurret = [ACE_player] call FUNC(getTurretIndex);
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _newPlayerTurret;
@ -174,13 +175,15 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
[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);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
["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

@ -4,13 +4,11 @@
ADDON = false;
// ACE Common Function
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addCanInteractWithCondition);
PREP(addLineToDebugDraw);
PREP(addMapMarkerCreatedEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addSetting);
PREP(addToInventory);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
@ -55,20 +53,15 @@ PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getDeathAnim);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getDoorTurrets);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getInPosition);
PREP(getMarkerType);
PREP(getName);
@ -80,23 +73,15 @@ PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);
PREP(getTargetObject);
PREP(getTurretCommander);
PREP(getTurretConfigPath);
PREP(getTurretCopilot);
PREP(getTurretGunner);
PREP(getTurretIndex);
PREP(getTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
PREP(getUavControlPosition);
PREP(getVehicleCargo);
PREP(getVehicleCodriver);
PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex);
PREP(getWeaponType);
PREP(getWeaponState);
PREP(getWindDirection);
PREP(getZoom);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(hasItem);
@ -138,11 +123,7 @@ PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCanInteractWithCondition);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
@ -185,6 +166,32 @@ PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
// config items
PREP(getConfigType);
PREP(getItemType);
PREP(getWeaponType);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
// config objects
PREP(getConfigTypeObject);
PREP(getConfigGunner);
PREP(getConfigCommander);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getVehicleCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);
PREP(getTurretCommander);
PREP(getTurretCopilot);
PREP(getDoorTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
// ACE_Debug
PREP(exportConfig);
PREP(getChildren);
@ -192,6 +199,7 @@ PREP(getDisplayConfigName);
PREP(log);
PREP(logControls);
PREP(logDisplays);
PREP(logModEntries);
PREP(monitor);
PREP(showUser);
@ -214,6 +222,17 @@ PREP(localEvent);
PREP(removeEventHandler);
PREP(removeAlLEventHandlers);
// other eventhandlers
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addMapMarkerCreatedEventHandler);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
// hashes
PREP(hashCreate);
PREP(hashSet);

View File

@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Misc"};
units[] = {"ACE_Box_Misc", "ACE_bananaItem"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};

View File

@ -7,7 +7,6 @@ private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_ev
_eventType = _this select 0;
_event = _this select 1;
if(_eventType == "ACEg") then {
_eventName = _event select 0;
_eventArgs = _event select 1;
@ -16,9 +15,18 @@ if(_eventType == "ACEg") then {
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Net Event %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -0,0 +1,101 @@
/*
* Author: Garth 'L-H' de Wet
* Adds an item,weapon,magazine to the unit's inventory
* or places it in a weaponHolder if no space.
*
* Arguments:
* 0: Unit (OBJECT)
* 1: Classname (String)
* 2: Container (String, Optional) uniform, vest, backpack
*
* Return Value:
* Array:
* 0: Added to player (Bool)
* 1: weaponholder (OBJECT)
*
* Public: Yes
*/
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_classname);
private "_addedToPlayer";
private "_container";
private "_canAdd";
private "_type";
_canAdd = false;
_addedToPlayer = true;
if((count _this) > 2) then {
_container = _this select 2;
} else {
_container = nil;
};
_type = [_classname] call EFUNC(common,getItemType);
if(!isNil "_container") then {
switch (_container) do {
case "vest": { _canAdd = _unit canAddItemToVest _classname; };
case "backpack": { _canAdd = _unit canAddItemToBackpack _classname; };
case "uniform": { _canAdd = _unit canAddItemToUniform _classname; };
};
} else {
_container = "";
_canAdd = _unit canAdd _classname;
};
switch ((_type select 0)) do {
case "weapon": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
default { _unit addWeaponGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addWeaponCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
case "magazine": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
default { _unit addMagazineGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineCargoGlobal [_classname, 1];
_unit setPosATL _pos;
};
};
case "item": {
if (_canAdd) then {
switch (_container) do {
case "vest": { _unit addItemToVest _classname; };
case "backpack": { _unit addItemToBackpack _classname; };
case "uniform": { _unit addItemToUniform _classname; };
default { _unit addItem _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addItemCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
default {diag_log format ["ACE: Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type];};
};
[_addedToPlayer,_unit]

View File

@ -36,11 +36,7 @@ if (count _this > 3) then {
};
// don't overwrite more important animations
if (_unit getVariable ["ACE_isUnconscious", false] && {!_force}) exitWith {
if (_animation != "Unconscious") then {
[_unit, "Unconscious", 2] call FUNC(doAnimation);
};
};
if (_unit getVariable ["ACE_isUnconscious", false] && {(_animation != "Unconscious")} && {!_force}) exitWith {};
// don't go unconscious if the unit isn't unconscious
if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", false]) || (_unit getVariable ["ACE_isDead", false]))}) exitWith {};

View File

@ -2,16 +2,16 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
/*
diag_log text format["REGISTERED ACE PFH HANDLERS"];
diag_log text format["-------------------------------------------"];
if(!isNil "ACE_PFH") then {
if(!isNil "ACE_PFH_COUNTER") then {
{
private["_pfh"];
_pfh = _x select 0;
diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
} forEach ACE_PFH;
};*/
} forEach ACE_PFH_COUNTER;
};
diag_log text format["ACE COUNTER RESULTS"];
diag_log text format["-------------------------------------------"];

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

@ -16,6 +16,8 @@ private ["_vehicle", "_weapon"];
_vehicle = _this select 0;
_weapon = _this select 1;
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle};
private "_gunner";
_gunner = objNull;
@ -23,6 +25,6 @@ _gunner = objNull;
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
_gunner = _vehicle turretUnit _x;
};
} forEach allTurrets _vehicle;
} forEach allTurrets [_vehicle, true];
_gunner

View File

@ -0,0 +1,83 @@
/*
* 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" 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 == "") exitWith {["",""]};
if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]};
private ["_config", "_type"];
_config = configFile >> _cfgType >> _item;
_type = getNumber (_config >> "type");
if (isNumber (_config >> "ItemInfo" >> "type")) then {
_type = getNumber (_config >> "ItemInfo" >> "type");
};
private "_default";
_default = ["item", "magazine"] select (_cfgType == "CfgMagazines");
switch (true) do {
case (_type == 0): {[_default,"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 < 2^11): {["magazine","unknown"]};
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 ("weapon"): {["weapon","binocular"]};
case ("binocular"): {["weapon","binocular"]};
case ("nvgoggles"): {["item","nvgoggles"]};
case ("itemminedetector"): {["item","minedetector"]};
default {[_default,"unknown"]};
};
};
case (_type == 2^16): {["weapon","vehicle"]};
case (_type == 2^17): {[_default,"unknown"]}; // ???
default {[_default,"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

@ -0,0 +1,14 @@
/*
* Author: commy2
*
* Returns a value depending on current zoom level.
*
* Argument:
* None.
*
* Return value:
* Zoom. (Number)
*/
#include "script_component.hpp"
(0.5 - ((worldToScreen positionCameraToWorld [0,1,1]) select 1)) * (getResolution select 5)

View File

@ -12,16 +12,23 @@
*/
#include "script_component.hpp"
_eventName = _this select 0;
_eventArgs = _this select 1;
PARAMS_2(_eventName,_eventArgs);
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Local Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -0,0 +1,17 @@
// by commy2
private ["_configs", "_entries"];
_configs = "true" configClasses (configFile >> _this);
_entries = [];
{
{
_name = toLower configName _x;
if !(_name in _entries) then {
diag_log text _name;
_entries pushBack _name;
};
} forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false];
} forEach _configs;

View File

@ -16,6 +16,10 @@ private ["_eventName", "_eventArgs"];
_eventName = _this select 0;
_eventArgs = _this select 1;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Server Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEg = [_eventName, _eventArgs];
if(!isServer) then {

View File

@ -21,6 +21,11 @@ _eventName = _this select 0;
_eventTargets = _this select 1;
_eventArgs = _this select 2;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if(!isServer) then {
publicVariableServer "ACEc";

View File

@ -23,11 +23,6 @@ class Extended_Init_EventHandlers {
init = QUOTE(_this call DFUNC(initObject));
};
};
class StaticMortar {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
class ReammoBox_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]}
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]}
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}

View File

@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then {
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject_carry);
[_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;
};
// drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then {
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_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 {
// drop carried object when not standing
if (stance _unit != "STAND") then {
// drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];

View File

@ -56,11 +56,12 @@ if (_target isKindOf "CAManBase") then {
[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus);
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
};
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// prevents draging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true];

View File

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

View File

@ -3,7 +3,7 @@
["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget",
{
// 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
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
@ -20,7 +20,7 @@
GVAR(isDownStateKey1) = false;
// 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
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
@ -33,7 +33,7 @@
["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp",
{
// 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
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
@ -47,7 +47,7 @@
["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown",
{
// 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
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};

View File

@ -89,7 +89,7 @@ _gRedOut = MINVIRTUALG / _classCoef;
// @todo: Sort the interaction with medical
if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
[ACE_player, (10 + floor(random 5))] call EFUNC(medical,knockOut);
[ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious);
};
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];

View File

@ -1,6 +1,8 @@
//XEH_clientInit.sqf
#include "script_component.hpp"
if (!hasInterface) exitWith {};
// Install the render EH on the main display
addMissionEventHandler ["Draw3D", DFUNC(render)];
@ -10,17 +12,43 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
// Wait until the map display is detected
waitUntil {(!isNull findDisplay 12)};
// Install the render EH on the map screen
// Install the render EH on the map screen
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)];
};
["ACE3", QGVAR(InteractKey), "Interact Key",
{[0] call FUNC(keyDown)},
["ACE3", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"),
{
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Statement
[0] call FUNC(keyDown)
},
{[0] call FUNC(keyUp)},
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
{[1] call FUNC(keyDown)},
["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"),
{
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Statement
[1] call FUNC(keyDown)
},
{[1] call FUNC(keyUp)},
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
// Listens for the falling unconscious event, just in case the menu needs to be closed
["medical_onUnconscious", {
diag_log ["im_onUn 1:",_this];
// If no menu is open just quit
if (GVAR(openedMenuType) < 0) exitWith {};
EXPLODE_2_PVT(_this,_unit,_isUnconscious);
if (_unit != ACE_player || !_isUnconscious) exitWith {};
GVAR(actionSelected) = false;
[] call FUNC(keyUp);
diag_log ["im_onUn 2:",_this];
}] call EFUNC(common,addEventhandler);

View File

@ -13,7 +13,7 @@
* The entry full path, which can be used to remove the entry, or add children entries <ARRAY>.
*
* 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
*/

View File

@ -43,7 +43,7 @@ _recurseFnc = {
if (_condition == "") then {_condition = "true"};
// 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"));
@ -79,18 +79,37 @@ _recurseFnc = {
private "_actionsCfg";
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
private ["_baseDisplayName", "_baseIcon"];
_baseDisplayName = "";
_baseIcon = "";
if (_objectType isKindOf "CAManBase") then {
_baseDisplayName = localize "STR_ACE_Interact_Menu_SelfActionsRoot";
_baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
} else {
_baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName");
//Alt would be to just use a static text, if veh names end up being too long:
// _baseDisplayName = localize "STR_ACE_Interact_Menu_VehicleActionsRoot";
//Pull the icon from the vehicle's config:
_baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon");
//icon could be a CfgVehicleIcons
if isText (configFile >> "CfgVehicleIcons" >> _baseIcon) then {
_baseIcon = getText (configFile >> "CfgVehicleIcons" >> _baseIcon);
};
};
// Create a master action to base on self action
_actions = [
[
[
"ACE_SelfActions",
"Self Actions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
_baseDisplayName,
_baseIcon,
{
// Dummy statement so it's not collapsed when there's no available actions
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",

View File

@ -19,7 +19,7 @@
* Action <ARRAY>
*
* 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
*/

View File

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

View File

@ -38,7 +38,7 @@ _fnc_renderNearbyActions = {
// Only render them directly if they are base level actions
if (count (_x select 1) == 0) then {
// Try to render the menu
_action = [_x,[]];
_action = _x;
if ([_target, _action] call FUNC(renderBaseMenu)) then {
_numInteractions = _numInteractions + 1;
};
@ -89,7 +89,7 @@ _fnc_renderSelfActions = {
{
_action = _x;
_pos = if !(visibleMap) then {
_pos = if !(GVAR(useCursorMenu)) then {
(((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition)
} else {
[0.5, 0.5]

View File

@ -35,7 +35,7 @@ GVAR(iconCount) = GVAR(iconCount) + 1;
if(_icon == "") then {
_icon = DEFAULT_ICON;
};
_text = format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center'>%4</t>", _icon, _color, _color, _text];
_text = format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center' shadow='1' shadowColor='#000000' shadowOffset='0.07'>%4</t>", _icon, _color, _color, _text];
_ctrl ctrlSetStructuredText (parseText _text);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW];
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];

View File

@ -1,7 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2015-04-03 -->
<Project name="ACE">
<Package name="Interact_Menu">
<Key ID="STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction">
<English>Always display cursor for self interaction</English>
</Key>
</Project>
<Key ID="STR_ACE_Interact_Menu_InteractKey">
<English>Interact Key</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_SelfInteractKey">
<English>Self Interaction Key</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_SelfActionsRoot">
<English>Self Actions</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_VehicleActionsRoot">
<English>Vehicle Actions</English>
</Key>
</Package>
</Project>

View File

@ -525,26 +525,6 @@ class CfgVehicles {
};
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
selection = "gunnerview";
distance = 2;
condition = "true";
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addPassengersActions));
};
};
};
class thingX;
class ReammoBox_F: thingX {
class ACE_Actions {

View File

@ -24,7 +24,7 @@ _onFinish = {
EXPLODE_2_PVT((_this select 0),_caller,_target);
_caller removeItem "ACE_UAVBattery";
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 = {

View File

@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if (((getPosASL ace_player) distance _setPosition) > 5) then {
_fncStatement = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
[ace_player, _attachedFence] call FUNC(cutDownFence);
PARAMS_3(_dummyTarget,_player,_attachedFence);
[_player, _attachedFence] call FUNC(cutDownFence);
};
_fncCondition = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))})
PARAMS_3(_dummyTarget,_player,_attachedFence);
((!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 {
_fencesHelped pushBack _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 hideObject true;
_helper setVariable [QGVAR(attachedFence), _x];
_addedHelpers pushBack _helper;
};
};

View File

@ -11,7 +11,7 @@
<Czech>Přepáskovat&lt;br/&gt;Zásobníky</Czech>
<Italian>Ricarica&lt;br/&gt;Caricatori</Italian>
<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>
</Key>
<Key ID="STR_ACE_MagazineRepack_SelectMagazineMenu">

View File

@ -230,7 +230,7 @@ class CfgWeapons {
class muzzle_snds_H: ItemCore {
class ItemInfo: InventoryMuzzleItem_Base_F {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -263,7 +263,7 @@ class CfgWeapons {
class muzzle_snds_L: muzzle_snds_H {
class ItemInfo: ItemInfo {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -296,7 +296,7 @@ class CfgWeapons {
class muzzle_snds_M: muzzle_snds_H {
class ItemInfo: ItemInfo {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -329,7 +329,7 @@ class CfgWeapons {
class muzzle_snds_B: muzzle_snds_H {
class ItemInfo: ItemInfo {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -362,7 +362,7 @@ class CfgWeapons {
class muzzle_snds_H_MG: muzzle_snds_H {
class ItemInfo: ItemInfo {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -395,7 +395,7 @@ class CfgWeapons {
class muzzle_snds_H_SW: muzzle_snds_H_MG {
class ItemInfo: ItemInfo {
class MagazineCoef {
initSpeed = 1.0;
initSpeed = 1.05;
};
class AmmoCoef {
@ -428,7 +428,73 @@ class CfgWeapons {
class muzzle_snds_acp: muzzle_snds_H {
class ItemInfo: ItemInfo {
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 {

View File

@ -2,6 +2,8 @@
STACK TRACING
**/
//#define ENABLE_CALLSTACK
//#define ENABLE_PERFORMANCE_COUNTERS
//#define DEBUG_EVENTS
#ifdef ENABLE_CALLSTACK
@ -29,7 +31,7 @@ PERFORMANCE COUNTERS SECTION
//#define ENABLE_PERFORMANCE_COUNTERS
#ifdef ENABLE_PERFORMANCE_COUNTERS
#define ADDPFH(function, timing, args) call { _ret = [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add); if(isNil "ACE_PFH" ) then { ACE_PFH=[]; }; ACE_PFH pushBack [[_ret, __FILE__, __LINE__], [function, timing, args]]; _ret }
#define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret }
#define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter));
#define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime];
@ -37,8 +39,6 @@ PERFORMANCE COUNTERS SECTION
#define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC)
#else
#define ADDPFH(function, timing, args) [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add)
#define CREATE_COUNTER(x) /* disabled */
#define BEGIN_COUNTER(x) /* disabled */
#define END_COUNTER(x) /* disabled */

View File

@ -18,10 +18,13 @@ class ACE_Medical_Actions {
callbackProgress = "";
animationPatient = "";
animationCaller = "AinvPknlMstpSnonWnonDnon_medic4";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} };
};
class Morphine: Bandage {
displayName = "$STR_ACE_Medical_Inject_Morphine";
@ -30,6 +33,7 @@ class ACE_Medical_Actions {
items[] = {"ACE_morphine"};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
};
class Epinephrine: Bandage {
displayName = "$STR_ACE_Medical_Inject_Epinephrine";
@ -39,6 +43,7 @@ class ACE_Medical_Actions {
items[] = {"ACE_epinephrine"};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
};
class BloodIV: Bandage {
displayName = "$STR_ACE_Medical_Transfuse_Blood";
@ -48,35 +53,51 @@ class ACE_Medical_Actions {
items[] = {{"ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250"}};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = {};
};
class Carry: Bandage {
displayName = "";
displayNameProgress = "";
class Tourniquet: Bandage {
displayName = "$STR_ACE_Medical_Apply_Tourniquet";
displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet";
items[] = {"ACE_tourniquet"};
treatmentTime = 6;
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));
condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)));
litter[] = {};
};
class BodyBag: Bandage {
displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag";
displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 0;
items[] = {};
condition = QUOTE(DFUNC(canCarry));
callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, true)] call DFUNC(actionCarryUnit));
treatmentTime = 2;
items[] = {"ACE_bodyBag"};
condition = "!alive (_this select 1);";
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 0;
animationPatient = "";
animationCaller = "";
animationCallerProne = "";
animationCallerSelf = "";
animationCallerSelfProne = "";
animationPatientUnconscious = "";
itemConsumed = 0;
litter[] = {};
};
class Drag: Carry {
/*class PersonalAidKit: Bandage {
displayName = "";
displayNameProgress = "";
condition = QUOTE(DFUNC(canCarry));
callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, false)] call DFUNC(actionCarryUnit));
};
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {"All"};
requiredMedic = 1;
treatmentTime = 15;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = 0;
animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}, {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} };
};*/
};
class Advanced {
class FieldDressing {
displayName = "$STR_ACE_Medical_Bandage";
displayNameProgress = "$STR_ACE_Medical_Bandaging";
// Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All.
treatmentLocations[] = {"All"};
// What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor
@ -92,10 +113,13 @@ class ACE_Medical_Actions {
callbackProgress = "";
itemConsumed = 1;
animationPatient = "";
animationCaller = "AinvPknlMstpSnonWnonDnon_medic4";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} };
};
class PackingBandage: fieldDressing {
items[] = {"ACE_packingBandage"};
@ -107,29 +131,44 @@ class ACE_Medical_Actions {
items[] = {"ACE_quikclot"};
};
class Tourniquet: fieldDressing {
displayName = "$STR_ACE_Medical_Apply_Tourniquet";
displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet";
items[] = {"ACE_tourniquet"};
treatmentTime = 6;
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));
condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)));
litter[] = {};
};
class Morphine: fieldDressing {
displayName = "$STR_ACE_Medical_Inject_Morphine";
displayNameProgress = "$STR_ACE_Medical_Injecting_Morphine";
items[] = {"ACE_morphine"};
treatmentTime = 3;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} };
};
class Atropine: Morphine {
displayName = "$STR_ACE_Medical_Inject_Atropine";
displayNameProgress = "$STR_ACE_Medical_Injecting_Atropine";
items[] = {"ACE_atropine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} };
};
class Epinephrine: Morphine {
displayName = "$STR_ACE_Medical_Inject_Epinephrine";
displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine";
items[] = {"ACE_epinephrine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
};
class BloodIV: fieldDressing {
displayName = "$STR_ACE_Medical_Transfuse_Blood";
displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood";
items[] = {"ACE_bloodIV"};
requiredMedic = 1;
treatmentTime = 7;
callbackSuccess = QUOTE(DFUNC(treatmentIV));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = {};
};
class BloodIV_500: BloodIV {
items[] = {"ACE_bloodIV_500"};
@ -138,6 +177,8 @@ class ACE_Medical_Actions {
items[] = {"ACE_bloodIV_250"};
};
class PlasmaIV: BloodIV {
displayName = "$STR_ACE_Medical_Transfuse_Plasma";
displayNameProgress = "$STR_ACE_Medical_Transfusing_Plasma";
items[] = {"ACE_plasmaIV"};
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
@ -148,6 +189,8 @@ class ACE_Medical_Actions {
items[] = {"ACE_plasmaIV_250"};
};
class SalineIV: BloodIV {
displayName = "$STR_ACE_Medical_Transfuse_Saline";
displayNameProgress = "$STR_ACE_Medical_Transfusing_Saline";
items[] = {"ACE_salineIV"};
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
};
@ -158,24 +201,37 @@ class ACE_Medical_Actions {
items[] = {"ACE_salineIV_250"};
};
class SurgicalKit: fieldDressing {
displayName = "";
displayNameProgress = "";
items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {"MedicalFacility", "MedicalVehicle"};
requiredMedic = 2;
treatmentTime = 15;
requiredMedic = QGVAR(medicSetting_SurgicalKit);
treatmentTime = 10;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit));
itemConsumed = 0;
itemConsumed = QGVAR(consumeItem_SurgicalKit);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }};
};
class PersonalAidKit: fieldDressing {
displayName = "";
displayNameProgress = "";
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {"All"};
requiredMedic = 1;
treatmentTime = 15;
requiredMedic = QGVAR(medicSetting_PAK);
treatmentTime = 10;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = 0;
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
itemConsumed = QGVAR(consumeItem_PAK);
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "";
animationCallerSelfProne = "";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} };
};
class CheckPulse: fieldDressing {
displayName = "";
displayNameProgress = "";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 2;
@ -186,6 +242,7 @@ class ACE_Medical_Actions {
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 0;
litter[] = {};
};
class CheckBloodPressure: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
@ -199,55 +256,41 @@ class ACE_Medical_Actions {
condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo));
};
class CPR: fieldDressing {
displayName = "CPR";
displayNameProgress = "Performing CPR";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 25;
treatmentTime = 15;
items[] = {};
condition = ""; // unconscious?
condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = "";
callbackProgress = "";
callbackProgress = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
animationPatient = "";
animationCaller = ""; // TODO
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
animationCallerSelf = "";
animationCallerSelfProne = "";
itemConsumed = 0;
litter[] = {};
};
class BodyBag: fieldDressing {
displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag";
displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 7.5;
treatmentTime = 2;
items[] = {"ACE_bodyBag"};
condition = "!alive (_this select 1);";
callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationPatientUnconscious = "";
itemConsumed = 0;
litter[] = {};
};
class Carry: fieldDressing {
displayName = "";
displayNameProgress = "";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 0;
items[] = {};
condition = QUOTE(DFUNC(canCarry));
callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, true)] call DFUNC(actionCarryUnit));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 0;
animationPatient = "";
animationCaller = "";
animationCallerProne = "";
animationCallerSelf = "";
animationCallerSelfProne = "";
};
class Drag: Carry {
displayName = "";
displayNameProgress = "";
condition = QUOTE(DFUNC(canCarry));
callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, false)] call DFUNC(actionCarryUnit));
};
};
};
@ -443,6 +486,8 @@ class ACE_Medical_Advanced {
class damageTypes {
thresholds[] = {{0.1, 1}};
selectionSpecific = 1;
lethalDamage = 0.01;
class bullet {
// above damage, amount. Put the highest threshold to the left and lower the threshold with the elements to the right of it.
thresholds[] = {{0.1, 1}};
@ -465,8 +510,9 @@ class ACE_Medical_Advanced {
selectionSpecific = 0;
};
class backblast {
thresholds[] = {{0.25, 5}};
thresholds[] = {{0, 2},{0.55, 5}, {1, 6}};
selectionSpecific = 0;
lethalDamage = 1;
};
class stab {
thresholds[] = {{0.1, 1}};

View File

@ -14,16 +14,12 @@ class ACE_Settings {
typeName = "SCALAR";
values[] = {"Players only", "Players and AI"};
};
class GVAR(maxRevives) {
typeName = "NUMBER";
value = 1;
};
class GVAR(enableOverdosing) {
typeName = "BOOL";
value = true;
};
class GVAR(bleedingCoefficient) {
typeName = "NUMBER";
typeName = "SCALAR";
value = 1;
};
@ -48,16 +44,16 @@ class ACE_Settings {
value = true;
};
class GVAR(playerDamageThreshold) {
typeName = "NUMBER";
typeName = "SCALAR";
value = 1;
};
class GVAR(AIDamageThreshold) {
typeName = "NUMBER";
typeName = "SCALAR";
value = 1;
};
class GVAR(enableUnsconsiousnessAI) {
value = 1;
typeName = "NUMBER";
typeName = "SCALAR";
values[] = {"Disabled", "Enabled", "50/50"};
};
class GVAR(preventInstaDeath) {
@ -65,11 +61,39 @@ class ACE_Settings {
value = false;
};
class GVAR(maxReviveTime) {
typeName = "NUMBER";
typeName = "SCALAR";
value = 120;
};
class GVAR(amountOfReviveLives) {
typeName = "SCALAR";
value = -1;
};
class GVAR(allowDeadBodyMovement) {
typeName = "BOOL";
value = false;
};
class GVAR(allowLitterCreation) {
typeName = "BOOL";
value = true;
};
class GVAR(litterCleanUpDelay) {
typeName = "SCALAR";
value = 1800;
};
class GVAR(medicSetting_PAK) {
typeName = "SCALAR";
value = 1;
};
class GVAR(medicSetting_SurgicalKit) {
typeName = "SCALAR";
value = 1;
};
class GVAR(consumeItem_PAK) {
typeName = "SCALAR";
value = 0;
};
class GVAR(consumeItem_SurgicalKit) {
typeName = "SCALAR";
value = 0;
};
};

View File

@ -26,10 +26,6 @@ class CfgVehicles {
description = "What is the medical simulation level?";
typeName = "NUMBER";
class values {
class disable {
name = "Disabled";
value = 0;
};
class normal {
name = "Basic";
value = 1;
@ -43,11 +39,11 @@ class CfgVehicles {
};
class enableFor {
displayName = "Enabled for";
description = "Select what units the medical system will be enabled for";
description = "Select what units the medical system will be enabled for (Adv only)";
typeName = "NUMBER";
class values {
class playableUnits {
name = "Players only";
name = "Players only.";
value = 0;
default = 1;
};
@ -57,21 +53,22 @@ class CfgVehicles {
};
};
};
class enableAirway {
// TODO Disabled until the features are implemented
/*class enableAirway {
displayName = "Enable Airway";
description = "Enable Advanced medical Airway";
description = "Enable Advanced medical Airway (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};
class enableFractures {
displayName = "Enable Fractures";
description = "Enable Advanced medical Fractures";
description = "Enable Advanced medical Fractures (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};
};*/
class enableAdvancedWounds {
displayName = "Enable Advanced wounds";
description = "Allow reopening of bandaged wounds?";
description = "Allow reopening of bandaged wounds? (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};
@ -125,6 +122,12 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 0;
};
class bleedingCoefficient {
displayName = "Bleeding coefficient";
description = "Coefficient to modify the bleeding speed";
typeName = "NUMBER";
defaultValue = 1;
};
};
class ModuleDescription {
description = "Provides a medical system for both players and AI.";
@ -134,7 +137,7 @@ class CfgVehicles {
class ACE_moduleTreatmentConfiguration: ACE_Module {
scope = 2;
displayName = "Treatment Configuration [ACE]";
displayName = "Treatment Settings [ACE]";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleTreatmentConfiguration));
@ -164,11 +167,17 @@ class CfgVehicles {
};
};
};
class maxRevives {
displayName = "Max revives";
description = "Max amount of revives available (when preventing death)";
class maxReviveTime {
displayName = "Max Revive time";
description = "Max amount of seconds a unit can spend in revive state";
typeName = "NUMBER";
defaultValue = 1;
defaultValue = 120;
};
class amountOfReviveLives {
displayName = "Max Revive lives";
description = "Max amount of lives a unit. 0 or -1 is disabled.";
typeName = "NUMBER";
defaultValue = -1;
};
class enableOverdosing {
displayName = "Enable Overdosing";
@ -176,12 +185,46 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 1;
};
class bleedingCoefficient {
displayName = "Bleeding coefficient";
description = "Coefficient to modify the bleeding speed";
typeName = "NUMBER";
class allowLitterCreation {
displayName = "Enable Litter";
description = "Enable litter being created upon treatment";
typeName = "BOOL";
defaultValue = 1;
};
class litterCleanUpDelay {
displayName = "Life time of litter objects";
description = "How long should litter objects stay? In seconds. -1 is forever.";
typeName = "NUMBER";
defaultValue = 1800;
};
class medicSetting_PAK {
displayName = "Allow PAK";
description = "Who can use the PAK for full heal?";
typeName = "NUMBER";
class values {
class anyone { name = "Anyone"; value = 0; };
class Medic { name = "Medics only"; value = 1; default = 1; };
class Special { name = "Doctors only (Adv)"; value = 2; };
};
};
class consumeItem_PAK {
displayName = "Remove PAK on use";
description = "Should PAK be removed on usage?";
typeName = "NUMBER";
class values {
class keep { name = "No"; value = 0; };
class remove { name = "Yes"; value = 1; default = 1; };
};
};
class medicSetting_SurgicalKit: medicSetting_PAK {
displayName = "Allow Surgical kit";
description = "Who can use the surgical kit?";
};
class consumeItem_SurgicalKit: consumeItem_PAK {
displayName = "Remove Surgical kit";
description = "Should Surgical kit be removed on usage?";
};
};
class ModuleDescription {
description = "Configure the treatment settings from ACE Medical";
@ -224,7 +267,6 @@ class CfgVehicles {
class doctor {
name = "Doctor (Only Advanced Medics)";
value = 1;
default = 1;
};
};
};
@ -256,8 +298,18 @@ class CfgVehicles {
class enabled {
displayName = "Is Medical Vehicle";
description = "Whatever or not the objects in the list will be a medical vehicle.";
typeName = "BOOL";
defaultValue = 1;
typeName = "NUMBER";
class values {
class none {
name = "No";
value = 0;
};
class medic {
name = "Yes";
value = 1;
default = 1;
};
};
};
};
class ModuleDescription {
@ -937,29 +989,16 @@ class CfgVehicles {
enableInside = 1;
icon = PATHTOF(UI\icons\bandage.paa);
};
class Carry {
displayName = "$STR_ACE_MEDICAL_CARRY";
class PlaceInBodyBag {
displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'body', 'Carry')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'body', 'Carry')] call DFUNC(treatment));
condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "";
enableInside = 1;
//icon = PATHTOF(UI\icons\bandage.paa);
};
class Drag {
displayName = "$STR_ACE_MEDICAL_DRAG";
distance = 2.0;
condition = QUOTE([ARR_4(_player, _target, 'body', 'Drag')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'body', 'Drag')] call DFUNC(treatment));
showDisabled = 1;
priority = 2;
hotkey = "";
enableInside = 1;
//icon = PATHTOF(UI\icons\bandage.paa);
};
class TriageCard {
displayName = "Triage Card";
distance = 2.0;
@ -1699,6 +1738,40 @@ class CfgVehicles {
icon = "";
displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY;
};
// Medical litter classes
class Thing;
class ACE_MedicalLitterBase: Thing {
scope = 1;
displayName = " ";
destrType = "DestructNo";
model = QUOTE(PATHTOF(data\littergeneric.p3d));
};
class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d));
};
class ACE_MedicalLitter_bandage2: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_bandages2.p3d));
};
class ACE_MedicalLitter_bandage3: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_bandages3.p3d));
};
class ACE_MedicalLitter_packingBandage: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\litter_packingBandage.p3d));
};
class ACE_MedicalLitter_gloves: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\littergeneric_gloves.p3d));
};
class ACE_MedicalLitter_atropine: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\litter_atropine.p3d));
};
class ACE_MedicalLitter_epinephrine: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\litter_epinephrine.p3d));
};
class ACE_MedicalLitter_morphine: ACE_MedicalLitterBase {
model = QUOTE(PATHTOF(data\litter_morphine.p3d));
};
class Item_Base_F;
class ACE_fieldDressingItem: Item_Base_F {
scope = 2;
@ -2082,18 +2155,4 @@ class CfgVehicles {
};
};
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
};

View File

@ -25,7 +25,7 @@ class CfgWeapons {
class ACE_ItemCore;
class ACE_fieldDressing: ACE_ItemCore {
scope = 2;
model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d";
model = QUOTE(PATHTOF(data\bandage.p3d));
picture = QUOTE(PATHTOF(ui\items\fieldDressing.paa));
displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY;
descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT;

View File

@ -217,13 +217,18 @@ if (isNil QGVAR(level)) then {
}, 0, []] call CBA_fnc_addPerFrameHandler;
// broadcast injuries to JIP clients in a MP session
if (isMultiplayer) then {
// We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them.
if (hasInterface) then {
{
[_x, player] call FUNC(requestWoundSync);
}foreach units group player;
if (USE_WOUND_EVENT_SYNC) then {
// broadcast injuries to JIP clients in a MP session
if (isMultiplayer && hasInterface) then {
["playerChanged", {
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
if (alive _newPlayer) then {
// We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them.
{
[_x, _newPlayer] call FUNC(requestWoundSync);
}foreach units group player;
};
}] call EFUNC(common,addEventhandler);
};
};
@ -232,6 +237,11 @@ if (isMultiplayer) then {
{(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)},
{(((_this select 0) call FUNC(getBloodLoss)) > 0.25)},
{((_this select 0) getvariable [QGVAR(inReviveState), false])},
{((_this select 0) getvariable [QGVAR(inCardiacArrest), false])},
{((_this select 0) getvariable ["ACE_isDead", false])},
{(((_this select 0) getvariable [QGVAR(airwayStatus), 100]) < 80)}
] call FUNC(addUnconsciousCondition);
// Prevent all types of interaction while unconscious
// @todo: probably remove this when CBA keybind hold key works properly
["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition);

View File

@ -23,6 +23,7 @@ PREP(canAccessMedicalEquipment);
PREP(canTreat);
PREP(canTreatCached);
PREP(canCarry);
PREP(createLitter);
PREP(determineIfFatal);
PREP(getBloodLoss);
PREP(getBloodPressure);
@ -49,6 +50,8 @@ PREP(hasItems);
PREP(hasMedicalEnabled);
PREP(hasTourniquetAppliedTo);
PREP(init);
PREP(isBeingCarried);
PREP(isBeingDragged);
PREP(isInMedicalFacility);
PREP(isMedic);
PREP(isMedicalVehicle);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -56,5 +56,5 @@ if ([_caller] call FUNC(isMedic)) then {
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent);
if (_logOutPut != "") then {
[_target,"examine", "%1 checked Blood Pressure: %2", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
[_target,"activity", "%1 checked Blood Pressure: %2", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
};

View File

@ -49,5 +49,5 @@ if (_heartRate > 1.0) then {
["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent);
if (_logOutPut != "") then {
[_unit,"examine","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
[_unit,"activity","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
};

View File

@ -27,4 +27,4 @@ if ([_target] call EFUNC(common,isAwake)) then {
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent);
[_target,"examine",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog);

View File

@ -30,7 +30,15 @@ if (GVAR(level)>=2) then {
};
if !(isClass _config) exitwith {false};
_medicRequired = getNumber (_config >> "requiredMedic");
_medicRequired = if (isNumber (_config >> "requiredMedic")) then {
getNumber (_config >> "requiredMedic");
} else {
// Check for required class
if (isText (_config >> "requiredMedic")) exitwith {
missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0];
};
0;
};
if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false};
_items = getArray (_config >> "items");

View File

@ -0,0 +1,110 @@
/*
* Author: Glowbal
* Spawns litter for the treatment action on the ground around the target
*
* Arguments:
* 0: The target <OBJECT>
* 1: The treatment classname <STRING>
*
* Return Value:
*
*
* Public: No
*/
#include "script_component.hpp"
#define MIN_ENTRIES_LITTER_CONFIG 3
private ["_target", "_className", "_config", "_litter", "_createLitter", "_litterObject", "_position", "_createdLitter"];
_caller = _this select 0;
_target = _this select 1;
_selectionName = _this select 2;
_className = _this select 3;
_usersOfItems = _this select 5;
if !(GVAR(allowLitterCreation)) exitwith {};
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
};
if !(isClass _config) exitwith {false};
if !(isArray (_config >> "litter")) exitwith {};
_litter = getArray (_config >> "litter");
_createLitter = {
_position = getPos (_this select 0);
_litterClass = _this select 1;
_litterObject = createVehicle [_litterClass, _position, [], 0, "NONE"];
if (random(1) >= 0.5) then {
_litterObject setPos [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2];
} else {
_litterObject setPos [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2];
};
_litterObject setDir (random 360);
_litterObject;
};
if (isnil QGVAR(allCreatedLitter)) then {
GVAR(allCreatedLitter) = [];
GVAR(litterPFHRunning) = false;
};
_createdLitter = [];
{
if (typeName _x == "ARRAY") then {
if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {};
private ["_selection", "_litterCondition", "_litterOptions"];
_selection = _x select 0;
if (toLower _selection in [toLower _selectionName, "all"]) then { // in is case sensitve. We can be forgiving here, so lets use toLower.
_litterCondition = _x select 1;
_litterOptions = _x select 2;
if (isnil _litterCondition) then {
_litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}};
} else {
_litterCondition = missionNamespace getvariable _litterCondition;
};
if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {};
if (typeName _litterOptions == "ARRAY") then {
// Loop through through the litter options and place the litter
{
if (typeName _x == "ARRAY" && {(count _x > 0)}) then {
_createdLitter pushback ([_target, _x select (floor(random(count _x)))] call _createLitter);
};
if (typeName _x == "STRING") then {
_createdLitter pushback ([_target, _x] call _createLitter);
};
}foreach _litterOptions;
};
};
};
}foreach _litter;
if (GVAR(litterCleanUpDelay) >= 0) then {
GVAR(allCreatedLitter) pushback [time, GVAR(litterCleanUpDelay), _createdLitter];
};
if !(GVAR(litterPFHRunning)) then {
GVAR(litterPFHRunning) = true;
[{
{
if (time - (_x select 0) >= (_x select 1)) then {
{
deleteVehicle _x;
}foreach (_this select 2);
GVAR(allCreatedLitter) set[_foreachIndex, objNull];
};
}foreach GVAR(allCreatedLitter);
GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull];
if (count GVAR(allCreatedLitter) == 0) exitwith {
GVAR(litterPFHRunning) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 30, []] call CBA_fnc_addPerFrameHandler;
};

View File

@ -21,7 +21,9 @@ GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} els
GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull};
[_target, ACE_player] call FUNC(requestWoundSync);
if (USE_WOUND_EVENT_SYNC) then {
[_target, ACE_player] call FUNC(requestWoundSync);
};
if (_show) then {
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"];
@ -41,6 +43,10 @@ if (_show) then {
_allInjuryTexts = [];
_genericMessages = [];
_partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select GVAR(currentSelectedSelectionN);
_genericMessages pushback [localize _partText, [1, 1, 1, 1]];
if (_target getvariable[QGVAR(isBleeding), false]) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 0.1, 0.1, 1]];
};
@ -121,7 +127,7 @@ if (_show) then {
{
_lbCtrl lbAdd _x;
}foreach _allInjuryTexts;
if (count _genericMessages == 0 && {count _allInjuryTexts == 0}) then {
if (count _allInjuryTexts == 0) then {
_lbCtrl lbAdd "No injuries on this bodypart..";
};
@ -129,26 +135,23 @@ if (_show) then {
lbClear _logCtrl;
private ["_logs", "_log", "_message", "_moment", "_arguments", "_lbCtrl"];
_logs = _target getvariable [QGVAR(allLogs), []];
_logs = _target getvariable [QGVAR(logFile_Activity), []];
{
_log = _target getvariable [_x, []];
{
// [_message,_moment,_type, _arguments]
_message = _x select 0;
_moment = _x select 1;
_arguments = _x select 3;
if (isLocalized _message) then {
_message = localize _message;
};
// [_message,_moment,_type, _arguments]
_message = _x select 0;
_moment = _x select 1;
_arguments = _x select 3;
if (isLocalized _message) then {
_message = localize _message;
};
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
};
}foreach _arguments;
_message = format([_message] + _arguments);
_logCtrl lbAdd format["%1 %2", _moment, _message];
}foreach _log;
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
};
}foreach _arguments;
_message = format([_message] + _arguments);
_logCtrl lbAdd format["%1 %2", _moment, _message];
}foreach _logs;
_triageStatus = [_target] call FUNC(getTriageStatus);

View File

@ -42,4 +42,4 @@ if (GVAR(level) >= 2) then {
} else {
// TODO basic medical
};
_totalBloodLoss * GVAR(bleedingCoefficient);
_totalBloodLoss * (GVAR(bleedingCoefficient) max 0);

View File

@ -16,7 +16,6 @@
private ["_typeOfProjectile","_typeOfInjury"];
_typeOfProjectile = _this select 0;
_typeOfInjury = switch (true) do {
case (_typeOfProjectile isKindOf "Backblast"): {"backblast"};
case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"};
case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"};
case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"};
@ -29,7 +28,7 @@ _typeOfInjury = switch (true) do {
case (_typeOfProjectile iskindof "BombCore"): {"Explosive"};
case (_typeOfProjectile iskindof "Grenade"): {"Grenade"};
case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"};
default {"Unknown"};
default {_typeOfProjectile};
};
// TODO replace the capitalization on the switch results instead..
toLower _typeOfInjury;

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