Merge branch 'master' into disarmingTest

This commit is contained in:
PabstMirror 2015-03-29 14:41:15 -05:00
commit e65d74f43d
547 changed files with 9326 additions and 5364 deletions

View File

@ -6,7 +6,7 @@
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
@ -16,7 +16,7 @@
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
exceptions[] = {"isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \
@ -57,7 +57,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
exceptions[] = {"ACE_Drag_isNotDragging"};
exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
@ -67,7 +67,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
exceptions[] = {"ACE_Drag_isNotDragging"};
exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\detach_ca.paa);

View File

@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction"};
author[] = {"KoffeinFlummi","eRazeri","CAA-Picard"};
author[] = {"KoffeinFlummi","eRazeri","esteldunedain"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};

View File

@ -1,5 +1,5 @@
/*
* Author: eRazeri and CAA-Picard
* Author: eRazeri and esteldunedain
* Attach an item to the unit
*
* Arguments:

View File

@ -1,5 +1,5 @@
/*
* Author: eRazeri and CAA-Picard
* Author: eRazeri and esteldunedain
* Detach an item from a unit
*
* Arguments:

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

@ -39,7 +39,7 @@ class CfgVehicles {
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
exceptions[] = {"isNotEscorting"};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
@ -50,7 +50,7 @@ class CfgVehicles {
distance = 4;
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
exceptions[] = {"isNotEscorting"};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2;
@ -74,7 +74,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Captives_StopEscorting";
condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
exceptions[] = {"isNotEscorting"};
showDisabled = 0;
priority = 2.3;
hotkey = "C";
@ -91,7 +91,7 @@ class CfgVehicles {
displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
exceptions[] = {QGVAR(isNotSurrendering)};
exceptions[] = {"isNotSurrendering"};
showDisabled = 0;
priority = 0;
};
@ -107,7 +107,7 @@ class CfgVehicles {
distance = 4; \
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
exceptions[] = {QGVAR(isNotEscorting)}; \
exceptions[] = {"isNotEscorting"}; \
showDisabled = 0; \
priority = 1.2; \
hotkey = "L"; \
@ -178,7 +178,7 @@ class CfgVehicles {
curatorCost = 0; //???
isGlobal = 1; //run global
isTriggerActivated = 1; //Wait for triggers
// icon = QUOTE(PATHTOF(ui\todo.paa));
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {

View File

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

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

@ -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

@ -1,5 +1,6 @@
class CfgActions {
// fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
class None;
class TakeWeapon: None {
show = 0;

View File

@ -42,19 +42,3 @@ class Extended_Respawn_EventHandlers {
};
};
};
class Extended_Killed_EventHandlers {
class CAManBase {
class GVAR(dropObject) {
Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
};
};
};
class Extended_GetIn_EventHandlers {
class CAManBase {
class GVAR(dropObject) {
GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
};
};
};

View File

@ -0,0 +1,76 @@
class CfgMovesBasic {
class Default;
class Actions {
// fixes grab animation with equipped pistol
class NoActions;
class PistolStandActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
class LauncherKneelActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
class CivilStandActions: NoActions {
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class AgonyBase;
class AgonyBaseRfl;
class StandBase;
class HealBase;
class States {
// fixes being able to reload in some animations, can't remember now what exactly
class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
canReload = 0;
};
class AmovPpneMstpSnonWnonDnon_injured;
class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
canReload = 0;
};
class AmovPpneMstpSrasWrflDnon_injured;
class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
canReload = 0;
};
// mark as on ladder animation
class LadderCivilStatic: StandBase {
ACE_isLadder = 1;
};
// dunno, important
class AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1;
class AcinPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
enableDirectControl = 1;
};
class AcinPknlMwlkSnonWnonDb: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
enableDirectControl = 1;
};
// fix falling back to unconsciousness animation and disable rotating in that state
class Unconscious: Default {
ConnectTo[] = {};
head = "headNo";
forceAim = 1;
static = 1;
};
// idk. Flummi?
class AinvPknlMstpSnonWnonDnon_medic0: HealBase {
variantsPlayer[] = {};
};
};
};

View File

@ -33,7 +33,7 @@ class CfgVehicles {
function = QFUNC(moduleCheckPBOs);
scope = 2;
isGlobal = 1;
icon = QUOTE(PATHTOF(UI\IconCheckPBO_ca.paa));
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
class Arguments {
class Action {
displayName = "Action";
@ -87,6 +87,7 @@ class CfgVehicles {
displayName = "LSD Vehicles";
function = "ACE_Common_fnc_moduleLSDVehicles";
scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa));
isGlobal = 1;
class Arguments {
};

View File

@ -218,6 +218,7 @@ class CfgVoice {
displayName = "$STR_ACE_Common_NoVoice";
};
};
class CfgVoiceTypes {
class ACE_NoVoice {
name = "$STR_ACE_Common_NoVoice";

View File

@ -25,4 +25,20 @@ class CfgWeapons {
mass = 0;
};
};
class InventoryItem_Base_F;
class ACE_Banana: ACE_ItemCore {
author = "$STR_ACE_Common_ACETeam";
scope = 2;
displayName = "$STR_ACE_Common_bananaDisplayName";
descriptionShort = "$STR_ACE_Common_bananaDescr";
model = PATHTOF(data\banana.p3d);
picture = PATHTOF(data\icon_banana_ca.paa);
icon = "iconObject_circle";
mapSize = 0.034;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
class CfgMovesBasic;
class CfgMovesMaleSdr: CfgMovesBasic {
class AgonyBase;
class AgonyBaseRfl;
class StandBase;
class States {
class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
canReload = 0;
};
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
canReload = 0;
};
class AmovPpneMstpSnonWnonDnon_injured;
class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
canReload = 0;
};
class AmovPpneMstpSrasWrflDnon_injured;
class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
canReload = 0;
};
class LadderCivilStatic: StandBase {
ACE_isLadder = 1;
};
};
};

View File

@ -53,17 +53,6 @@ class RscTitles {
};
};
class ACE_EventHandlerHelper: ACE_Rsc_Display_Base {
idd = -1;
class controls {
class CameraView: RscMapControl {
onDraw = "if (cameraView != uiNamespace getVariable 'ACE_EventHandler_CameraMode') then {uiNamespace setVariable ['ACE_EventHandler_CameraMode', cameraView]; {[uiNamespace getVariable 'ACE_EventHandler_CameraMode'] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_CameraMode') select 2);};";
idc = -1;
w = 0;
h = 0;
};
};
};
class ACE_EventHandlerHelper2: ACE_Rsc_Display_Base {
class controls {
class MapMarkerCreated: RscMapControl {

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -33,6 +33,9 @@ if (hasInterface) then {
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
}] 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", {
if (time > 0) exitWith {
@ -171,15 +174,9 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
}, 0, []] call cba_fnc_addPerFrameHandler;
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
[QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable);
[QGVAR(carriedObj),objNull,false,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);

View File

@ -6,9 +6,7 @@ ADDON = false;
// ACE Common Function
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addCameraEventHandler);
PREP(addCanInteractWithCondition);
PREP(addCustomEventHandler);
PREP(addLineToDebugDraw);
PREP(addMapMarkerCreatedEventHandler);
PREP(addScrollWheelEventHandler);
@ -17,18 +15,13 @@ PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
PREP(ASLToPosition);
PREP(beingCarried);
PREP(binarizeNumber);
PREP(blurScreen);
PREP(cachedCall);
PREP(callCustomEventHandlers);
PREP(callCustomEventHandlersGlobal);
PREP(canGetInPosition);
PREP(canInteract);
PREP(canInteractWith);
PREP(canUseWeapon);
PREP(carriedByObj);
PREP(carryObj);
PREP(changeProjectileDirection);
PREP(checkPBOs);
PREP(claim);
@ -62,8 +55,6 @@ PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getCarriedBy);
PREP(getCarriedObj);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getDeathAnim);
@ -104,6 +95,9 @@ PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(getWeaponState);
PREP(getWeaponType);
PREP(getWindDirection);
PREP(goKneeling);
@ -126,7 +120,6 @@ PREP(isModLoaded);
PREP(isPlayer);
PREP(isTurnedOut);
PREP(letterToCode);
PREP(limitMovementSpeed);
PREP(loadPerson);
PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
@ -150,9 +143,7 @@ PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCameraEventHandler);
PREP(removeCanInteractWithCondition);
PREP(removeCustomEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
@ -166,7 +157,6 @@ PREP(serverLog);
PREP(setArrestState);
PREP(setCanInteract);
PREP(setCaptivityStatus);
PREP(setCarriedBy);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
@ -258,14 +248,15 @@ if (hasInterface) then {
ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player];
uiNamespace setVariable ["ACE_player", ACE_player];
// Raise custom event. @todo, remove
[missionNamespace, "playerChanged", [ACE_player, _oldPlayer]] call FUNC(callCustomEventHandlers);
// Raise ACE event
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;
};
// Init toHex
[0] call FUNC(toHex);
ADDON = true;
isHC = !(hasInterface || isDedicated);

View File

@ -3,7 +3,7 @@
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Misc"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};
author[] = {"KoffeinFlummi"};
@ -13,11 +13,16 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgActions.hpp"
#include "CfgMoves.hpp"
#include "CfgVoice.hpp"
class ACE_Rsc_Display_Base {
idd = -1;
type = 0;
@ -82,12 +87,12 @@ class ACE_Settings {
value = 0;
typeName = "BOOL";
};
class GVAR(enableNumberHotkeys) {
/*class GVAR(enableNumberHotkeys) {
value = 1;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Common_EnableNumberHotkeys";
};
};*/
class GVAR(settingFeedbackIcons) {
value = 1;
typeName = "SCALAR";
@ -126,9 +131,6 @@ class ACE_Settings {
#include <ProgressScreen.hpp>
#include <HintConfig.hpp>
#include <RscInfoType.hpp>
#include <FixPickup.hpp>
#include <FixAnimations.hpp>
#include <NoVoice.hpp>
class CfgUIGrids {
class IGUI {

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Converts ASL to Arma "Position"
*
* Arguments:

View File

@ -1,39 +0,0 @@
/*
* Author: commy2
*
* Add a camera view event handler. The event script is called when the camera view changes.
* The argument of the called function is stored in the _this variable and has as first element the new camera mode. Possible arguments are ["INTERNAL"], ["EXTERNAL"], ["GUNNER"] and ["GROUP"].
*
* Argument:
* 0: Code to execute (Code or String)
*
* Return value:
* ID of the event script (used to remove it later).
*/
#include "script_component.hpp"
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
_statement = _this select 0;
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
if (_id == 0) then {
uiNamespace setVariable ["ACE_EventHandler_CameraMode", cameraView];
(QGVAR(EventHandlerHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(EventHandlerHelper), "PLAIN"];
};
_actionIDs pushBack _id;
_actions pushBack _statement;
missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_id, _actionIDs, _actions]];
_id

View File

@ -1,39 +0,0 @@
/*
* Author: commy2
*
* Add a custom event to a unit. The event scripts are called by FUNC(callCustomEventHandlers).
*
* Argument:
* 0: Object the event should be assigned to or namespace (Object OR Namespace)
* 1: Name of the event (String)
* 2: Code to execute (Code or String)
*
* Return value:
* ID of the event script (used to remove it later).
*/
#include "script_component.hpp"
private ["_object", "_type", "_statement", "_name", "_actionsVar", "_id", "_actionIDs", "_actions"];
_object = _this select 0;
_type = _this select 1;
_statement = _this select 2;
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
_name = format ["ACE_CustomEventHandlers_%1", _type];
_actionsVar = _object getVariable [_name, [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_actionIDs pushBack _id;
_actions pushBack _statement;
_object setVariable [_name, [_id, _actionIDs, _actions]];
_id

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
*
* Add line to draw on debug
*

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Adds a new setting at runtime, with all it's metadata.
* If has only local effects.
*

View File

@ -1,12 +0,0 @@
/**
* fn_beingCarried.sqf
* @Descr: Check if object is being carried
* @Author: Glowbal
*
* @Arguments: [object OBJECT]
* @Return: BOOL True if object is being carried
* @PublicAPI: true
*/
#include "script_component.hpp"
!(isNull ([_this select 0] call FUNC(getCarriedObj)));

View File

@ -1,6 +1,6 @@
/*
* Author: CAA-Picard and Jaynus
* Returns the result of the function and caches it up to a given time
* Author: esteldunedain and Jaynus
* Returns the result of the function and caches it up to a given time or event
*
* Arguments:
* 0: Parameters <ARRAY>
@ -8,6 +8,7 @@
* 2: Namespace to store the cache on <NAMESPACE>
* 3: Cache uid <STRING>
* 4: Max duration of the cache <NUMBER>
* 5: Event that clears the cache <STRING> (Optional)
*
* Return Value:
* Result of the function <ANY>
@ -20,6 +21,40 @@ EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration);
if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
_namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
// Does the cache needs to be cleared on an event?
if (count _this > 5) then {
private ["_event","_varName","_cacheList"];
_event = _this select 5;
_varName = format [QGVAR(clearCache_%1),_event];
_cacheList = missionNamespace getVariable _varName;
// If there was no EH to clear these caches, add one
if (isNil {_cacheList}) then {
_cacheList = [];
missionNamespace setVariable [_varName, _cacheList];
[_event, {
private ["_varName","_cacheList"];
// _eventName is defined on the function that calls the event
#ifdef DEBUG_MODE_FULL
diag_log text format ["ACE: Clear cached variables on event: %1", _eventName];
#endif
// Get the list of caches to clear
_varName = format [QGVAR(clearCache_%1),_eventName];
_cacheList = missionNamespace getVariable [_varName, []];
// Erase all the cached results
{
_x call FUNC(eraseCache);
} forEach _cacheList;
// Empty the list
missionNamespace setVariable [_varName, []];
}] call FUNC(addEventhandler);
};
// Add this cache to the list of the event
_cacheList pushBack [_namespace, _uid];
};
#ifdef DEBUG_MODE_FULL
diag_log format ["Calculated result: %1 %2", _namespace, _uid];
} else {

View File

@ -1,31 +0,0 @@
/*
* Author: commy2
*
* Execute all custom event script assigned to this object.
*
* Argument:
* 0: Object the eventhandlers are assigned to or namespace (Object or Namespace)
* 1: Name of the event (String)
* 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to])
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_object", "_type", "_argument", "_name", "_actions"];
_object = _this select 0;
_type = _this select 1;
_argument = _this select 2;
if (isNil "_argument") then {_argument = [_object]};
_name = format ["ACE_CustomEventHandlers_%1", _type];
_actions = (_object getVariable [_name, [-1, [], []]]) select 2;
{
_argument call _x; nil;
} count _actions;
nil

View File

@ -1,16 +0,0 @@
/*
* Author: commy2
*
* Execute all custom event script assigned to this object on every machine.
*
* Argument:
* 0: Object the eventhandlers are assigned to or namespace (Object or Namespace)
* 1: Name of the event (String)
* 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to])
*
* Return value:
* None.
*/
#include "script_component.hpp"
[_this, QUOTE(FUNC(callCustomEventHandlers)), 2] call FUNC(execRemoteFnc);

View File

@ -69,7 +69,7 @@ switch (_position) do {
case "gunner" : {
private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretGunner);
_turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -82,7 +82,7 @@ switch (_position) do {
case "commander" : {
private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretCommander);
_turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -95,7 +95,7 @@ switch (_position) do {
case "copilot" : {
private "_turretConfig";
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
_turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
@ -108,7 +108,7 @@ switch (_position) do {
case "turret" : {
private ["_turrets", "_turretConfig"];
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX
@ -136,7 +136,7 @@ switch (_position) do {
case "ffv" : {
private ["_turrets", "_turretConfig"];
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX

View File

@ -1,13 +0,0 @@
/**
* fn_carriedByObj.sqf
* @Descr: Check if object A is being carried by object B.
* @Author: Glowbal
*
* @Arguments: [object OBJECT, unit OBJECT]
* @Return: BOOL True if B is carrying A.
* @PublicAPI: true
*/
#include "script_component.hpp"
([(_this select 0)] call FUNC(getCarriedBy) == [(_this select 1)] call FUNC(getCarriedBy));

View File

@ -1,72 +0,0 @@
/**
* fn_carryObj.sqf
* @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)]
* @Return: BOOL Returns true if succesful
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"];
_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param;
_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param;
_fallDown = false;
if (count _this > 3) then {
_fallDown = _this select 3;
};
_return = false;
[format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug);
if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then {
if (vehicle _unit != _unit) exitwith {};
if (!isNull _to) then {
if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then {
_return = true;
_unit setvariable [QGVAR(carriedObj),_to,true];
if (_fallDown) then {
// [_unit,_fallDown] call FUNC(limitMovementSpeed);
};
[_to, _unit] call FUNC(setCarriedBy);
if (count _this > 2) then {
if (count (_this select 2) == 3) then {
_to attachTo [_unit,(_this select 2)];
[format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug);
};
};
["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
// ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
};
} else {
if (!isNull ([_unit] call FUNC(getCarriedObj))) then {
[format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug);
_carriedObj = ([_unit] call FUNC(getCarriedObj));
detach _carriedObj;
//_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0];
if (!surfaceIsWater getPos _unit) then {
_positionUnit = getPosATL _carriedObj;
_positionUnit set [2, ((getPosATL _unit) select 2) + 0.1];
_carriedObj setPosATL _positionUnit;
} else {
_positionUnit = getPosASL _carriedObj;
_positionUnit set [2, ((getPosASL _unit) select 2) + 0.1];
_carriedObj setPosASL _positionUnit;
};
[[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy);
_unit setvariable [QGVAR(carriedObj),_to,true];
_return = true;
["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent);
// ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent;
};
};
} else {
[format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug);
};
_return

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
*
* Returns a orthonormal system of reference aligned with the supplied vector
*

View File

@ -50,13 +50,13 @@ if (_state) then {
};
_ctrl = _dlg displayctrl 103;
_ctrl ctrlSetEventHandler ["buttonClick", "while {!isNull (uiNamespace getVariable ['GVAR(dlgDisableMouse)', displayNull])} do {closeDialog 0}; failMission 'LOSER'; [false] call FUNC(disableUserInput);"];
_ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable true;
_ctrl ctrlSetText "ABORT";
_ctrl ctrlSetTooltip "Abort.";
_ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer);
_ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; player setDamage 1; [false] call FUNC(disableUserInput);"];
_ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}});
_ctrl ctrlSetText "RESPAWN";
_ctrl ctrlSetTooltip "Respawn.";

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Deletes a cached result
*
* Arguments:

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
*
* Executes a code on the next frame
*

View File

@ -1,13 +0,0 @@
/**
* fn_getCarriedBy.sqf
* @Descr: Get the object that is carrying given unit or object
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: OBJECT Returns the object that is carrying the unit. Otherwise returns ObjNull
* @PublicAPI: true
*/
#include "script_component.hpp"
((_this select 0) getvariable [QGVAR(carriedBy),objNull]);

View File

@ -1,13 +0,0 @@
/**
* fn_getCarriedObj.sqf
* @Descr: Grab the registered carried object
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: OBJECT Returns the object that the unit is currently carrying. If not carrying, returns ObjNull
* @PublicAPI: true
*/
#include "script_component.hpp"
((_this select 0) getvariable [QGVAR(carriedObj),objNull]);

View File

@ -4,7 +4,7 @@
* Get the commander config of a vehicles turret.
*
* Argument:
* 0: vehicle type (String)
* 0: vehicle (Object)
*
* Return value:
* Commander config (Config)
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0;
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretCommander);
[_config, _turret] call FUNC(getTurretConfigPath)

View File

@ -4,7 +4,7 @@
* Get the gunner config of a vehicles turret.
*
* Argument:
* 0: vehicle type (String)
* 0: vehicle (Object)
*
* Return value:
* Gunner config (Config)
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
_vehicle = _this select 0;
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretGunner);
[_config, _turret] call FUNC(getTurretConfigPath)

View File

@ -4,23 +4,23 @@
* Gets the turret index of door gunners
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret indexes of the door gunner. Empty array means no gunner position. (Array)
*/
#include "script_component.hpp"
private ["_vehicleType", "_turrets", "_doorTurrets", "_config"];
private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
_vehicleType = _this select 0;
_vehicle = _this select 0;
_turrets = [_vehicleType] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_doorTurrets = [];
{
_config = configFile >> "CfgVehicles" >> _vehicleType;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {

View File

@ -64,7 +64,7 @@ switch (_position) do {
};
case "gunner" : {
_turret = [typeOf _vehicle] call FUNC(getTurretGunner);
_turret = [_vehicle] call FUNC(getTurretGunner);
if (CANGETINTURRETINDEX) then {
_script = [
@ -75,7 +75,7 @@ switch (_position) do {
};
case "commander" : {
_turret = [typeOf _vehicle] call FUNC(getTurretCommander);
_turret = [_vehicle] call FUNC(getTurretCommander);
if (CANGETINTURRETINDEX) then {
_script = [
@ -86,7 +86,7 @@ switch (_position) do {
};
case "copilot" : {
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
_turret = [_vehicle] call FUNC(getTurretCopilot);
if (CANGETINTURRETINDEX) then {
_script = [
@ -100,7 +100,7 @@ switch (_position) do {
case "turret" : {
private "_turrets";
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [
@ -127,7 +127,7 @@ switch (_position) do {
case "ffv" : {
private "_turrets";
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Returns the metadata of a setting if it exists
*
* Arguments:

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles commander.
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles commander. Empty array means no observer position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_turret = [];
{
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles copilot.
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no copilot position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_turret = [];
{
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret index of a vehicles gunner.
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no gunner position. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_turret = [];
{
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -18,7 +18,6 @@ _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]};
//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_units = [];

View File

@ -4,7 +4,7 @@
* Get the turret indices of ffv turrets.
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_turret = [];
{
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -4,7 +4,7 @@
* Get the turret indices of other turrets (not gunner, commander, copilot or ffv).
*
* Argument:
* 0: Vehicle type (String)
* 0: Vehicle (Object)
*
* Return value:
* Turret index of the vehicles gunner. Empty array means no other turrets. (Array)
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
_vehicle = _this select 0;
_turrets = [_vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];
_turret = [];
{
_config = configFile >> "CfgVehicles" >> _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath);

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

@ -19,7 +19,7 @@ _vector2 = _this select 1;
_newVector = [];
for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do {
_newVector = _newVector + [(_vector1 select _i) * (_vector2 select _i)];
_newVector pushBack ((_vector1 select _i) * (_vector2 select _i));
};
_newVector

View File

@ -1,53 +0,0 @@
/**
* fn_limitMovementSpeed.sqf
* @Descr: Limits the movement speed of a unit
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, fallDown BOOL (Optional)]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_carriedObj"];
_unit = _this select 0;
_fallDown = false;
if (count _this > 1) then {
_fallDown = _this select 1;
};
if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith {
_unit setvariable [QGVAR(limitMovementSpeed),nil,true];
};
[{
private["_unit","_fallDown","_carriedObj"];
_unit = (_this select 0) select 0;
_fallDown = (_this select 0) select 1;
_carriedObj = [_unit] call FUNC(getCarriedObj);
if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if !((!isNull _carriedObj) && (alive _unit)) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then {
_unit setVelocity [0,0,0];
if (_fallDown) then {
_unit playMove "amovppnemstpsraswrfldnon";
};
if (_carriedObj isKindOf "Man") then {
hint "You can not move this fast while transporting this person.";
} else {
hint "You can not move this fast while carrying this object";
};
[_unit,ObjNull] call FUNC(carryObj);
};
}, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler;

View File

@ -35,8 +35,6 @@ if (_unit distance _loadcar <= 10) then {
};
if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
[_caller,objNull] call FUNC(carryObj);
[_unit,objNull] call FUNC(carryObj);
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
};
_vehicle

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Load the user setable settings from the user profile.
* Config < Server UserConfig < Mission Config < Client settings
*

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Load the parameters on the server.
* Config < Server UserConfig < Mission Config
*

View File

@ -1,15 +1,4 @@
// by commy2
#include "script_component.hpp"
private ["_array", "_index"];
_array = [];
for "_index" from 0 to 10000 do {
if (str (findDisplay _this displayCtrl _index) != "No control") then {
diag_log text str (findDisplay _this displayCtrl _index);
_array pushBack _index;
};
};
_array;
[allControls findDisplay _this, {ctrlIDC _this}] call FUNC(map)

View File

@ -1,15 +1,4 @@
// by commy2
#include "script_component.hpp"
private ["_array", "_index"];
_array = [];
for "_index" from 0 to 10000 do {
if (str (findDisplay _index) != "No Display") then {
diag_log text str findDisplay _index;
_array pushBack _index;
};
};
_array;
[allDisplays, {ctrlIDD _this}] call FUNC(map)

View File

@ -12,33 +12,29 @@
*/
#include "script_component.hpp"
private ["_number", "_minLength", "_length", "_digits", "_index", "_count"];
private ["_number", "_minLength", "_length", "_digits"];
_number = _this select 0;
_minLength = _this select 1;
_number = _number min 999999;
_length = floor (log _number + 1);
if !(isNil "_minLength") then {_length = (_length max _minLength) min 6};
_number = str _number;
_length = count _number;
if (isNil "_minLength") then {_minLength = _length};
_minLength = _minLength min 6;
while {_length < _minLength} do {
_number = "0" + _number;
_length = _length + 1;
};
_digits = [];
if (_number < 1) exitWith {
for "_index" from 0 to (_length - 1) do {
_digits set [_index, 0];
};
_digits
for "_x" from 0 to (_length - 1) do {
_digits pushBack parseNumber (_number select [_x, 1]);
};
while {
_count = count _digits;
_count < _length
} do {
_digit = floor (_number / (10 ^ (_length - _count - 1)));
{
_digit = _digit - _x * (10 ^ (_count - _forEachIndex));
} forEach _digits;
_digits set [_count, _digit];
};
_digits

View File

@ -12,14 +12,24 @@
*/
#include "script_component.hpp"
private ["_digits", "_count", "_string", "_index"];
private ["_number", "_minLength", "_length"];
_digits = _this call FUNC(numberToDigits);
_number = _this select 0;
_minLength = _this select 1;
_count = count _digits;
_number = _number min 999999;
_string = "";
for "_index" from 0 to (_count - 1) do {
_string = _string + str (_digits select _index);
_number = str _number;
_length = count _number;
if (isNil "_minLength") then {_minLength = _length};
_minLength = _minLength min 6;
while {_length < _minLength} do {
_number = "0" + _number;
_length = _length + 1;
};
_string
_number

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
* Converts Arma "Position" to ASL
*
* Arguments:

View File

@ -53,6 +53,7 @@ _perFrameFunction = {
_elapsedTime = time - _startTime;
_errorCode = -1;
// this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all.
if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then {
_errorCode = 1;
} else {

View File

@ -1,5 +1,5 @@
/*
* Author: CAA-Picard
* Author: esteldunedain
*
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
* Must be called on the server, effect is global.

View File

@ -1,34 +0,0 @@
/*
* Author: commy2
*
* Remove a camera view event handler.
*
* Argument:
* 0: ID of the event handler (Number)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
_id = _this select 0;
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]];
_currentId = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs set [_id, -1];
_actionIDs = _actionIDs - [-1];
_actions set [_id, []];//{}
_actions = _actions - [[]];//[{}]
missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_currentId, _actionIDs, _actions]];

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